vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   New Posting Features - NJAquaman - New Post Count! (https://vborg.vbsupport.ru/showthread.php?t=217881)

NJAquaman 07-04-2009 10:00 PM

NJAquaman - New Post Count!
 
1 Attachment(s)
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
Code:

$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.

Code:

<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:
Attachment 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


__________________________________________________ ______________
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

Quote:

Originally Posted by Charlie98902 (Post 1947844)
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:

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

Quote:

Originally Posted by blind-eddie (Post 2582587)
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:

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:
PHP Code:

    $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.

PHP Code:

    $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.


All times are GMT. The time now is 01:19 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01021 seconds
  • Memory Usage 1,747KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete