Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 2.x > vBulletin 2.x Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Details »»

Version: , by MrLister MrLister is offline
Developer Last Online: Oct 2012 Show Printable Version Email this Page

Version: 2.2.x Rating:
Released: 10-31-2001 Last Update: Never Installs: 85
 
No support by the author.

Somebody here request it so I made it quickly.... Basically this hack here tells your users how many new posts and threads there have been since hteir last visit on the main page.

An example is https://vborg.vbsupport.ru and right under your username.

INSTRUCTIONS:
Inside index.php (not admin) find:
PHP Code:
// if user is know, then welcome 
right under it add:
PHP Code:
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post WHERE dateline > '$bbuserinfo[lastvisit]'"); 

In the template forumhome_welcometext find:
PHP Code:
Welcome back, <b>$bbuserinfo[username]</b
right under it add:
PHP Code:
<br>There have been <b>$getnewthread[threads]</bthreads and <b>$getnewpost[posts]</bposts since your last visit

That's it! If you installed the hack please click the install button!

Show Your Support

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

Comments
  #52  
Old 03-19-2002, 07:40 PM
David Bott David Bott is offline
 
Join Date: Dec 2001
Posts: 215
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes...sorry to say for some reason this nice feature totally trashed my DB server. Actually pegs out my CPU's on the DB server only for it seems to have to count of something way too much. Currently 732 users on line. Upload index.php...crash! Ver 2.2.4
Reply With Quote
  #53  
Old 03-21-2002, 03:54 PM
LamBras LamBras is offline
 
Join Date: Mar 2002
Location: Frankfurt / Germany
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

The load of a COUNT-Statement is far too high on busy servers.
It will delay your forumshome by several seconds (!) and put an enormous load on the poor database.
If your fora are quite busy (>100 ppl online), I would disencourage you of using this hack.

Unfortunately I am no sql Guru. There is for sure a way to form a statement less ressource intensive but I am afraid I can only critizise not help
Maybe anyone can jump in here?

BTW: Allthough I may sound a bit harsh here (which I am not, I hope), I really appreciate everyone releasing hacks and I know it's sometimes really a mess to deal with, so please don't feel offended
Reply With Quote
  #54  
Old 04-01-2002, 02:19 PM
RCK's Avatar
RCK RCK is offline
 
Join Date: Jan 2002
Location: Paris / France
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by mister
The way it works now, this hack counts threads & posts in EVERY forum, private forums included.

Is there an easy way to not count those forums the user doesn't have access to?

Some of my users are confused, because it says 12 threads, but they're only getting 10 back (2 are in private forums).
Easy fix, here is your solution
into your SQL request, use this instead of original code:
Code:
$getnewthread=$DB_site->query_first("SELECT COUNT(*) AS threads FROM thread WHERE lastpost > '$bbuserinfo[lastvisit]' and forumid <> 'id of your private forum'");
$getnewpost=$DB_site->query_first("SELECT count(*) AS posts FROM post,thread WHERE post.dateline > '$bbuserinfo[lastvisit]' and thread.threadid=post.threadid and thread.forumid <> 'id of your private forum'");
Of course, this is only a temp solution, and it should have to be improved for the vb3 environement.
(auto don't count for all private forum by adding a checkbox, etc...)
Reply With Quote
  #55  
Old 04-01-2002, 03:54 PM
Okiewan's Avatar
Okiewan Okiewan is offline
 
Join Date: Dec 2001
Posts: 199
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Agreed.. I have at time 130-160 online at a time, it put a LARGE load on the CPU's and slowed the forums considerably. Nice hack for smaller boards though!
Reply With Quote
  #56  
Old 04-13-2002, 10:24 PM
Frenck's Avatar
Frenck Frenck is offline
 
Join Date: Dec 2001
Location: Hengelo, The Netherlands
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Just run this query once on your DB,

ALTER TABLE `post` ADD INDEX(`dateline`) ;

problem solved.

It brings back my page generation time back from 2.5 seconds to 0.5 seconds.
Reply With Quote
  #57  
Old 04-19-2002, 09:19 PM
robcg robcg is offline
 
Join Date: Jan 2002
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hghghghghghgh
Reply With Quote
  #58  
Old 06-10-2002, 08:35 AM
LamBras LamBras is offline
 
Join Date: Mar 2002
Location: Frankfurt / Germany
Posts: 20
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi there,
I have come back to this hack after applying tril0Byte's welcome panel hack.

And indeed, adding an index for dateline increases speed just back to normal. Great!

Hack installed
Reply With Quote
  #59  
Old 06-10-2002, 05:13 PM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a way to exclude forums from being counted?
Reply With Quote
  #60  
Old 06-10-2002, 05:19 PM
RCK's Avatar
RCK RCK is offline
 
Join Date: Jan 2002
Location: Paris / France
Posts: 45
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

one post done by me, 5 messages upper
Reply With Quote
  #61  
Old 06-11-2002, 01:11 AM
Austin Dea's Avatar
Austin Dea Austin Dea is offline
 
Join Date: Dec 2001
Location: Denver, CO, USA
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ahh .
Reply With Quote
Reply


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 09:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04615 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
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
  • (1)bbcode_code
  • (4)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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_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
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete