vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Show Thread Enhancements - Who viewed this thread? (https://vborg.vbsupport.ru/showthread.php?t=61222)

VitroX 04-06-2004 12:36 PM

Quote:

Originally Posted by VitroX
This is a wonderfull hack, thanks for making.

I wonder if it is possible to show the members with color depending of the usergroup where they belongs, per example Admins in red, Mods in blue, etc.

Thanks again.

This feature is not possible?

Nj?rd Eriksson 04-06-2004 01:16 PM

Great hack, Gary. Thank you. :)

Gary King 04-06-2004 06:56 PM

Quote:

Originally Posted by pcalloway
My table heading is showing as blank rather then stating:

"Already viewed this thread:"

In the phrase manager I used "already_viewed_this_thread" as the Var name and "Already viewed this thread:" as the text. Did I goof something up?

Did you modify the showthread template?

pcalloway 04-10-2004 02:20 AM

Quote:

Originally Posted by Gary W
Did you modify the showthread template?

Yeah, right above $poll... sure did.

Gary King 04-10-2004 02:47 PM

Go to View Source and check to see if you can find:
Code:

collapseobj_forumhome_todayactiveusers
in it.

Ocean 04-15-2004 03:33 PM

Hi, Gary! Quick question...

For this hack, you say to put the code ABOVE this text:

Code:


// ********************************************************************************  *
//set thread last view

By doing this, we are inserting your PHP code at the end of the "Update Views Counter" Section. However, in vB 3.0.1 - this section is no longer in the same place.

In vB 3.0.1, directly above the "Set Thread Last View" section, is a comment listed: "END LINEAR / THREADED"


So, the question is:

Should we still be inserting the code above the "Set Thread Last View" section? Or should we be putting at the END of the "Update Views Counter" Section?
:)

Gary King 04-15-2004 09:51 PM

The lower the better, before the output of the postbit anyways.

So I say, put it lower if you can't put it exactly where it's supposed to be :)

Ocean 04-15-2004 10:16 PM

Quote:

Originally Posted by Gary W
The lower the better, before the output of the postbit anyways.

So I say, put it lower if you can't put it exactly where it's supposed to be :)

Aha! So, in other words - your original instructions stand.

Thanks, Gary. :)

knetgummi 04-19-2004 08:22 PM

thats a reaaly good one
thank u very much
greetz
knetgummi

JagFan 04-19-2004 09:05 PM

I installed! Works great...thanks!!

weaver 04-24-2004 10:27 PM

Quote:

2.) Is there the possibility to signal how many times a user has seen that threads?
I'm interested in this as well... or some way of telling when was the most recent time they viewed the thread.

welo 04-25-2004 12:54 AM

Installed. Nice little hack. Took me a minute to find the first <tbody> tag (at the end of the line), and I added

HTML Code:

<div style="float:left">Who viewed this thread:</div>
..right before

HTML Code:

<a style="float:$stylevar[right]" href="#top" etc>
...to clarify a bit. Might also be prudent in the SHOWTHREAD template to wrap the whole thing with a quick "if" statement to restrict viewing only to admins:

Code:

<if condition="in_array($bbuserinfo['usergroupid'], array(5, 6, 7))">
[SHOWTHREAD code goes here]
</if>

Thanks. This will come in handy.

Gary King 04-25-2004 12:57 AM

Well not everyone wants to only show this to staff :)

Also, you should use the following instead: <if condition="is_member_of($bbuserinfo, 5, 6, 7)">

welo 04-25-2004 01:08 AM

Got it. Any idea how to add how many guests have viewed the thread? That would be pretty cool too.

Ah, wait, that wouldn't work anyway. I suppose some math could be coded to subtract the number of names in the list from the number of thread views, but that would give a distorted measurement unless you install this hack on a fresh board. Was a passing thought.

Thanks again.

welo 04-25-2004 02:15 AM

Quote:

Originally Posted by Gary W
Also, you should use the following instead: <if condition="is_member_of($bbuserinfo, 5, 6, 7)">

Sorry man, this code doesn't work. I was able to see it but no other usergroup could (probably because the rest of my staff are all in specially created usergroups, an dnot in the default list). My code works.

Gary King 04-25-2004 01:36 PM

Well just replace the ID no. with yours.

welo 04-25-2004 03:24 PM

