vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   [VB3 RC3] Who viewed this thread? (https://vborg.vbsupport.ru/showthread.php?t=61225)

Kentaurus 05-16-2004 08:32 AM

Quote:

Originally Posted by tccra
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.

Please remember there is a setting in the ACP in the "Server Settings and Optimization" that reads "Update Thread Views Immediately", by default that is set to "no" and the thread views are updated only in an hourly basis, that would mean that also the whoviewed would be updated in an hourly basis :)

Quote:

Originally Posted by carter876
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)

This can be done but it is a little server intensive... if I find a way of doing it without taking a lot of resources I'll add it.

Quote:

Originally Posted by DCX
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?

If a thread hasn't been seen by anyone then it doesn't appear. Of course, at least you have seen the thread, right. Then just wait an hour for it to be updated, or in the ACP change the setting for thread views to be updated immediately.

Quote:

Originally Posted by Grendel
How is that done, if I want to limit the view to thread-starters only? Any idea?

In the hack, instead of

<if condition="$+++++ad">

use

<if condition="$+++++ad and $threadinfo[postuserid]==$bbuserinfo[userid]">

Kentaurus 05-16-2004 09:17 AM

You can now find in the first post a second version of this hack, the who viewed thread (with time) will show the last date a user viewed the thread, and also that version adds a link to the memberinfo.

If you were using the first version and you want the new features please uninstall the last version, you will need the following queries (please keep in mind you will loose the "who viewed" list for your threads):

ALTER TABLE thread DROP w h o r e a d;
ALTER TABLE threadviews DROP w h o r e a d i d;
ALTER TABLE threadviews DROP w h o r e a d n a m e;

Undo the file changes of the first version and install the second version of the hack.

If you are installing this version for the first time you should go straight for the most recent version. (who viewed thread with time)

Boofo 05-16-2004 04:35 PM

How would I go about making it so when you mouseover the name it shows the date and time instead of having it behind the name? If you get enough people viewing the thread, this list would get very long with the date and time behind each name. ;)

Kentaurus 05-17-2004 04:18 AM

Quote:

Originally Posted by Boofo
How would I go about making it so when you mouseover the name it shows the date and time instead of having it behind the name? If you get enough people viewing the thread, this list would get very long with the date and time behind each name. ;)

It should be a template.. but right now it is hard-coded. In the hack:

Quote:

$+++++ad .= "<a href=\"member.php?u=$whodata[userid]\">".fetch_musername($whodata)."</a> (".vbdate($vboptions['dateformat'], $+++++adarray[$whodata['userid']], true, true, false)." ".vbdate($vboptions['timeformat'], $+++++adarray[$whodata['userid']], true, true, false)."), ";
change it to:

Quote:

$+++++ad .= "<a href=\"member.php?u=$whodata[userid]\" title=\"(".vbdate($vboptions['dateformat'], $+++++adarray[$whodata['userid']], true, true, false)." ".vbdate($vboptions['timeformat'], $+++++adarray[$whodata['userid']], true, true, false).")\">".fetch_musername($whodata)."</a> , ";

Boofo 05-17-2004 06:55 AM

Thank you, sir. ;)

Grendel 05-17-2004 01:04 PM

Thank you for your answer, Kentaurus.

Carter876 05-17-2004 07:09 PM

Wow really a good hack and a fantastic support :D
I have installed it and I wait the version that show the last time by the mousover the name ;)

Install for me

Carter876 05-29-2004 09:52 AM

Ehm I have another question :rolleyes: , the hack signals me the time of the server that is different from mine (I have + 3 hours from the time of the server), Is there the possibility to modify the code of the hack to add for example + 10800 seconds?

Tnx in advance

Regards :)

Carter876 05-30-2004 06:49 AM

Ok i Have modified the code, and now it works but I hope that someone tell me if this change is good or if I have compromised something in VB funtionality :rolleyes:


Before
Code:

// update views counter
if ($vboptions['threadviewslive'])
{
        if ($bbuserinfo['userid'])
        {
                $+++++adarray[$bbuserinfo['userid']] = time() ;
                $add+++++ad = ",+++++ad='".addslashes(serialize($+++++adarray))."'";               
        }

After
Code:

// update views counter
if ($vboptions['threadviewslive'])
{
        if ($bbuserinfo['userid'])
        {
                $+++++adarray[$bbuserinfo['userid']] = time() + 10800;
                $add+++++ad = ",+++++ad='".addslashes(serialize($+++++adarray))."'";               
        }

As you can see I have added the numbero of seconds to fill the offset from server time and my time :)

Regards

weaver 05-31-2004 01:43 AM

Anyone know why (December 31st, 1969 07:00 PM) is showing up as the date/time I read the thread?

ETA: Okay now it has the proper date/time. Odd....

SaN-DeeP 06-11-2004 02:32 AM

Ok i have some serious issues, i wonder if someone else notice about this

My Server is located in US which mite have GMT - 8:00 timings
weras my forum timings and people are of india GMT + 5:30

Currently It is 9:02 AM here.
and i can see this thing when a user last viewed any particular thread
(Yesterday 07:15 PM)

Help me fix this please.

Thank You for nice hack.

Sandy...

Carter876 06-20-2004 08:08 AM

Is there news about this hack? :rolleyes:

Regards

Jadelit 07-29-2004 10:32 AM

bump

any help with the server and usertime would be grateful

SaN-DeeP 07-31-2004 02:25 AM

Quote:

This hack adds 0 new queries and tries to be "server friendly".
Installation file says this.

But i had 12 queries in my postbit and postbit_leagacy before installing it and now it is 13 :)

Though i find it to be server friendly.

snake-boy 08-08-2004 12:56 AM

Is this working in V3.0.3 (yet)?

I would VERY much like to install this but don't want to be wasting my time.

Anyone who's running this successfully with 3.0.3, please say 'aye' :) ?

-snake

wi11ie1950 10-23-2004 02:17 AM

aye :):)

wi11ie1950 10-23-2004 02:55 AM

The mouseover change doesnt work for me no matter how i do it i get:-

Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$'
in /home/wi11iec/public_html/forum/showthread.php on line 460

Do the $+++++ go in as well cause they are not in the text file ??

wi11ie1950 10-23-2004 02:56 AM

The mouseover change doesnt work for me no matter how i do it i get:-

Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$'
in /home/wi11iec/public_html/forum/showthread.php on line 460

Do the $+++++ go in as well cause they are not in the text file ??

wi11ie1950 10-23-2004 02:56 AM

The mouseover change doesnt work for me no matter how i do it i get:-

Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$'
in /home/wi11iec/public_html/forum/showthread.php on line 460

Do the $+++++ go in as well cause they are not in the text file ??

wi11ie1950 10-23-2004 02:56 AM

The mouseover change doesnt work for me no matter how i do it i get:-

Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$'
in /home/wi11iec/public_html/forum/showthread.php on line 460

Do the $+++++ go in as well cause they are not in the text file ??

trackpads 10-23-2004 10:32 PM

This is a great hack but would be alot better if you could have the information on a separate page. For example, I have a thread that was 100,000 views and honestly have that on the bottom of every page would make it look horrible. but I would like it on other pages for sure so have a link (option per usergroup) would be perfect.

Thanks again,

-Jason

wi11ie1950 10-27-2004 08:36 AM

Quote:

Originally Posted by wi11ie1950
The mouseover change doesnt work for me no matter how i do it i get:-

Parse error: parse error, unexpected T_INC, expecting T_VARIABLE or '$'
in /home/wi11iec/public_html/forum/showthread.php on line 460

Do the $+++++ go in as well cause they are not in the text file ??

Ok i worked it out.. I guess the +++++ is from VBs censor considering it spells out w h o r e

It all works great now under 3.0.3 :):)

SaN-DeeP 10-27-2004 10:10 AM

Quote:

Originally Posted by SaN-DeeP
Ok i have some serious issues, i wonder if someone else notice about this

My Server is located in US which mite have GMT - 8:00 timings
weras my forum timings and people are of india GMT + 5:30

Currently It is 9:02 AM here.
and i can see this thing when a user last viewed any particular thread
(Yesterday 07:15 PM)

Help me fix this please.

Thank You for nice hack.

Sandy...

any fix for this :) ?

thanks

wi11ie1950 10-30-2004 01:32 AM

Hi San from what i can see it doesnt use VB country and time settings so if you correct it for India then it will still be wrong for those outside india.
I used the hack to hide the date and time behind the name and show on mouseover :):)

sv1cec 11-18-2004 06:21 AM

Quote:

Originally Posted by wi11ie1950
Hi San from what i can see it doesnt use VB country and time settings so if you correct it for India then it will still be wrong for those outside india.
I used the hack to hide the date and time behind the name and show on mouseover :):)

I have the same problem with San, my server is located in USA, while all times are using Greece time. What puzzled me, was that the way the info is shown, using vbdate function, the time should have been correct.

So, I tried using this code:

PHP Code:

$nothing=vbdate($vboptions['dateformat'].' '.$vboptions['timeformat'], time()); 

and it produces the correct time for my country. However, when it is called from the hack (admitedly with a different syntax, I have no idea what these 'true', and 'false' parameters do) , in showthread, it shows the wrong time.

So, I did some experimentation, and here is what I came up with. If you change the vbdate arguments used in the showthread, a little, you can have it show the proper time.

Change this:

PHP Code:

