jmyeom

recent posts / images

Jul 14th, 2012
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. NOTE: RECENT IMAGES NOT YET COMPLETE, BUT POSTS STILL WORK, WILL UPDATE SOON, THIS ONLY CONTAINS POSTS
  2.  
  3.  
  4. This will show recent posts of the left,
  5. they can be turned off in the config,
  6. there has been so many different implementations of this functions
  7.  
  8.  
  9. files added:
  10.  
  11. files changed:
  12. news.tpl in dwoo/templates
  13. config.php in /
  14. news.php in /
  15.  
  16. Known bugs:
  17. None yet, all resolved
  18.  
  19.  
  20.  
  21. instructions:
  22. for the config, add this anywhere, (i add it under the "Extra features" section ~line 174)
  23.  
  24. // Recent images / posts
  25. $cf['KU_RECENTPOSTS'] = "15"; // How many posts to show in the news page, set to 0 to totally disable the function
  26. $cf['KU_OMITBOARDS'] = "0"; // List of board ID's to not show for recent images or posts, with a comma (,) between them. MUST BE SET TO ZERO IF NOT OMITING BOARDS
  27. $cf['KU_ONLYOP'] = false; // Whether or not to show only images/posts that are not replys. RECOMMENDED FALSE
  28.  
  29.  
  30.  
  31. also, you need to add these css rules into your site_*.css files
  32.  
  33. #recentposts a{
  34. font-size: 14px;
  35. color: #D80000;
  36. text-decoration: none;
  37. }
  38.  
  39.  
  40. #recentposts table{
  41. height:auto;
  42. float:left;
  43. width:200px;
  44. border:1px solid black;
  45. text-align:center;
  46. margin-top:25px;
  47. margin-right:10px;
  48. margin-left:20px;
  49. }
  50.  
  51.  
  52.  
  53. news.php, add these under: $dwoo_data->assign('botads', $botads);
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64. $sqlquery = "SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` NOT IN (" . KU_OMITBOARDS . ") AND `is_deleted` = 0 and `message` <> ''";
  65. if (KU_ONLYOP){ $sqlquery .= " AND `parentid` = 0";}
  66. $sqlquery .= " ORDER BY `timestamp` DESC LIMIT " . KU_RECENTPOSTS;
  67. $recentposts = $tc_db->GetAll($sqlquery);
  68. foreach ($recentposts as $key => $value) {$recentposts[$key]['boardname'] = $tc_db->GetOne("SELECT `name` FROM `" . KU_DBPREFIX . "boards` WHERE `id` = '" . $recentposts[$key]['boardid'] . "'");}
  69. $dwoo_data->assign('recentposts', $recentposts);
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82. and now news.tpl, under: <body>
  83.  
  84. {if $dwoo.const.KU_RECENTPOSTS neq '0'}
  85. <div id="recentposts">
  86. <table id="recent">
  87. <tr>
  88. <th class=recenthead>Recent Posts</th>
  89. </tr>
  90. <tr>
  91. <td>
  92. {foreach item=post from=$recentposts}
  93. ----------------------------<br />
  94. {$post.message|stripslashes}
  95. <li style=list-style-type:none>
  96. <a href="{$dwoo.const.KU_WEBFOLDER}{$post.boardname}/res/{if $post.parentid eq '0'}{$post.id}{else}{$post.parentid}{/if}.html#{$post.id}" border="1">
  97. >>>/{$post.boardname}/{$post.id}
  98. </a>
  99. </li>
  100.  
  101. {/foreach}
  102. ----------------------------<br />
  103. </td>
  104. </tr>
  105. </table>
  106. </div>
  107. {/if}
  108.  
  109. and boom! your done!
  110.  
  111.  
  112.  
  113. Updates:
  114. v 1.0
  115. first release
Advertisement
Add Comment
Please, Sign In to add comment