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

Reply
 
Thread Tools
[VB3 RC3] Who viewed this thread? Details »»
[VB3 RC3] Who viewed this thread?
Version: 1.00, by Kentaurus Kentaurus is offline
Developer Last Online: Jul 2014 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 02-05-2004 Last Update: Never Installs: 48
 
No support by the author.

I know there is already one version of this by Gary W but I already made (and documented) my own so I thought I would post it.

Advantages of my hack:

My hack adds only 1 query to showthread, and it only queries the user table, so it is less server intensive. That is important to any busy board or anyone that wants to save some resources. It integrates with the "thread views" system to update the people that have seen the thread.

Disadvantages:

Well.. with mine even if you browse the forum as "invisible" you would end up showing in the "who read" list.


Info for hackers:
You may modify, improve, upgrade, redistribute this hack, include it
in another hack or yours or translate it provided you do it free of
charge and you distribute it in www.vbulletin.org at least, there is no
need to pm me asking for permission
Some portions of the code are (c) Jelsoft Enterprises Ltd.

Show Your Support

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

Comments
  #12  
Old 02-07-2004, 05:26 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
The sorting feature doesn't seem to be working for me. I have me (Boofo) in the list, the next one strats with an M and the next one strats with an A. They are not going alphabetically.
The sort will only work in new threads or threads where the list needs to be updated, if the who viewed is already stored for a thread then it won't be sorted. Call it an insertion sort It only sorts when something is added.

I'll check for that username markup, shouldn't be that hard to modify, but keep in mind that a query is needed for that. It is not an update query so it shouldn't hurt a lot the performance but still for people that are trying to mantain queries to a minimum (like me) an extra query might not sound practical.
Reply With Quote
  #13  
Old 02-07-2004, 06:04 AM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is the first one. For people that already installed the hack and want to add how many users have seen the thread:

In the showthread.php file, this:
Code:
$+++++ad = @implode(", ",$+++++adarray);
Replace it with:
Code:
$+++++ad = @implode(", ",$+++++adarray);
$total+++++ad = @count($+++++adarray);
In the SHOWTHREAD template, this:
Code:
Users that have seen this thread:
Replace it with:
Code:
$total+++++ad users have seen this thread:
Guests are a little more difficult because it means storing ip addreses as well instead of userid's. I'l check if there is an easy way to do it.

Those +++ are the word w h o r e that even if its a substring it is still being censored (/me makes a note on not using variable names that might be censored).

TXT file updated
Reply With Quote
  #14  
Old 02-07-2004, 08:28 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way to run a query to sort the users who have already seen a thread so it can strat off alphabetically from now on?

Can you just use the code in vBulletin for who is browsing this thread now to get the html markup that it is using already?
Reply With Quote
  #15  
Old 02-07-2004, 09:18 AM
squawell's Avatar
squawell squawell is offline
 
Join Date: Oct 2001
Posts: 681
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i got this error when i run scheduled task in my admincp
Code:
Warning: asort() expects parameter 1 to be array, boolean given in C:\Apache Group\Apache2\htdocs\forum\includes\cron\threadviews.php on line 41
the line 41 is
Code:
asort($+++++adarray);
any idea?thankz

edit:delete the line 41 than it works
Reply With Quote
  #16  
Old 02-07-2004, 06:51 PM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by squawell
i got this error when i run scheduled task in my admincp
Code:
Warning: asort() expects parameter 1 to be array, boolean given in C:\Apache Group\Apache2\htdocs\forum\includes\cron\threadviews.php on line 41
the line 41 is
Code:
asort($+++++adarray);
any idea?thankz

edit:delete the line 41 than it works
Don't worry about it, it's a warning (it doesn't stop the code from executing), that's because some threads might not have any data to sort. If you really don't want to see the warning change it to this:

Code:
if (is_array($+++++adarray)) {
asort($+++++adarray);
}
Reply With Quote
  #17  
Old 02-07-2004, 07:40 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kentaurus
Here is the first one. For people that already installed the hack and want to add how many users have seen the thread:

In the showthread.php file, this:
Code:
$+++++ad = @implode(", ",$+++++adarray);
Replace it with:
Code:
$+++++ad = @implode(", ",$+++++adarray);
$total+++++ad = @count($+++++adarray);
In the SHOWTHREAD template, this:
Code:
Users that have seen this thread:
Replace it with:
Code:
$total+++++ad users have seen this thread:
Guests are a little more difficult because it means storing ip addreses as well instead of userid's. I'l check if there is an easy way to do it.

Those +++ are the word w h o r e that even if its a substring it is still being censored (/me makes a note on not using variable names that might be censored).

TXT file updated
On guests, maybe just do a guest count?
Reply With Quote
  #18  
Old 02-08-2004, 08:01 PM
Kentaurus's Avatar
Kentaurus Kentaurus is offline
 
Join Date: Dec 2001
Posts: 332
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is another update

As requested by Boofo, to make the users appear with the html markup as they appear in the online users and almost anywhere, at the cost of 1 query.

I'm now attaching a txt since I'm getting tired of that censor.....

For threads before I added the sorting piece, just create a new user and view the unsorted thread, it will be sorted.
Reply With Quote
  #19  
Old 02-08-2004, 08:08 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That's Boofo, not Boofoo.

And thank you, sir.
Reply With Quote
  #20  
Old 02-08-2004, 08:34 PM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That worked great! Thank you, again.

You forgot to add the space after the comma in this line. The names were all running together. But I fixed it on my site.

PHP Code:
 $+++++ad = @implode(",", $+++++adnames); 
Reply With Quote
  #21  
Old 02-09-2004, 12:57 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Now I'm getting nothing but DB errors with this. I emailed you about it.
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 01:14 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.09201 seconds
  • Memory Usage 2,321KB
  • 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
  • (13)bbcode_code
  • (1)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
  • (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