(".vbdate($vboptions['dateformat'], $+++++adarray[$whodata['userid']], true, true, false) 

to this:

PHP Code:

(".vbdate($vboptions['dateformat'], $+++++adarray[$whodata['userid']], true, true, true) 

Or if you do not want to see "Today" or "Yesterday", but just a plain date and time, change the code to:

[php]
PHP Code:

(".vbdate($vboptions['dateformat'], $+++++adarray[$whodata['userid']]) 

Here is a description of the vbdate function. The code is located in includes/functions.php

PHP Code:

function vbdate($format$timestamp TIMENOW$doyestoday false$locale true$adjust true$gmdate false

Rgds
-----------
John

Morgalis 11-21-2004 09:05 AM

Hi there

I am installing this with your Mod Management tool, and I am running into a parse error.

vb 3.0.3

parse error - no details given - at the else in the last part of the paste

Quote:

else
{
// or doing it once an hour
$DB_site->shutdown_query("
INSERT INTO " . TABLE_PREFIX . "threadviews (threadid)
VALUES (" . intval($threadinfo['threadid']) . ')'
);
}
Any suggestions?

VitroX 01-12-2005 11:24 AM

thanks sv1cec for your fix ...

now, is there a way the user list can get sorted first those who has replied and then those who doesnt?, I'm after a way to detect those who dont reply to threads and are only lurking, this could be a way to detect them and that would be very usefull for me.

Lottis 01-17-2005 04:22 PM

Anyone like to help me take the time away?

VitroX 01-20-2005 01:00 PM

Quote:

Originally Posted by Lottis
Anyone like to help me take the time away?

yes, in modified showthread.php file for this hack, look for:
PHP Code:

if (!empty($+++++adarray))
{
        $+++++
adids array_keys($+++++adarray);
        $+++++
sult $DB_site->query("SELECT user.* FROM ".TABLE_PREFIX."user AS user WHERE userid IN (".implode(",",$+++++adids).") ORDER BY username");
        $+++++
ad "";
        while (
$whodata $DB_site->fetch_array($+++++sult))
        {
            $+++++
ad .= "<a href=\"member.php?u=$whodata[userid]\">".fetch_musername($whodata)."</a> (".vbdate($vboptions['dateformat'], $+++++adarray[$whodata['userid']], truetruefalse)." ".vbdate($vboptions['timeformat'], $+++++adarray[$whodata['userid']], truetruefalse)."), ";
        }
        if ($+++++
ad)
        {
            $+++++
ad substr($+++++ad0strlen($+++++ad)-2);
        }
        
$total+++++ad = @count($+++++adarray);


and replace it for:
PHP Code:

if (!empty($+++++adarray))
{
        $+++++
adids array_keys($+++++adarray);
        $+++++
sult $DB_site->query("SELECT user.* FROM ".TABLE_PREFIX."user AS user WHERE userid IN (".implode(",",$+++++adids).") ORDER BY username");
        $+++++
ad "";
        while (
$whodata $DB_site->fetch_array($+++++sult))
        {
            $+++++
ad .= "<a href=\"member.php?u=$whodata[userid]\">".fetch_musername($whodata)."</a>, ";
        }
        if ($+++++
ad)
        {
            $+++++
ad substr($+++++ad0strlen($+++++ad)-2);
        }
        
$total+++++ad = @count($+++++adarray);


that should remove the date time info.

James Collins 01-27-2005 12:20 AM

Quote:

Originally Posted by snake-boy
Is this working in V3.0.3 (yet)?

I would VERY much like to install this but don't want to be wasting my time.

Anyone who's running this successfully with 3.0.3, please say 'aye' :) ?

-snake

aye :)

in 3.05 as well (with patch)

tractor-beam 02-01-2005 09:52 PM

Right now I have installed this modification with the code that lets only the Administrator view the new stats. However, I've created a Managers Usergroup (ID=9) that I'd also like to have them see the stats. How would I modify this statement:

Code:

$poll

<if condition="$+++++ad and $bbuserinfo[usergroupid]==6">
<table cellpadding="10" cellspacing="0" border="1" width="100%">
<tr valign="top">
<td class="alt1">$total+++++ad users have seen this thread: $+++++ad</td></tr></table><br/>
</if>

Would it be something like:

Code:


<if condition="$+++++ad and ($bbuserinfo[usergroupid]==6 or $bbuserinfo[usergroupid==9]">

Thanks!

- Gerry

Pinkie 02-06-2005 07:38 PM

Thanx
Will try it if it also works for me :)

Spinball 08-03-2005 05:12 PM

This hack works nicely until you have threads with a couple of thousand member views and it gets really, really slow to view a thread.
Is there any way the viewers of a particular thread could optionally be opened in a new window by clicking a link at the top of SHOWTHREAD?

Mikecp421 10-15-2005 10:08 PM

nice, worked first time on VB 3.0.8

Mikecp421 10-16-2005 03:24 PM

hey can someone tell me what to add to this to allow supermods to also be able to view this? Thanks

Code:

<if condition="$+++++ad and $bbuserinfo[usergroupid]==6">
<table cellpadding="10" cellspacing="0" border="1" width="100%">
<tr valign="top">
<td class="alt1">Users that have seen this thread: <b>$+++++ad</b></td></tr></table><br/>
</if>


Dreiko 12-04-2005 06:36 PM

Will this hack be upgraded to 3.5? :)

Z@N@ 12-17-2005 07:36 AM

Yes or for 3.5.2?

Please.

Z@N@ 12-17-2005 07:49 AM

EDIT: Found it, right here -

https://vborg.vbsupport.ru/showthrea...ght=downloaded

Mikecp421 01-27-2006 06:32 PM

nice good looking man!

Dj-BuZ 02-10-2006 07:11 PM

Can someone help me i did every thing ask but i dont see it...i have 3.0.12


All times are GMT. The time now is 04:21 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.01363 seconds
  • Memory Usage 1,865KB
  • 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
  • (5)bbcode_code_printable
  • (7)bbcode_php_printable
  • (14)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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