That's what I did. In our case I had to use ($bbuserinfo, 6, 9, 10, 11, 17). In this case the only default usergroup is 6 (me). I could see it but nobody else on staff could (I didn't know this until someone mentioned it, so I logged in as then and confirmed). Once I switched it back to my code they could all see it fine.

Gary King 04-25-2004 03:31 PM

Then probably has to be an array.

is_member_of($bbuserinfo, array(5, 6, 7)) just try that :) The reason you should use this code instead of yours, because it checks additional groups as well.

welo 04-25-2004 04:13 PM

Sorry man. Using that code I can't even see it. Am also unclear what you mean by "...because it checks additional groups..." Checking them for what? All other groups are excluded.

Gary King 04-25-2004 04:16 PM

Check the membergroupids, not just usergroupid

welo 04-25-2004 05:10 PM

I apologize once again, because I have no idea what you just said.

Gary King 04-25-2004 05:47 PM

the is_member_of function also checks the additional usergroups for users, not just their primary usergroup

welo 04-25-2004 06:19 PM

Ah, I see what you mean. Kinda makes it too bad it doesn't work, huh? ;)

Gary King 04-25-2004 06:30 PM

It should.

Gary King 04-25-2004 06:31 PM

Check the function declaration to see that you are using it properly.

welo 04-25-2004 07:01 PM

Ok, look - I've tried applying what you gave me exactly as you stated and it doesn't work. This is especially frustrating when I started out this whole thing by posting code that does work. Since it's clear you're feeding me suggestions you aren't bothering to test, I say we stop this conversation now. Give me something that you know works or quit wasting my time by increasing your post count with useless one-sentence replies.

I hate to sound harsh or frustrated, but damn. I'm only trying to help make your hack better. Peace, out.

Intex 05-22-2004 07:44 AM

Nice Hack Gary W. /me clicks install.

DCX 05-28-2004 04:37 AM

gettin this error when i try to view a thread.....

Database error in vBulletin 3.0.1:

Invalid SQL: SELECT whoviewed FROM thread WHERE threadid = 6505
mysql error: Unknown column 'whoviewed' in 'field list'

mysql error number: 1054

Date: Friday 28th of May 2004 05:35:42 AM
Script: xxx
Referer: xxx
Username: xxx
IP Address: xxx

mtha 05-28-2004 08:02 AM

PHP Code:

if (!$userinfo['invisible'] OR $showinvisible

    if (!empty(
$currentthread['whoviewed'])) 
    { 
        if (!
in_array($bbuserinfo['userid'], $vieweduserids)) 
        { 
            
$DB_site->query("UPDATE ".TABLE_PREFIX."thread SET whoviewed = CONCAT(whoviewed, \" \", \"" .$bbuserinfo['userid'] . "\") WHERE threadid = $threadid"); 
        } 
    } 
    else 
    { 
        
$DB_site->query("UPDATE ".TABLE_PREFIX."thread SET whoviewed = \"" $bbuserinfo['userid'] . "\" WHERE threadid = $threadid"); 
    } 




It seems like this code will record "guest id = 0" too.
Should it check if $bbuserinfo['userid'] exist?

Nj?rd Eriksson 05-29-2004 05:32 PM

Quote:

Originally Posted by Ocean
Great! I'll give it a shot tomorrow and see how it goes.


Incidentally, I only plan on certain users being able to access this feature - so I wouldn't think it would be that great a strain on the Server, for me at least.

What would I need to change, if I wanted Invisible Users handled the same way it is on the Forum Home? (i.e. Only shown to those with access to see Invisible Users, suffixed with the "*" character, etc...)

:)

Gary,

What would I have to change if I would like that members with a certain user ID or members of a certain usergroup are NOT displayed on the "Who viewed this thread?" list, even if they have viewed a certain thread?

I don't want myself listed for others.

weaver 05-29-2004 05:54 PM

Quote:

Originally Posted by snobbymom
I'm interested in this as well... or some way of telling when was the most recent time they viewed the thread.

I'm still interested in this if anyone has figured out how to do it. I'd like to be able to pinpoint if a member has read a post after additional information was posted for them. Right now I can only determine if they read the post at all. Thanks. :)

Ocean 06-02-2004 01:53 PM

I have a really great idea for a way to improve this hack.


The basis is this - it's nice to be able to see who has viewed a particular Thread. But once that Thread gets going - it becomes next to useless if you need to ask "Okay, who has viewed this Thread since Post #13 was made?"


