It is for vbadvanced, but I have gotten no response on my question there so I figured I'd ask here.
A query was the way i figured I'd go, but I'm having trouble with that as it's a very weak point on my limited coding knowledge. I was hoping that using a modified version of the default vbadvanced one that gets the total new posts would do the trick. I think it would be as simple as defining a forumid...... but thats where i'm lost.
Here is the current query for getting a total count of all the forums:
PHP Code:
// New posts
if ($mod_options['portal_welcome_newposts'])
{
if (strlen($vbulletin->session->vars['newposts']) > 0 AND !$vbulletin->options['threadmarking'])
{
$newposts = number_format($vbulletin->session->vars['newposts']);
}
else
{
$getnewposts = $db->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "post AS post
" . iif($vbulletin->options['threadmarking'],
'LEFT JOIN ' . TABLE_PREFIX . 'threadread AS threadread ON (threadread.threadid = post.threadid AND threadread.userid = ' . $vbulletin->userinfo['userid'] . ')') . "
WHERE dateline >= " . $vbulletin->userinfo['lastvisit'] .
iif($vbulletin->options['threadmarking'],
' AND dateline > IF(threadread.readtime IS NULL, ' . (TIMENOW - ($vbulletin->options['markinglimit'] * 86400)) . ', threadread.readtime)') . "
AND visible = 1
");
if (!$vbulletin->options['threadmarking'])
{
$db->query_write("UPDATE " . TABLE_PREFIX . "session SET newposts = '$getnewposts[count]' WHERE userid = " . $vbulletin->userinfo['userid']);
}
$newposts = vb_number_format($getnewposts['count']);
I figured by changing the variable $newpost to $newnews and $newapps etc..... I could use the same query for each of the different outputs I wanted.
The only other thing I was thinking was getting it so it just counted new threads instead of posts, but i'd be happy with either.
Any help would be great!
--------------- Added [DATE]1227576934[/DATE] at [TIME]1227576934[/TIME] ---------------
I should add that I have the template written out, the queries are the only spot I'm stuck on right now.