PDA

View Full Version : New Posting Features - NJAquaman - New Post Count!


NJAquaman
07-04-2009, 10:00 PM
What: A Global Var for all New post counts.
A global variable to call all new post to use for navbar ect ect
along with the ability to clear and search the forum (links).

WORKS WITH ..!!!
3.6.x
3.7.x
3.8.x

Install:

1) import the product .xml
2) Place the $pcount var anywhere you want in any template to show up !


2.1) This is the code to show the pcount with search and to clear the count. Place it in the navbar or anywhere.


<a href="/forum/search.php?$session[sessionurl]do=getnew" accesskey="2">New Posts <if condition="$pcount">($pcount)</if></a>
<a href="/forum/forumdisplay.php?$session[sessionurl]do=markread">Clear Post Count</a>


Demo:
101562

New posts is click able showing you the threads that the post it is in
Clear post get rid of the pcount number if you already read the posts


DONT FORGET TO CLICK INSTALL (https://vborg.vbsupport.ru/vborg_miscactions.php?do=installhack&threadid=217881)

__________________________________________________ ______________
Change Log
v1.1 - 08/23/09
- corrected some minor tweaks
__________________________________________________ ______________

deadlySniper
07-05-2009, 01:55 PM
Wow, this mod is hawt!
Installed!

Thanks alot!

saadessa
07-05-2009, 04:27 PM
<div align="left">Thank you very special</div>

Charlie98902
01-05-2010, 01:25 PM
Please port over to vb 4.

NJAquaman
01-05-2010, 04:40 PM
Please port over to vb 4.

thank you for your interest . Conversion for 4.0 will be out soon!
:up:
Thanks!

blind-eddie
02-19-2017, 10:59 AM
Yes, I know this is an old thread...
I want to exclude four forums from showing in the search results, What edit would be needed to achieve that goal?

Plugin code:

if ($vbulletin->userinfo['userid'])
{
$pcount = $vbphrase['no_new_posts_welcome'];
$postcount = $vbulletin->db->query_first("
SELECT COUNT(dateline) as pcount
FROM ".TABLE_PREFIX."post
WHERE dateline > ".$vbulletin->userinfo['lastvisit']
);
if ($postcount['pcount'])
{
if ($postcount['pcount'] == 1)
{
$pcount = "1";
}
else
{
$pcount = $postcount['pcount'];
}
}

}

Dave
02-20-2017, 11:21 PM
Yes, I know this is an old thread...
I want to exclude four forums from showing in the search results, What edit would be needed to achieve that goal?

Plugin code:

if ($vbulletin->userinfo['userid'])
{
$pcount = $vbphrase['no_new_posts_welcome'];
$postcount = $vbulletin->db->query_first("
SELECT COUNT(dateline) as pcount
FROM ".TABLE_PREFIX."post
WHERE dateline > ".$vbulletin->userinfo['lastvisit']
);
if ($postcount['pcount'])
{
if ($postcount['pcount'] == 1)
{
$pcount = "1";
}
else
{
$pcount = $postcount['pcount'];
}
}

}

You'll have to join the thread table in the query and then exclude the forumids. Example:
$postcount = $vbulletin->db->query_first("
SELECT COUNT(post.dateline) as pcount
FROM ".TABLE_PREFIX."post
INNER JOIN thread ON thread.threadid = post.threadid
WHERE post.dateline > " . $vbulletin->userinfo['lastvisit'] . " AND thread.forumid NOT IN(13,14,15,16)
);

blind-eddie
02-23-2017, 04:48 AM
Thank you Dave, I applied your edit without success.
The post count number vanishes and all new post are shown.

Thanks again for replying.

Dave
02-23-2017, 06:28 PM
Hmm I ran the query on my server and it worked, I did notice I forgot a double quote at the end of the query which would break the script.

$postcount = $vbulletin->db->query_first("
SELECT COUNT(post.dateline) as pcount
FROM ".TABLE_PREFIX."post
INNER JOIN thread ON thread.threadid = post.threadid
WHERE post.dateline > " . $vbulletin->userinfo['lastvisit'] . " AND thread.forumid NOT IN(13,14,15,16)");

blind-eddie
02-24-2017, 10:30 AM
odd, it just does not seem to work right.
As soon as I add you edit the thread count number disappears and all post are show without excluding forum post.

Oh well, thank you for helping out, I appreciate the effort.
I will just edit navbar new post link to exclude forum specific post from showing in search.