I would recommend, for Admins only, that the functionality be added so that they can see who last viewed a given thread since a particular date and time.


This can be done in a number of ways with varying levels of functionality:




Method 1


Underneath the current "Already viewed this thread" section, a second section would be added - "Viewed this Thread since..."

This section will be updated just like the first one. However, this section will have a Reset button. When an Admin clicks on the Reset button - it clears all users from that section. The section will list the new Date/Timestamp - and will start collecting User View information from that point on.

So that it will now show, for example, "Users who have viewed this Thread since 6/2/2004 10:31pm:"

Effectively, it works like your car's Trip Odometer.


This method would (I think) only require an additional field in the database for a second set of User View data. It would get updated just like the first one - it's just that there is a Reset button in each ShowThread page that allows Admins to clear this second set of data and set a new Date/Timestamp to be shown.

I would think that this first method should be very easy to implement. But Gary would have to chime in here to confirm. :)



Method 2


Add the ability for this hack to store Date/Timestamps for each user who views any given thread. It only needs to store the Last Viewed date/time.

Then, add a second section (similar to example 1) - however, this one has an Input Box that allows you to type a date (and possibly a time) in. Then, you can refresh the page and that second section will show all users who have Viewed that Thread since the date/time you entered.


As a secondary benefit/implementation - since under this method, the date/time of Last Viewed will be stored for each user, it should be easy to make it so that by hovering your mouse over a username in the first section (the "Already viewed this thread" section), you can get a tooltip with the date and time that that user last viewed this thread.


The advantage of this method over Method #1, is that you can check for Last Viewed data retroactively.

The disadvantage, of course, is the complication of implementing this. And perhaps, a performance concern.




So, what do you guys think? Would this be useful to you? :)


Gary, do you like this idea? Is either Method practically doable?

Intex 06-02-2004 01:57 PM

I'd personnally find that very useful. I have a thread where I update the progress of certains items on the website. At the moment I have to delete the thread and re-create it, if I want to see who's viewed it again, since I last made any updates.

Option 1 is probably more work than option 2. The timestamp from my perspective would be the one to go for. It would be great if someone could implement this change.

Ocean 06-02-2004 02:26 PM

Quote:

Originally Posted by Intex
I'd personnally find that very useful. I have a thread where I update the progress of certains items on the website. At the moment I have to delete the thread and re-create it, if I want to see who's viewed it again, since I last made any updates.

Option 1 is probably more work than option 2. The timestamp from my perspective would be the one to go for. It would be great if someone could implement this change.

The original version of this hack only adds one Field ("whoviewed") to the "threads" table. It stores a list of UserIDs, and that's it.

Method 1 would only add another Field (i.e. "whoviewedsince" ), which would be handled in exactly the same manner.


If we go with Method 2, some way needs to be found to efficiently store a date/timestamp with each UserID for each thread. To my mind, that makes Method 2 more complicated to implement - although I agree that it would be the more useful option. :)

FWF 07-01-2004 06:08 AM

this should be updated for 3.0.1

FWF 07-05-2004 03:06 AM

no update i take it ?

Rocol 07-06-2004 05:27 PM

Will this hack be udated to work on vB3.0.3 please ... thanks in advance guys, keep up the excellent work ;)

Ocean 07-06-2004 07:21 PM

Quote:

Originally Posted by rocol

Will this hack be udated to work on vB3.0.3 please ... thanks in advance guys, keep up the excellent work ;)

I have this working on a 3.0.3 installation. Is there a reason why you think that it needs to be updated for 3.0.3?

mtha 07-06-2004 08:36 PM

Quote:

Originally Posted by Ocean
I have this working on a 3.0.3 installation. Is there a reason why you think that it needs to be updated for 3.0.3?

:) because the hack said to work with version 3.0.0, and some people dont want to give it a shoot in other versions.

update would be adding a line, saying it works with ... some versions :D

Rocol 07-07-2004 07:24 AM

@ Ocean .. thanks for the reply, after reading that it worked for you, I checked again .. it was my bad application of the hack .. when copying I had missed off the last } .. all working fine now .. thanks ;)


All times are GMT. The time now is 05:53 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.01399 seconds
  • Memory Usage 1,840KB
  • 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
  • (3)bbcode_code_printable
  • (2)bbcode_html_printable
  • (1)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)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