![]() |
[VB3 RC3] Who viewed this thread?
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. |
Looks good. I trust how you support your hacks much more than the other one. ;)
|
cool. :)
any way to limit the view only to admins? |
Great. Could it be that the add-on who downloaded this attachment would be combined with this?
|
Quote:
Quote:
Quote:
those '+' are a w h o r e a d, seems that the forum is censoring it. |
Quote:
|
An update for this hack:
With this modification the "who viewed" list will be ordered alfabetically, the original behaviour was to order the users as they saw the thread, but that's not very reliable. Apply this modification only if you would like to see the list ordered. search for this Code:
if ($threadidcache) Code:
if ($threadidcache) Code:
$+++++adarray[$bbuserinfo['userid']] = $bbuserinfo['username']; Code:
$+++++adarray[$bbuserinfo['userid']] = $bbuserinfo['username']; And... all the +++++ are the word: w h o r e the complete word is w h o r e a d being censored |
Thank you Kentaurus, very nice hack !
|
Hey, buddy, I have a request. Is there a way to have the names follow the color and intensity (html mark-up, I think it is called) like Admins and Supermods and users and such? It would make it easier to identify with a quick glance as the list grows. ;)
And maybe the total numbers of members and guests (if they are allowe to read the threads like mine are) who have read the thread so far? |
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. ;)
|
Quote:
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. |
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); Code:
$+++++ad = @implode(", ",$+++++adarray); Code:
Users that have seen this thread: Code:
$total+++++ad users have seen this thread: 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 |
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? ;) |
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 Code:
asort($+++++adarray); edit:delete the line 41 than it works:D |
Quote:
Code:
if (is_array($+++++adarray)) { |
Quote:
|
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. |
That's Boofo, not Boofoo. ;)
And thank you, sir. ;) |
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:
|
Now I'm getting nothing but DB errors with this. I emailed you about it.
|
Seems that there we some cases I didn't consider. I fixed it already and uploaded an updated txt. For the people that installed it please change:
(and there we go with this censor...) PHP Code:
PHP Code:
|
It still isn't sorting the names quite right. In that list of names I sent you in the email, the last name is still showing up out of order. Any way to fix that? ;)
|
Quote:
|
were you planning on releasing an htl compliant version again at some point?
(I was going to wait until then if so) |
Quote:
|
Quote:
|
Quote:
Code:
$+++++sult = $DB_site->query("SELECT user.* FROM ".TABLE_PREFIX."user AS user WHERE userid IN (".implode(",",$+++++adids).")"); Code:
$+++++sult = $DB_site->query("SELECT user.* FROM ".TABLE_PREFIX."user AS user WHERE userid IN (".implode(",",$+++++adids).") ORDER BY username"); whoviewed_colors.txt updated also |
You can hold off on the broom. That fixed it. ;)Thank you kindly, sir. ;)
|
Would be possible that the usersnames had a link to their profile?
|
Yes, would it be possible to have the names linked to their profile? That would be excellent. ;)
|
tahnks Kentaurus
can we use it to Specified forums . |
I checked the code and I had some likes of ************* without any // in front of them. I got rid of those and there isn't an error, but I don't see any names of who has viewed the thread either.
**Sorry didn't realize it was at the top of the screen. I was looking for it at the bottom. |
Good work as always, Kentaurus!
Smooth install and does exactly as described. :) |
Useful!
/me Clicks Install |
Is this working in 3.0.1? No error messages but the list isn't showing up in my thread view pages.
edit: changed "$bbuserinfo[usergroupid]==6" to "is_member_of($bbuserinfo, 6)" and voila! It worked. |
Quote:
same thing as me. i even changed the template as stated above and it still doesn't work for me. and i did it for only admins.... |
k, it's workin for me now. guess it takes time to load up when the members actually go to those posts AFTER the hack has been installed.....
|
Kentaurus compliments for your nice hack, I have a little question:
Is there the possibility to see the last date and time in which the user has read the post? (It's very important for me to know it) Tnx in advance :) Regards |
ok, it is working for me but i have a little problem... for some reason, it's not showing up on ALL threads.... it is showing on a majority of the threads though. any ideas?
|
How is that done, if I want to limit the view to thread-starters only? Any idea?
|
All times are GMT. The time now is 04:47 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|