Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NOTE: RECENT IMAGES NOT YET COMPLETE, BUT POSTS STILL WORK, WILL UPDATE SOON, THIS ONLY CONTAINS POSTS
- This will show recent posts of the left,
- they can be turned off in the config,
- there has been so many different implementations of this functions
- files added:
- files changed:
- news.tpl in dwoo/templates
- config.php in /
- news.php in /
- Known bugs:
- None yet, all resolved
- instructions:
- for the config, add this anywhere, (i add it under the "Extra features" section ~line 174)
- // Recent images / posts
- $cf['KU_RECENTPOSTS'] = "15"; // How many posts to show in the news page, set to 0 to totally disable the function
- $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
- $cf['KU_ONLYOP'] = false; // Whether or not to show only images/posts that are not replys. RECOMMENDED FALSE
- also, you need to add these css rules into your site_*.css files
- #recentposts a{
- font-size: 14px;
- color: #D80000;
- text-decoration: none;
- }
- #recentposts table{
- height:auto;
- float:left;
- width:200px;
- border:1px solid black;
- text-align:center;
- margin-top:25px;
- margin-right:10px;
- margin-left:20px;
- }
- news.php, add these under: $dwoo_data->assign('botads', $botads);
- $sqlquery = "SELECT HIGH_PRIORITY * FROM `" . KU_DBPREFIX . "posts` WHERE `boardid` NOT IN (" . KU_OMITBOARDS . ") AND `is_deleted` = 0 and `message` <> ''";
- if (KU_ONLYOP){ $sqlquery .= " AND `parentid` = 0";}
- $sqlquery .= " ORDER BY `timestamp` DESC LIMIT " . KU_RECENTPOSTS;
- $recentposts = $tc_db->GetAll($sqlquery);
- foreach ($recentposts as $key => $value) {$recentposts[$key]['boardname'] = $tc_db->GetOne("SELECT `name` FROM `" . KU_DBPREFIX . "boards` WHERE `id` = '" . $recentposts[$key]['boardid'] . "'");}
- $dwoo_data->assign('recentposts', $recentposts);
- and now news.tpl, under: <body>
- {if $dwoo.const.KU_RECENTPOSTS neq '0'}
- <div id="recentposts">
- <table id="recent">
- <tr>
- <th class=recenthead>Recent Posts</th>
- </tr>
- <tr>
- <td>
- {foreach item=post from=$recentposts}
- ----------------------------<br />
- {$post.message|stripslashes}
- <li style=list-style-type:none>
- <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">
- >>>/{$post.boardname}/{$post.id}
- </a>
- </li>
- {/foreach}
- ----------------------------<br />
- </td>
- </tr>
- </table>
- </div>
- {/if}
- and boom! your done!
- Updates:
- v 1.0
- first release
Advertisement
Add Comment
Please, Sign In to add comment