Topic: vanilla style front page (active topics)
im looking to make a vanilla style front page (which has just the active topics aka new posts and ones that get replied) as my index.php while i renamed the old index as forum.php
im using this code found here
http://punbb.org/forums/viewtopic.php?pid=25650#p25650
did some editing since its not compatible with 1.3 but i still have errors
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 40
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 47
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 130
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\include\functions.php on line 478
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\include\functions.php on line 481
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\include\functions.php on line 505
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\include\functions.php on line 506
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\include\functions.php on line 506
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\include\functions.php on line 507
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\footer.php on line 39
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 75
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 83
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 88
Notice: Use of undefined constant PUN_PAGE - assumed 'PUN_PAGE' in C:\xampplite\htdocs\punbbbeta\header.php on line 119
so heres my new index.php with problems
plz help kthxbye
<?php
if (!defined('PUN_ROOT'))
define('PUN_ROOT', './');
require PUN_ROOT.'include/common.php';
($hook = get_hook('in_start')) ? eval($hook) : null;
if ($pun_user['g_read_board'] == '0')
message($lang_common['No view']);
// Load the index.php language file
require PUN_ROOT.'lang/'.$pun_user['language'].'/index.php';
$page_title = htmlspecialchars($pun_config['o_board_title']).' / Active Topics';
require PUN_ROOT.'header.php';
$day_limit = 2; // make this the auto number of days you want to be displayed.
$days = isset($_POST['days']) ? $_POST['days'] : $day_limit;
$posts_since = mktime(date("H"), date("i"), date("s"), date("m"), (date("d")-$days), date("Y"));
$latest = $db->query('SELECT t.id, t.poster, t.subject, t.posted, t.last_post, t.last_poster, t.num_replies, f.id
AS fid, f.forum_name
FROM '.$db->prefix.'topics
AS t INNER JOIN '.$db->prefix.'forums
AS f
ON t.forum_id=f.id
WHERE t.moved_to IS NULL
AND f.admmod_only=0
AND t.last_post>'.$posts_since.'
ORDER BY last_post DESC');
?>
<table class="punspacer" cellspacing="1" cellpadding="4">
<tr>
<td style="width: 14%;"><b><a href="index.php"><?php echo htmlspecialchars($pun_config['o_board_title']) ?></a> / Active Topics</b></td>
<td class="punright"><form method="post" action="">Days to show: <input type="text" name="days" value="<?php echo $days; ?>" size="3"> <input type="submit" value="Go"></form></td>
</tr>
</table>
<table class="punmain" cellspacing="1" cellpadding="4">
<tr class="punhead">
<td class="punhead"><?php echo $lang_common['Topic'] ?></td>
<td class="punhead" style="width: 5%; white-space: nowrap">Replies</td>
<td class="punhead" style="width: 14%; white-space: nowrap">Last Poster</td>
<td class="punhead" style="width: 14%; white-space: nowrap"><?php echo $lang_common['Last post'] ?></td>
</tr>
<?php
while ($ak_post = $db->fetch_assoc($latest)) {
$subject_new_posts = '[ <a href="viewtopic.php?id='.$ak_post['id'].'&action=new" title="'.$lang_common['New posts info'].'">'.$lang_common['New posts'].'</a> ]';
?>
<tr class="puntopic">
<td class="puncon2"><a href="viewtopic.php?id=<?php echo $ak_post['id'] ?>&action=new"><?php echo pun_htmlspecialchars($ak_post['subject']) ?></a> <?php echo $subject_new_posts; ?></td>
<td class="puncon2"><?php echo pun_htmlspecialchars($ak_post['num_replies']) ?></td>
<td class="puncon2"><?php echo pun_htmlspecialchars($ak_post['last_poster']) ?></td>
<td class="puncon2" style="white-space: nowrap"><?php echo format_time($ak_post['last_post']) ?></td>
</tr>
<?php
}
?>
</table>
<table class="punspacer" cellspacing="1" cellpadding="4"><tr><td> </td></tr></table>
<?php
require $pun_root.'footer.php';