Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons
NJAquaman - New Post Count! Details »»
NJAquaman - New Post Count!
Version: 1.1, by NJAquaman NJAquaman is offline
Developer Last Online: Feb 2014 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.8.x Rating:
Released: 07-04-2009 Last Update: 08-22-2009 Installs: 17
Uses Plugins
Re-useable Code Translations  
No support by the author.

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:
2009-07-05_101800.jpg

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

Download Now

File Type: xml New Post Count v1.1 .xml (1.0 KB, 129 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-05-2009, 01:55 PM
deadlySniper deadlySniper is offline
 
Join Date: Dec 2008
Location: New York
Posts: 211
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Wow, this mod is hawt!
Installed!

Thanks alot!
Reply With Quote
  #3  
Old 07-05-2009, 04:27 PM
saadessa saadessa is offline
 
Join Date: Jan 2008
Posts: 284
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

<div align="left">Thank you very special</div>
Reply With Quote
  #4  
Old 01-05-2010, 01:25 PM
Charlie98902 Charlie98902 is offline
 
Join Date: Dec 2006
Posts: 1,156
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please port over to vb 4.
Reply With Quote
  #5  
Old 01-05-2010, 04:40 PM
NJAquaman's Avatar
NJAquaman NJAquaman is offline
 
Join Date: Feb 2008
Posts: 88
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Charlie98902 View Post
Please port over to vb 4.
thank you for your interest . Conversion for 4.0 will be out soon!
:up:
Thanks!
Reply With Quote
  #6  
Old 02-19-2017, 10:59 AM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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'];
		}
	}

}
Reply With Quote
  #7  
Old 02-20-2017, 11:21 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by blind-eddie View Post
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)
    ); 
Reply With Quote
Благодарность от:
MarkFL
  #8  
Old 02-23-2017, 04:48 AM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Dave, I applied your edit without success.
The post count number vanishes and all new post are shown.

Thanks again for replying.
Reply With Quote
  #9  
Old 02-23-2017, 06:28 PM
Dave Dave is offline
 
Join Date: May 2010
Posts: 2,583
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)"); 
Reply With Quote
  #10  
Old 02-24-2017, 10:30 AM
blind-eddie's Avatar
blind-eddie blind-eddie is offline
 
Join Date: Apr 2006
Location: Michigan
Posts: 2,310
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:14 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.04399 seconds
  • Memory Usage 2,320KB
  • Queries Executed 26 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (4)bbcode_code
  • (2)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (10)post_thanks_box
  • (1)post_thanks_box_bit
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (1)postbit_attachment
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete