vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Number of new posts in navbar? (https://vborg.vbsupport.ru/showthread.php?t=75539)

ericgtr 03-21-2005 02:35 PM

Quote:

Originally Posted by SGT Rock
All I get is a set of parenthesis without a number: ()

Did you add the edit to your phpinclude_start? I haven't tried it there (where sabret00the suggests) but it looks like it should work with out a problem.

SGT Rock 03-21-2005 02:47 PM

yep, I followed sabertooth to the letter

dmbooth0310 08-03-2005 09:46 PM

I know this is old but how would I get this to work with vBadvanced? It doesn't show a zero on the portal, just ()

SlowFiveOh 11-20-2008 06:27 PM

Quote:

Originally Posted by sabret00the (Post 606027)
add to your phpinclude_start
PHP Code:

//New Posts
        
$getnewposts =$DB_site->query_first("SELECT COUNT(*) AS count FROM " .TABLE_PREFIX "post WHERE dateline >= '$bbuserinfo[lastvisit]'");
        
$newposts number_format($getnewposts['count']);
//New Posts 

In your navbar template find:

PHP Code:

<td class="vbmenu_control"><ahref="search.php?$session[sessionurl]do=getnew"accesskey="2">$vbphrase[new_posts_nav]</a></td

Replace it with:

PHP Code:

<td class="vbmenu_control"><ahref="search.php?$session[sessionurl]do=getnew"accesskey="2">$vbphrase[new_posts_nav]</a> ($newpostsnew)</td

That's it! :)

I know this thread is old. But will this work as described in 3.7? Also, when i add the code to my phpinclude_start template, do I delete what is there? This is what it has now.

PHP Code:

/*
// Example of how to include a seperate file:

ob_start();
include('yourheader.html');
$your_code = ob_get_contents();
ob_end_clean();

// Now place a reference to $your_code where you want the resulting HTML to be displayed.
// This will most likely be the header or footer template.
*/
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM ".TABLE_PREFIX."post WHERE dateline > '$bbuserinfo 


Lynne 11-20-2008 07:48 PM

I think now days you would put the code in a plugin - maybe at the global_start hook location.

artscripts 11-12-2011 12:54 PM

Help make it into 4.1.7


All times are GMT. The time now is 05:14 PM.

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.01244 seconds
  • Memory Usage 1,736KB
  • 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_php_printable
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete