Topic: how to add time posted to my script.

i want to add the time stamp to this script for my frontpage of my site
http://southernhotbody.com

<div class="right">
                    <?php
$newsid = '1'; // Forum id to fetch the news from ( only supports 1 forum id )
$newsdisplay = '5'; // Number of news to display.
?>
<?php
require_once PUN_ROOT.'include/parser.php';
?>
<?
$result = $db->query('SELECT t.id, t.subject, t.num_replies, t.last_post, t.last_post_id, t.last_poster, t.num_views, t.forum_id, p.poster, p.poster_id, p.message, p.hide_smilies, p.posted, g.g_title, f.forum_name FROM '.$db->prefix.'topics AS t INNER JOIN '.$db->prefix.'posts AS p ON p.topic_id=t.id AND p.posted=t.posted INNER JOIN '.$db->prefix.'users AS u ON u.id=p.poster_id LEFT JOIN '.$db->prefix.'groups AS g ON g.g_id=u.group_id INNER JOIN '.$db->prefix.'forums AS f ON f.id=t.forum_id WHERE t.forum_id='.$newsid.' AND t.moved_to IS NULL AND f.redirect_url IS NULL ORDER BY t.posted DESC LIMIT '.$newsdisplay) or error('Unable to fetch announcements', __FILE__, __LINE__, $db->error());

if ($db->num_rows($result))
                    {
                            while($cur_post = $db->fetch_assoc($result))
                            {
                                    $cur_post['message'] = parse_message($cur_post['message'], $cur_post['hide_smilies']);
?>
<div class="block">
<?
echo "\t\t\t\t\t\t\t".' <h2>'.pun_htmlspecialchars($cur_post['subject']).'</h2>'."\n";
?>
<ul>
<?php echo $cur_post['message']."\n" ?><br />
<div style="text-align: right">
<?
echo "\t\t\t\t\t\t\t".'<a style="text-decoration: none" href="forum/viewtopic.php?id='.$cur_post['id'].'" class="username">'.pun_htmlspecialchars($lang_portal['Visit_Topic']).'</a>'."\n";
?>
</div>
<div style="text-align: right">
<?
echo "\t\t\t\t\t\t\t".'<p class="date">Posted by: <a style="text-decoration: none" href="forum/profile.php?id='.$cur_post['poster_id'].'" class="username">'.pun_htmlspecialchars($cur_post['poster']).'</a> <a href="about.php"> | Read more</a> <img src="images/comment.gif" alt="" />  '.pun_htmlspecialchars($lang_portal['Comments']).': '.pun_htmlspecialchars($cur_post['num_replies']).' <a href="#">Comments (3)</a> <img src="images/timeicon.gif" alt="" /> '.pun_htmlspecialchars($lang_portal['Views']).': '.pun_htmlspecialchars($cur_post['num_views']).'</span></p><br />'."\n";
?>

</div>
</ul>
</div>
<?
}
 }
else
{

 }    
?>
                </div>
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 !!!

Re: how to add time posted to my script.

It looks like it should be available as:

$cur_post['posted']

3 (edited by quaker 2007-01-22 07:48)

Re: how to add time posted to my script.

well i see that

<img src="images/timeicon.gif" alt="" />

but it doesnt show the time it was posted...
it needs to go along that line.. with the timeicon.gif

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 !!!