here you go..
place this in a php file in the include/user folder
mine called test5.php
now go to the main.tpl and add the pun_tag.
<div class="block">
<h2 class="block2">Recent Post</h2>
<div class="box">
<div class="inbox">
<pun_include "test5.php">
</div>
</div>
</div>
<?php
showRecent(10); // Set amount of posts to be displayed here
function showRecent($show=5) {
global $lang_common, $db, $pun_config, $db_prefix;
$order_by = 't.last_post';
$forum_sql = '';
//$show = isset($_GET['show']) ? intval($_GET['show']) : 5;
//if ($show < 1 || $show > 50) $show = 5;
$trunc_len = 30; // Set amount of text to be displayed in subject.
// Fetch $show topics
$result = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id LEFT JOIN '.$db->prefix.'forum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL'.$forum_sql.' ORDER BY '.$order_by.' DESC LIMIT '.$show) or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
while ($cur_topic = $db->fetch_assoc($result)) {
if ($pun_config['o_censoring'] == '1')
$cur_topic['subject'] = censor_words($cur_topic['subject']);
$subject_truncated = pun_htmlspecialchars($cur_topic['subject']);
echo '<li> »<a href="'.$pun_config['o_base_url'].'/viewtopic.php?id='.$cur_topic['id'].'&action=new" title="'.pun_htmlspecialchars($cur_topic['subject']).'">'.substr($cur_topic['subject'], 0, $trunc_len).'</a>...'."\n";
}
echo '</li>';
return;
}
?>
My stuff or my style might sux, but atleast I'm willing to help when I can.
Don't be stupid and help ! We are the stupid one's !!!