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)
-   -   Who Viewed This Thread - Enhanced Version (https://vborg.vbsupport.ru/showthread.php?t=68876)

H2k 02-11-2005 12:00 PM

Quote:

Originally Posted by rh2004
Hi, I did it this is my showthread.php file...


Code:

$whoviewed_group_approved = true;
       
        }
        else
        {
       
                $whoviewed_group_approved = false;
       
        }
       
       
        if ( ($whoviewed_group_approved == true) OR ($whoviewed_security_option == 1) OR ($whoviewed_security_option == 3))
       
        {
               
               
                $show_whoviewed = true;
               
               
               
                // End Section - Security - Evaluate if user has permission to view "Who Viewed" information, and which sections they have permissions to access
               
               
               
                // Section - Get list of users who has viewed this thread - First Counter
               
               
                if (empty($currentthread['whoviewed']))
                {
                    $thread['viewers'] = '('.strtolower($vbphrase['none']).')';
                }
                else
                {
                    $result = $DB_site->query("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN ($currentthread[whoviewed])");
                    $viewers = array();
                    while ($user = $DB_site->fetch_array($result))
                    {
                            array_push($viewers, "<a href=\"member.php?".$session['sessionurl'] . "u=".$user['userid'] . "\">" . htmlspecialchars($user['username']) .    "</a>");
                    }
                    $thread['viewers'] = implode(", ", $viewers);
                }
               
       
                // End Section - Get list of users who has viewed this thread - First Counter
       
       
       
                // Section - Get list of users who has viewed this thread - Second Counter
       
               
                if (empty($currentthread2['whoviewedcounter']))
                {
                    $thread['viewerscounter'] = '('.strtolower($vbphrase['none']).')';
                }
                else
                {
                    $result2 = $DB_site->query("SELECT userid, username FROM " . TABLE_PREFIX . "user WHERE userid IN ($currentthread2[whoviewedcounter])");
                    $viewers2 = array();
                    while ($user = $DB_site->fetch_array($result2))
                    {
                            array_push($viewers2, "<a href=\"member.php?".$session['sessionurl'] . "u=".$user['userid'] . "\">" . htmlspecialchars($user['username']) .    "</a>");
                    }
                    $thread['viewerscounter'] = implode(", ", $viewers2);
                }
       
       
                // End Section - Get list of users who has viewed this thread - Second Counter
               
       
               
                // Section - Get the date/time of last reset
       
               
                if ($thread['whoviewedreset'] != '0')
                {
               
                //        $whoviewedreset = vbdate($vboptions[dateformat], '$thread[whoviewedreset]');
                        $whoviewedreset = vbdate("m/d/Y - h:i a", $thread[whoviewedreset]);
               
                }
               
                else
                {
               
                        $whoviewedreset = "Never";
               
                }
               
       
                // End Section - Get the date/time of last reset
               
               
       
        }
       
        else
        {
       
                $show_whoviewed = false;
       
        }
       
       
}


// End of Main "Who Viewed" Function





if ($whoviewed_display_option == 1)
{


        whoviewedfunction();


}




if ($_REQUEST['do'] == 'whoviewedpopup')
{
        // global.php handles $threadid..
        //$threadid = intval($threadid);

        $thread = verify_id('thread', $threadid, 1, 1);
        $forumperms = fetch_permissions($thread['forumid']);

        if (!($forumperms & CANVIEW))
        {
                print_no_permission();
        }
        if (!($forumperms & CANVIEWOTHERS) AND ($thread['postuserid'] != $bbuserinfo['userid'] OR !$bbuserinfo['userid']))
        {
                print_no_permission();
        }


        whoviewedfunction();


        unset($shutdownqueries['pmpopup']);
        eval('print_output("' . fetch_template('WhoViewedTemplate') . '");');



}



if ($_REQUEST['do'] == "resetwhoviewedcounter")
{
       
        if(!is_member_of($bbuserinfo, 6)) // only admins may reset counter (usergroup: 6)
        {
       
                print_no_permission();
       
        }
       
       
        $threadid = addslashes($_REQUEST['threadid']);
       
        //***insert mysql queries
        $DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET whoviewedcounter='' WHERE threadid=$threadid");
        $DB_site->query("UPDATE " . TABLE_PREFIX . "thread SET whoviewedreset = " . TIMENOW . " WHERE threadid = $threadid");
       
       
        if ($whoviewed_display_option == 1)
        {
       
                //redirect back to thread
                $url = "showthread.php?$session[sessionurl]t=$threadid";
                eval(print_standard_redirect('redirecting'));
       
        }
       
       
        if ($whoviewed_display_option == 1)
        {
       
                //redirect back to Pop Up Window
                $url = "showthread.php?$session[sessionurl]do=whoviewedpopup&amp;t=$threadid";
                eval(print_standard_redirect('redirecting'));
       
        }



}
//set thread last view
$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);
if ($thread['pollid'] AND $vboptions['updatelastpost'] AND ($displayed_dateline == $thread['lastpost'] OR $threadview == $thread['lastpost']) AND $pollinfo['lastvote'] > $thread['lastpost'])
{
        $displayed_dateline = $pollinfo['lastvote'];
}


