vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   New Posts & Threads x2 (https://vborg.vbsupport.ru/showthread.php?t=66058)

gamesxposed 06-10-2004 10:00 PM

New Posts & Threads x2
 
All this does is simply retrieve the amount of new posts, so I made it add the count in Navbar, and in Statistics down the bottom.

In the navbar it is global, you can see it next to "New Posts". I also made it so if there is more then one post it add's the "S" at the end, note the "[snos]". It is also found down the bottom of your page in "Statistics". Hope you like it. There is also a "New threads" feature in the statistics part, where it shows new threads.

Index.php
find:
PHP Code:

// ### BOARD STATISTICS ################################################# 

After add:
PHP Code:

//
//START NEW THREADS AND POSTS
//
$newthreads $DB_site->query_first("SELECT count(*) AS count FROM " TABLE_PREFIX "thread WHERE lastpost > 

'
$bbuserinfo[lastvisit]'");


if (
$newthreads[count] == 1)
{
    
$newthreads[snos] = "";
}
else
{
    
$newthreads[snos] = "s";
}
//
//END NEW THREADS AND POSTS
// 

Style manager >> Your style >> PHP include templates >> phpinclude_start

Add:
PHP Code:

$newposts $DB_site->query_first("SELECT count(*) AS count FROM " TABLE_PREFIX "post WHERE dateline > '$bbuserinfo[lastvisit]'"); 

if (
$newposts[count] == 1

    
$newposts[snos] = ""

else 

    
$newposts[snos] = "s"


Style manager >> Your style >> Navigation / Breadcrumb Templates > navbar

Find:
PHP Code:

<a href="search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts_nav]</a

Replace with:
PHP Code:

<a href="search.php?$session[sessionurl]do=getnew">$vbphrase[new_posts_nav] ($newposts[count])</a

Style manager >> Your style >> Forum home templates > FORUMHOME

Find:
PHP Code:

<div>$vbphrase[threads]: $totalthreads$vbphrase[posts]: $totalposts$vbphrase[members]: $numbermembers</div>
            <
div><phrase 1="member.php?$session[sessionurl]u=$newuserid2="$newusername">$vbphrase[welcome_to_our_newest_member_x]</phrase></div

After add:
PHP Code:

<a href="search.php?$session[sessionurl]do=getnew">$newposts[count]</a> New post$newposts[snoswithin <a href="search.php?$session[sessionurl]do=getnew">$newthreads[count]</athread$newthreads[snossince you last visited

Should be all working, any questions feel free to ask. I will provide support, also any bugs found, or any ideas for improvment please don't hesitate to share your comment.

Statistics screenshot: http://64.5.56.7/images/stats.jpg
Navbar screenshot: http://64.5.56.7/images/navbar.jpg

Enjoy! :cool:

Update 12:53 AM EST. - Moved uneeded global query to index.php.

Intex 06-11-2004 10:54 AM

Funnily enough, just made the same modification myself because it didn't have that info and didn't want the welcome panel hack. I'm sure others would find it useful. Good job.

AlexanderT 06-11-2004 12:39 PM

You notice that this will add two extra queries on every single page?

reteep 06-11-2004 01:24 PM

Yep and those 2 more queries hurt. If you got a populated forum this hack will lag it to death.

Nice idea but it results into a too heavy load :/

gamesxposed 06-11-2004 01:43 PM

When I get some time I'll move the second query.

EDIT - I just moved the index query to index.php, so now there is only one global query added, I'll try get rid of the index.php query tomorrow after some sleep.

Nite' people! :squareeyed:

GamerJunk.net 06-12-2004 08:24 PM

Good work!

gamesxposed 06-18-2004 03:31 AM

Thanks man. :cool:

aHMET 07-22-2004 03:20 PM

any other version?

Symbian.info 08-13-2004 12:15 AM

Only use the new threads function and thats works great :cool:

Ian Emu-UK 08-24-2004 06:48 PM

Nice hack, is there a way to exclude private forums from the search?

Or better still, base them on each users priviledges (Probably server intensive and not worth the bother ;))

Thanks for the hack anyway.


All times are GMT. The time now is 02:24 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.01151 seconds
  • Memory Usage 1,751KB
  • 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
  • (7)bbcode_php_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
  • (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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete