Hey guys, I am using the following code for one of my custom hack so I would like it converted to 3.5 please. The current code is for 3.0 so it will not work on 3.5, according to Jake.
Quote:
// 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";
}
// GET NUMBER OF NEW THREADS
$newthreads = $DB_site->query_first("SELECT count(*) AS count FROM " . TABLE_PREFIX . "thread WHERE dateline > '$bbuserinfo[lastvisit]'");
// DETERMINE IF "THREADS" IS SINGULAR OR PLURAL
if ($newthreads[count] == 1)
{
$newthreads[plural] = "";
}
else
{
$newthreads[plural] = "s";
}
$getnews = $DB_site->query_first("SELECT threadid, title FROM ".TABLE_PREFIX."thread WHERE forumid=2 ORDER BY lastpost DESC LIMIT 1");
|