There is no errors but I can't see it anywhere....

ohhhhhhhhhhhhhh know i understand i have to copy the whole code..

thankyou very much .. sorry becz my english is really bad so that is why i can't understand
:)

Ocean 02-11-2005 08:32 PM

Quote:

Originally Posted by Jadelit

Is there any way to add the usergroup colors to the list as well?


If it's not showing up as is, then I'll have to look into it. But I might not incorporate it until the next feature version.

Ocean 02-11-2005 08:32 PM

Quote:

Originally Posted by H2k

ohhhhhhhhhhhhhh know i understand i have to copy the whole code..

thankyou very much .. sorry becz my english is really bad so that is why i can't understand
:)


No problem. :)

H2k 02-12-2005 12:33 AM

Quote:

Originally Posted by Ocean
No problem. :)

ok there is something maybe u need to fix .. like in my board i always make my self invisble .. some time i dont like the member see me in the thread.. so

can u make that if the invisble user or who make him self invisble dont show .. only for admin like in who is online

it will show only for the admin
like this *Admin

also if u can make a the color for the name it will be nice to know becz i havemake my board full of color for each groups..

and mabye this is good suggest

like u add

Admin {5} Admin6 {6} AdminD {18} this will be great i have see the saem this mod over at phpBB and IPB

it show for each user how many time they view :) like Admin {80} this mean he view it 80 Time

there is a MOD in phpBB it show a full list

like who is online when u check u see all gust where member view topic etc..

the same in who view topic

it take them to anther page and it show how many time this user view this thread and many time he reply It is called Hoistry Topic or something like this .. it have alot of Extra ..

Thankyou :)

Ocean 02-16-2005 12:12 AM

Quote:

Originally Posted by H2k

ok there is something maybe u need to fix .. like in my board i always make my self invisble .. some time i dont like the member see me in the thread.. so

can u make that if the invisble user or who make him self invisble dont show .. only for admin like in who is online

it will show only for the admin
like this *Admin


It's been awhile since I looked at that particular function - but I believe that this hack respects the Invisibility flag, if I remember correctly...


Quote:

Originally Posted by H2k

also if u can make a the color for the name it will be nice to know becz i havemake my board full of color for each groups..


As I said earlier, if the colors don't translate now - I may add that in a future version. However, my initial priority would be to include date/time stamps. :)


Quote:

Originally Posted by H2k

and mabye this is good suggest

like u add

Admin {5} Admin6 {6} AdminD {18} this will be great i have see the saem this mod over at phpBB and IPB

it show for each user how many time they view :) like Admin {80} this mean he view it 80 Time

there is a MOD in phpBB it show a full list

like who is online when u check u see all gust where member view topic etc..

the same in who view topic

it take them to anther page and it show how many time this user view this thread and many time he reply It is called Hoistry Topic or something like this .. it have alot of Extra ..

Thankyou :)


Having a full history is definitely a lot more involved. I'm reluctant to add that in, simply due to the strain that would cause for the server. But I might add that in as an Admin-configurable option in a future version. :)

H2k 02-16-2005 12:51 AM

Hello

My brother use phpBB and he have over then 20000 Members with over then 250000 post etc..

and his board is fullymodded withphp mods.. and it's so fast here i giv eu some idea about View Hoistry for phpBB

In the forums play we have here.. Reply and view for each topic.. and for reply it will show who reply the user. but view it will not show here is for phpBB

https://vborg.vbsupport.ru/attachmen...id=23994&stc=1

for view it will show in pop up

after u enter the topic u wills ee one icons

https://vborg.vbsupport.ru/

after u check the icons it iwll take u to anther page and it willshow alll user who view and how many times and for the admin it will show for each user ips and also Anonymous it will show the how many tme they view and also the ips for the admins.

https://vborg.vbsupport.ru/

also there is options in the profiles for each user .. what topic they view in what forums and how many time they view it .. etc.. u can see the screen shot .

https://vborg.vbsupport.ru/

if u want to see this mods installing i will giv eu a link for phpbbfm and u can download it and see all options it have..

it dont slow the board or naything like what i said my brother use phpBB and he have over then 20000 user and every over then 500 user come at the same time and more.. and the board run fast :laugh:

Thankyou very much and i hope u really get tiime to thinka bout this and update your mods

YLP1 02-18-2005 05:20 PM

I am getting an error that says this when trying to do the queries:
An error occurred while attempting to execute your query. The following information was returned.
error number: 1146
error desc: Table 'ylpforums.thread' doesn't exist

How do I alter the queries to inlcude the name of my forums???

H2k 02-24-2005 11:54 AM

What error u got .. i think the same when i try at the first iu need to copy the whole code

thx :devious:

Vampyre 03-01-2005 10:47 AM

Works well.
Thanks for the nice work. ;)

shungo 03-10-2005 10:59 AM

i installed it. all works fine excepted when i reset counter... i see
Quote:

Already viewed this thread since: m/d/Y - h:i a
instead of real date/time.

Help pls :)

regards and congrats for this useful hack !


All times are GMT. The time now is 10:51 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
  • Page Generation 0.01189 seconds
  • Memory Usage 1,798KB
  • 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
  • (1)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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