Jake Bunce
Thu 1st Apr '04, 6:40pm
How do I add the number of new posts since last visit to my FORUMHOME?
Go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start
Add this code:
// GET NUMBER OF NEW POSTS
$newposts = $DB_site->query_first("SELECT count(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline > '$bbuserinfo[lastvisit]'");
// DETERMINE IF "POSTS" IS SINGULAR OR PLURAL
if ($newposts[count] == 1)
{
$newposts[plural] = "";
}
else
{
$newposts[plural] = "s";
}
Then go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> FORUMHOME
Add this code where ever you want the message to show up:
<a href="search.php?$session[sessionurl]do=getnew">$newposts[count] new post$newposts[plural]</a>
Go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> PHP Include Code Templates -> phpinclude_start
Add this code:
// GET NUMBER OF NEW POSTS
$newposts = $DB_site->query_first("SELECT count(*) AS count FROM " . TABLE_PREFIX . "post WHERE dateline > '$bbuserinfo[lastvisit]'");
// DETERMINE IF "POSTS" IS SINGULAR OR PLURAL
if ($newposts[count] == 1)
{
$newposts[plural] = "";
}
else
{
$newposts[plural] = "s";
}
Then go to your:
Admin CP -> Styles & Templates -> Style Manager -> « » -> Forum Home Templates -> FORUMHOME
Add this code where ever you want the message to show up:
<a href="search.php?$session[sessionurl]do=getnew">$newposts[count] new post$newposts[plural]</a>