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
  #47  
Old 11-27-2001, 12:40 PM
eva2000's Avatar
eva2000 eva2000 is offline
 
Join Date: Oct 2001
Location: Brisbane, Australia
Posts: 577
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Me2Be
Hey there! Just wanted to let you know that on my small board (average 100+ users) it worked great, however, when I got it on my big board (400+ users) it dragged it down quite a bit! Those two extra queries made a big difference when index.php gets hit a ton of times
ouch

seems to run nicely on my vB
Reply With Quote
  #48  
Old 12-26-2001, 05:05 PM
Bimma Boy Bimma Boy is offline
 
Join Date: Dec 2001
Posts: 28
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I installed this hack last night and it was working fine, I then did this..

Went into the forumhome_welcometext template and took out the user name code from it and place it in my forumhome display template (I did becuase I want it to display 'wELCOME BACK USER NAME on top line, then dispaly x new threads x new posts few lines under this)

After I did this - I refreshed and instead of saying Welcome back Admin.. it said Welcome back anothermembersname ???????

I then quickly took out the user name code from the index template and put it back in the forum home_welcometext template - things were all sound again!!

Now today.. other people are saying to me that it says Welcome back differentusername instead of their own name.. The name its displaying is from the online users lists.. Whats going on??

Thanks
Reply With Quote
  #49  
Old 12-27-2001, 12:44 PM
mister mister is offline
 
Join Date: Oct 2001
Location: Detroit, MI
Posts: 92
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #50  
Old 03-02-2002, 08:58 AM
LaNder LaNder is offline
 
Join Date: Nov 2001
Posts: 19
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, i have the same problem

i had to remove this hack from my welcome-panel.

is there a chance to get a fix for it??


greets LaNder
Reply With Quote
  #51  
Old 03-02-2002, 01:37 PM
trilOByte's Avatar
trilOByte trilOByte is offline
 
Join Date: Nov 2001
Location: England
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally posted by Bimma Boy
I installed this hack last night and it was working fine, I then did this..

Went into the forumhome_welcometext template and took out the user name code from it and place it in my forumhome display template (I did becuase I want it to display 'wELCOME BACK USER NAME on top line, then dispaly x new threads x new posts few lines under this)

After I did this - I refreshed and instead of saying Welcome back Admin.. it said Welcome back anothermembersname ???????

I then quickly took out the user name code from the index template and put it back in the forum home_welcometext template - things were all sound again!!

Now today.. other people are saying to me that it says Welcome back differentusername instead of their own name.. The name its displaying is from the online users lists.. Whats going on??

Thanks
Instead of using...

Code:
Welcome back, <b>$username</b>
try...

Code:
Welcome back, <b>$bbuserinfo[username]</b>
Reply With Quote
  #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 02:52 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.05324 seconds
  • Memory Usage 2,371KB
  • Queries Executed 30 (?)
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
  • (3)bbcode_code
  • (4)bbcode_php
  • (3)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
  • (3)pagenav_pagelink
  • (16)post_thanks_box
  • (16)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (16)post_thanks_postbit_info
  • (15)postbit
  • (16)postbit_onlinestatus
  • (16)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