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)

andrew67 12-07-2004 09:16 AM

going to go install.. it sounds good :) Appreciated.

Ocean 12-15-2004 01:14 PM

Quote:

Originally Posted by mtha

When you have $whoviewed_display_option = 2;
Those who are not allowed to view "who viewed list" should NOT see the link "List users who viewed this thread" either

Thank you for pointing this out. This problem has been fixed in v1.3.2, which I have just released.

Anyone wishing to upgrade from v1.3.1 to v1.3.2 just needs to re-do steps 6 and 9 (replacing the sections in ShowThread.php, and the SHOWTHREAD template).

:)

Ocean 12-15-2004 01:14 PM

Quote:

Originally Posted by andrew67

going to go install.. it sounds good :) Appreciated.

I'm glad you like it! :)

IC-Games 12-19-2004 01:48 AM

getting a currupt download here, some charectors are out of whack for me

Ocean 12-19-2004 08:20 AM

Quote:

Originally Posted by IC-Games

getting a currupt download here, some charectors are out of whack for me

Which file is giving you problems? Is it the main 1.3.2 Instructions file? If so, I tried downloading it from here and at an initial glance - it seems fine. Perhaps the problem was with your download - and you might want to try it again. :)

H2k 02-09-2005 06:53 AM

I was searching for this mod about week and just know find it

it is the hard mod i ever see .. to install it conf me i dont no what line i should edit or add ..

could u please add for me this mod


PHP Code:

// pre-cache templates used by specific actions
$actiontemplates = array();

// ####################### PRE-BACK-END ACTIONS ##########################
function exec_postvar_call_back()
{
    global 
$_REQUEST;
    if (
$_REQUEST['goto'] == 'lastpost' OR $_REQUEST['goto'] == 'newpost' OR $_REQUEST['goto'] == 'postid')
    {
        global 
$noheader;
        
$noheader 1;
    }
}

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
require_once(
'./includes/functions_bigthree.php');
require_once(
'./includes/functions_showthread.php');
require_once(
'./includes/functions_warning.php');

// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

globalize($_REQUEST, array(
    
'perpage' => INT,
    
'pagenumber' => INT,
    
'highlight' => STR,
    
'posted'    => INT,
    
'goto'
));
$hierarchical=$warn_opts['hierarchical'];
$viewoption=$warn_opts['viewoption'];
$buttons=$warn_opts['textbutoption'];
// *********************************************************************************
// set $threadedmode (continued from sessions.php)
if ($vboptions['allowthreadedmode'])
{
    if (!isset(
$threadedmode))
    {
        
DEVDEBUG('$threadedmode is empty');
        if (
$bbuserinfo['threadedmode'] == 3)
        {
            
$threadedmode 0;
        }
        else
        {
            
$threadedmode $bbuserinfo['threadedmode'];
        }
    }

    switch (
$threadedmode)
    {
        case 
1:
            
$show['threadedmode'] = true;
            
$show['hybridmode'] = false;
            
$show['linearmode'] = false;
            break;
        case 
2:
            
$show['threadedmode'] = false;
            
$show['hybridmode'] = true;
            
$show['linearmode'] = false;
            break;
        default:
            
$show['threadedmode'] = false;
            
$show['hybridmode'] = false;
            
$show['linearmode'] = true;
        break;
    }
}
else
{
    
DEVDEBUG('Threadedmode disabled by admin');
    
$threadedmode 0;
    
$show['threadedmode'] = false;
    
$show['linearmode'] = true;
    
$show['hybridmode'] = false;
}

// make an alternate class for the selected threadedmode
$modeclass = array();
for (
$i 0$i 3$i++)
{
    
$modeclass["$i"] = iif($i == $threadedmode'alt2''alt1');
}

// prepare highlight words
if (!empty($_GET['highlight']))
{
    
$highlightwords iif($goto'&''&') . 'highlight=' urlencode($_GET['highlight']);
}
else
{
    
$highlightwords '';
}

// ##############################################################################
// ####################### HANDLE HEADER() CALLS ################################
// ##############################################################################
switch($goto)
{
    
// *********************************************************************************
    // go to next newest
    
case 'nextnewest':
        
$thread verify_id('thread'$threadid11);
        if (
$getnextnewest $DB_site->query_first("
            SELECT threadid
            FROM " 
TABLE_PREFIX "thread AS thread
            LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
            WHERE forumid = 
$thread[forumid] AND lastpost > $thread[lastpost] AND visible = 1 AND open <> 10
            AND deletionlog.primaryid IS NULL
            ORDER BY lastpost
            LIMIT 1
        "
))
        {
            
$threadid $getnextnewest['threadid'];
            unset (
$thread);
        }
        else
        {
            eval(
print_standard_error('error_nonextnewest'));
        }
        break;
    
// *********************************************************************************
    // go to next oldest
    
case 'nextoldest':
        
$thread verify_id('thread'$threadid11);
        if (
$getnextoldest $DB_site->query_first("
            SELECT threadid
            FROM " 
TABLE_PREFIX "thread AS thread
            LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
            WHERE forumid = 
$thread[forumid] AND lastpost < $thread[lastpost] AND visible = 1 AND open <> 10
            AND deletionlog.primaryid IS NULL
            ORDER BY lastpost DESC
            LIMIT 1
        "
))
        {
            
$threadid $getnextoldest['threadid'];
            unset(
$thread);
        }
        else
        {
            eval(
print_standard_error('error_nonextoldest'));
        }
        break;
    
// *********************************************************************************
    // goto last post
    
case 'lastpost':
        
$threadid intval($_REQUEST['threadid']);
        if (!empty(
$_REQUEST['forumid']))
        { 
// this one needs to stay AS $_REQUEST!
            
$forumid verify_id('forum'$forumid10);

            
$thread $DB_site->query_first("
                SELECT threadid
                FROM " 
TABLE_PREFIX "thread AS thread
                LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = thread.threadid AND type = 'thread')
                WHERE forumid IN (
$foruminfo[childlist]) AND visible = 1 AND (sticky = 1 OR sticky = 0)
                AND lastpost >= " 
. ($foruminfo['lastpost'] - 30) . " AND open <> 10 AND deletionlog.primaryid IS NULL
                ORDER BY lastpost DESC
                LIMIT 1
            "
);
            
$threadid $thread['threadid'];
        }

        if (!empty(
$threadid))
        {
            if (
$getlastpost $DB_site->query_first("
                SELECT MAX(postid) AS postid
                FROM " 
TABLE_PREFIX "post AS post
                LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
                WHERE threadid = " 
intval($threadid) . " AND visible = 1 AND deletionlog.primaryid IS NULL
                LIMIT 1
            "
))
            {
                if (
$threadedmode != 1// if linear or hybrid
                
{
                    
exec_header_redirect("showthread.php?$session[sessionurl_js]p=$getlastpost[postid]$highlightwords#post$getlastpost[postid]");
                }
                else 
// if threaded
                
{
                    
$postid $getlastpost['postid'];
                }
            }
        }
        break;
    
// *********************************************************************************
    // goto newest unread post
    
case 'newpost':
        
$threadinfo verify_id('thread'$threadid11);

        if ((
$tview fetch_bbarray_cookie('thread_lastview'$threadid)) > $bbuserinfo['lastvisit'])
        {
            
$bbuserinfo['lastvisit'] = $tview;
        }

        
$posts $DB_site->query_first("
            SELECT MIN(postid) AS postid
            FROM " 
TABLE_PREFIX "post
            WHERE threadid = 
$threadinfo[threadid] AND visible = 1 AND dateline > $bbuserinfo[lastvisit]
            LIMIT 1
        "
);
        if (
$posts['postid'])
        {
            
exec_header_redirect("showthread.php?$session[sessionurl_js]p=$posts[postid]$highlightwords#post$posts[postid]");
        }
        else
        {
            
exec_header_redirect("showthread.php?$session[sessionurl_js]t=$threadinfo[threadid]&goto=lastpost$highlightwords");
        }
        break;
    
// *********************************************************************************
}
// end switch($goto)

// *********************************************************************************
// workaround for header redirect issue from forms with enctype in IE
// (use a scrollIntoView javascript call in the <body> onload event)
$onload '';

// *********************************************************************************
// set $perpage

if (!$perpage)
{
    
$perpage $bbuserinfo['maxposts'];
}

$checkmax explode(','$vboptions['usermaxposts'] . ',' $vboptions['maxposts']);
if (
$perpage OR $perpage max($checkmax))
{
    
$perpage $vboptions['maxposts'];
}

// *********************************************************************************
// set post order
if ($bbuserinfo['postorder'] == 0)
{
    
$postorder '';
}
else
{
    
$postorder 'DESC';
}

// *********************************************************************************
// get thread info
$thread verify_id('thread'$threadid11);
$threadinfo = &$thread;

// *********************************************************************************
// check for visible / deleted thread
if ((!$thread['visible'] OR $thread['isdeleted']) AND !can_moderate($thread['forumid']))
{
    
$idname $vbphrase['thread'];
    eval(
print_standard_error('error_invalidid'));
}

// *********************************************************************************
// jump page if thread is actually a redirect
if ($thread['open'] == 10)
{
    
exec_header_redirect("showthread.php?$session[sessionurl_js]t=$thread[pollid]");
}

// *********************************************************************************
// Tachy goes to coventry
if (in_coventry($thread['postuserid']) AND !can_moderate($thread['forumid']))
{
    
$idname $vbphrase['thread'];
    eval(
print_standard_error('error_invalidid'));
}

// *********************************************************************************
// do word wrapping for the thread title
if ($vboptions['wordwrap'] != 0)
{
    
$thread['title'] = fetch_word_wrapped_string($thread['title']);
}

// *********************************************************************************
// words to highlight from the search engine
if (!empty($highlight))
{

    
$highlight preg_replace('#\*+#s''*'$highlight);
    if (
$highlight != '*')
    {
        
$regexfind = array('\*''\<''\>');
        
$regexreplace = array('[\w.:@*/?=]*?''<''>');
        
$highlight preg_quote(strtolower($highlight), '#');
        
$highlight explode(' '$highlight);
        
$highlight str_replace($regexfind$regexreplace$highlight);
        foreach (
$highlight AS $val)
        {
            if (
$val trim($val))
            {
                
$replacewords[] = htmlspecialchars_uni($val);
            }
        }
    }
}

// *********************************************************************************
// make the forum jump in order to fill the forum caches
$curforumid $thread['forumid'];
construct_forum_jump();

// *********************************************************************************
// get forum info
$forum fetch_foruminfo($thread['forumid']);
$foruminfo = &$forum;

// *********************************************************************************
// check forum permissions
$forumperms fetch_permissions($thread['forumid']);
if (!(
$forumperms CANVIEW))
{
    
print_no_permission();
}
if (!(
$forumperms CANVIEWOTHERS) AND ($thread['postuserid'] != $bbuserinfo['userid'] OR $bbuserinfo['userid'] == 0))
{
    
print_no_permission();
}

// *********************************************************************************
// check if there is a forum password and if so, ensure the user has it set
verify_forum_password($foruminfo['forumid'], $foruminfo['password']);

// *********************************************************************************
// get ignored users
$ignore = array();
if (
trim($bbuserinfo['ignorelist']))
{
    
$ignorelist preg_split('/( )+/'trim($bbuserinfo['ignorelist']), -1PREG_SPLIT_NO_EMPTY);
    foreach (
$ignorelist AS $ignoreuserid)
    {
        
$ignore["$ignoreuserid"] = 1;
    }
}
DEVDEBUG('ignored users: ' implode(', 'array_keys($ignore)));

// *********************************************************************************
// filter out deletion notices if can't be seen
if (!($forumperms CANSEEDELNOTICE) AND !can_moderate($threadinfo['forumid']))
{
    
$delthreadlimit "AND deletionlog.primaryid IS NULL";
    
$deljoin "LEFT JOIN " TABLE_PREFIX "deletionlog AS deletionlog ON(post.postid = deletionlog.primaryid AND type = 'post')";
    
$linkdeleted false;
}
else
{
    
$delthreadlimit '';
    
$deljoin '';
    
$linkdeleted true;
}

$show['viewpost'] = iif(can_moderate($thread['forumid']), truefalse);
$show['managepost'] = iif(can_moderate($thread['forumid'], 'candeleteposts') OR can_moderate($thread['forumid'], 'canremoveposts'), truefalse);

// *********************************************************************************
// find the page that we should be on to display this post
if (!empty($postid) AND $threadedmode == 0)
{
    
$postinfo verify_id('post'$postid11);
    
$threadid $postinfo['threadid'];

    
$getpagenum $DB_site->query_first("
        SELECT COUNT(*) AS posts
        FROM " 
TABLE_PREFIX "post AS post
        LEFT JOIN " 
TABLE_PREFIX "deletionlog AS deletionlog ON(deletionlog.primaryid = post.postid AND type = 'post')
        WHERE threadid = 
$threadid AND visible = 1 AND deletionlog.primaryid IS NULL
        AND dateline " 
iif(!$postorder'<=''>=') . $postinfo[dateline]
    "
);
    
$pagenumber ceil($getpagenum['posts'] / $perpage);
}

// *********************************************************************************
// update views counter
if ($vboptions['threadviewslive'])
{
    
// doing it as they happen
    
$DB_site->shutdown_query("
        UPDATE " 
TABLE_PREFIX "thread
        SET views = views + 1
        WHERE threadid = " 
intval($threadinfo['threadid'])
    );
}
else
{
    
// or doing it once an hour
    
$DB_site->shutdown_query("
        INSERT INTO " 
TABLE_PREFIX "threadviews (threadid)
        VALUES (" 
intval($threadinfo['threadid']) . ')'
    
);
}
// ## <ucs>
if ($vboptions['uttpoints_enablesystem'] == '1')
// It's enabled! Yay!
    
if ($thread['postuserid'] != $bbuserinfo['userid'])
    { 
// Don't give points if the user viewing the thread is the one who created it.
        
if ($vboptions['uttpoints_perview'] != '0' && $forum['uttpoints_perview'] != '0')
        { 
// Both needed values are not 0... good.
                
$givethempoints = ($vboptions['uttpoints_perview'] * $forum['uttpoints_perview']);
        }
    }
    if (isset(
$givethempoints))
    { 
// If they get money....
        // Send the query and we're done.
        
$DB_site->shutdown_query("UPDATE ".TABLE_PREFIX $vboptions[uttpoints_pointtable]." SET ".$vboptions[uttpoints_pointsfield]."=".$vboptions[uttpoints_pointsfield]."+".$givethempoints." WHERE userid='$thread[postuserid]'");
    }
}
// ## </ucs>
// *********************************************************************************
// display ratings if enabled
$show['rating'] = false;
if (
$forum['allowratings'] == 1)
{
    if (
$thread['votenum'] > 0)
    {
        
$thread['voteavg'] = vb_number_format($thread['votetotal'] / $thread['votenum'], 2);
        
$thread['rating'] = round($thread['votetotal'] / $thread['votenum']);
        if (
$thread['votenum'] >= $vboptions['showvotes'])
        {
            
$show['rating'] = true;
        }
    }

    
devdebug("threadinfo[vote] = $threadinfo[vote]");

    if (
$threadinfo['vote'])
    {
        
$voteselected["$threadinfo[vote]"] = HTML_SELECTED;
        
$votechecked["$threadinfo[vote]"] = HTML_CHECKED;
    }
    else
    {
        
$voteselected[0] = HTML_SELECTED;
        
$votechecked[0] = HTML_CHECKED;
    }
}

// *********************************************************************************
// get some vars from the referring page in order
// to put a nice back-to-forum link in the navbar
/*
unset($back);
if (strpos($_SERVER['HTTP_REFERER'], 'forumdisplay') !== false)
{
    if ($vars = strchr($_SERVER['HTTP_REFERER'], '&'))
    {
        $pairs = explode('&', $vars);
        foreach ($pairs AS $v)
        {
            $var = explode('=', $v);
            if ($var[1] != '' and $var[0] != 'forumid')
            {
                $back["$var[0]"] = $var[1];
            }
        }
    }
}
*/

// *********************************************************************************
// set page number
if ($pagenumber 1)
{
    
$pagenumber 1;
}
else if (
$pagenumber ceil(($thread['replycount'] + 1) / $perpage))
{
    
$pagenumber ceil(($thread['replycount'] + 1) / $perpage);
}
// *********************************************************************************
// initialise some stuff...
$limitlower = ($pagenumber 1) * $perpage;
$limitupper = ($pagenumber) * $perpage;
$counter 0;
$threadview fetch_bbarray_cookie('thread_lastview'$thread['threadid']);
$displayed_dateline 0

i really dont understand it .. and this mod is very importen .. i give u my showthread.php i have also modify it and i add a few mods so if u can help me to add it ..

thankyou :nervous:

Ocean 02-09-2005 10:52 AM

Quote:

Originally Posted by H2k

I was searching for this mod about week and just know find it

it is the hard mod i ever see .. to install it conf me i dont no what line i should edit or add ..

could u please add for me this mod

i really dont understand it .. and this mod is very importen .. i give u my showthread.php i have also modify it and i add a few mods so if u can help me to add it ..

thankyou :nervous:


H2k, I'm not going to do your work for you.

This is not a difficult hack to install. The instructions are clear - and most of it is a matter of finding a particular line of code and inserting additional code either above or below the section you were asked to find.

If you read the instructions carefully, you should not have a problem installing it.

H2k 02-09-2005 05:38 PM

Hello

let me tell u the truth i always dont like any one to make my job .. becz i like to learn .. but the truth from your mod .. is really hard.. i have add over then 30 mod in my board.. never is ee a hard mod .. like yours..

becz it is really conf.. as my english is bad..

like ud ont see

after this line add
b4 this line add.

i really can't understand the installing file u have.. it is conf .. really i read it over then 20 time .. i try to make evrything and still not work some time give me error some time .. the view thread dose not show .. and so on

ok i need a help from u to let me undersand this ..


Code:

// pre-cache templates used by specific actions
$actiontemplates = array();

I Replace it with

Code:

// pre-cache templates used by specific actions
$actiontemplates = array(

        'whoviewedpopup' => array(
                'WhoViewedTemplate'
        )

);


Fine

Code:

fetch_bbarray_cookie('thread_lastview', $thread['threadid']);
B4 ADD

Code:

// *********************************************************************************
// initialise some stuff...
$limitlower = ($pagenumber - 1) * $perpage;
$limitupper = ($pagenumber) * $perpage;
$counter = 0;
$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);
$displayed_dateline = 0;


Code:

################################################################################
########################## Who Viewed This Thread ##############################
##########################      CONFIGURATION    ##############################
################################################################################





Know after i add this the last one u tell should i add the code from

Code:

// Section - Check if user has already viewed thread, and add UserID if they have not
TO
Code:

                //redirect back to Pop Up Window
                $url = "showthread.php?$session[sessionurl]do=whoviewedpopup&amp;t=$threadid";
                eval(print_standard_redirect('redirecting'));
       
        }



}

this is i dont understand reasly what code i need to add in this part .. if u can tell me what code .. it will be easy my english is really bad.. and i hope that with your reply u can Tell me example after that put this code.. and iwill be done with this mod

Ocean 02-09-2005 06:40 PM

Quote:

Originally Posted by H2k

Hello

Fine

Code:

fetch_bbarray_cookie('thread_lastview', $thread['threadid']);
B4 ADD

Code:

// *********************************************************************************
// initialise some stuff...
$limitlower = ($pagenumber - 1) * $perpage;
$limitupper = ($pagenumber) * $perpage;
$counter = 0;
$threadview = fetch_bbarray_cookie('thread_lastview', $thread['threadid']);
$displayed_dateline = 0;



That's not the sole amount of code you're supposed to add at that point. You need to add everything BETWEEN



********************************
6. Above, Add:
**********


And this:


********************************

7. Optional Step: In the code you just added in the previous step, there is a Configuration Section. If you wish, you can modify this hack's behavior and permissions there. Instructions can be found within the Configuration Section.

********************************


Quote:

Originally Posted by H2k


Know after i add this the last one u tell should i add the code from

Code:

// Section - Check if user has already viewed thread, and add UserID if they have not
TO
Code:

                //redirect back to Pop Up Window
                $url = "showthread.php?$session[sessionurl]do=whoviewedpopup&amp;t=$threadid";
                eval(print_standard_redirect('redirecting'));
 
        }
 
 
 
}

this is i dont understand reasly what code i need to add in this part .. if u can tell me what code .. it will be easy my english is really bad.. and i hope that with your reply u can Tell me example after that put this code.. and iwill be done with this mod



No, you're not supposed to add anything. Those are not part of the instructions. That's part of the code you should have added in the previous step.

The instructions are all formatted in an identical manner - they are located between single lines of asterisks, and each instructional step is prefixed with that step's Number.

The problem is that you are not looking for where each instruction begins and ends - you are reading the middle of the code and assuming that it's part of the install instructions, which it is not.

There *is* a configuration section - but that is located within code that you are supposed to be adding. Step 7 indicates this, and tells you that you can optionally configure this hack's behavior by editing the Configuration Section - after it's been added in the appropriate place.

Jadelit 02-10-2005 04:42 AM

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

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 !

David_R 03-11-2005 10:57 AM

install file is confusing me.. i cannot understand properly what changes to be made to showthread.php file

Jenta 03-23-2005 06:31 PM

nice hack but extremely confusing instructions

i will sit here for an hour reading every single thing i can and try to make sense of it

i know i will eventually after very carefull reading but...

Imperial Fritz 03-27-2005 05:18 AM

Tested with 3.0.7?....

Cause in my showthread.php there's nothing like
PHP Code:

// *********************************************************************************
//set thread last view
$threadview fetch_bbarray_cookie('thread_lastview'$thread['threadid']); 


instead there is

PHP Code:

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



So should I add the code aboove this part?...




EDIT:

Well since I like to experiment I did it and seems to work fine. But probably you should change the instructions. :)






Quote:

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

Username formatting doesn't show at all as of now. When could we expect a new release? :)

CrazyLady 04-01-2005 01:25 AM

maybe I can sneak in here and ask if this can be modified, or a new hack created, to show if ANY member of a user group, (super moderators) has view the board. I would like to see if I can add a icon in the thread list view to tell my moderators if a thread has already been viewed/moderated by another moderator, saving them from having to view it as well... just a simple yes or no output?

anyhoo, just thought I would ask... nice looking hack!

snake-boy 04-12-2005 04:27 PM

Hi,

This is a fantastic hack, and I installed it with no problems in v3.0.7. Everything seems to be working except there is a critical bit of funcionality missing:

There does not seem to be any way to show the time/date the thread was viewed as there was in the original version of this hack.

The layout of this is SO much better than the original, but without time/date information, it isn't as helpful as it cold be... Is there any way to add time and datestamps to the list of users who viewed the thread?

-snake

aranthorn 05-02-2005 03:37 PM

Getting something weird. It was working very well, then I started getting a blank white page when resetting counters. Any ideas what I may have done?

mtha 05-10-2005 12:56 PM

Quote:

Originally Posted by Ocean
Actually, you can accomplish that function right now. In fact, it's easy when it's a new and single announcement - because all you have to do is save the user list once the time is up, and you'll know who viewed it by that point and who didn't.

Where it gets tricky, is if you edit or add to that announcement - because then the question is who read it since it was updated. It's for that reason that I added that second counter. Now, once you edit or add to an Announcement/Bulletin/Post, just reset the second counter for that thread. Now you'll know exactly who read it before your changes and who read it afterwards. :)

Ocean, can you make it to Who View This Announcement too? wouldnt be too hard, right?

Brandon Sheley 05-25-2005 05:14 AM

nice hack, installed no probs.. was a little confused with step 6. but after looking thu this thread i got it working fine :)

thank you

*clicks instal*

brvheart 09-08-2005 12:01 PM

ok, I have 3.0.7


this is the code that I see:

/
PHP Code:

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

if ((!
$posted OR $updatethreadcookie) AND $displayed_dateline AND $displayed_dateline $threadview)
{
        
set_bbarray_cookie('thread_lastview'$threadid$displayed_dateline); 


I am supposed to be looking for this:

PHP Code:

// *********************************************************************************
//set thread last view
$threadview fetch_bbarray_cookie('thread_lastview'$thread['threadid']); 


I did a search in winsyntax(my editor), and the code
PHP Code:

$threadview fetch_bbarray_cookie('thread_lastview'$thread['threadid']); 

is not found until way down the screen no where close to
PHP Code:

//set thread last view 


so where should I add the this above?
PHP Code:



################################################################################
########################## Who Viewed This Thread ##############################
##########################      CONFIGURATION     ##############################
################################################################################






*


Any help would be greatly appreciated.

brvheart 09-08-2005 12:50 PM

ok, let me see if I got this right,

I inset nothing between the "configuration Sections" it is just guidlines, but after that I post everything until the next step?

I think that is where I went wrong, I will try again, please someone chime in here and give me a hand :)

brvheart 09-08-2005 12:54 PM

well, that did not work either...I will wait on someone to jump in here and give me a hand.

brvheart 09-08-2005 01:09 PM

I get the DA award!!!! Had I read, and followed, I would have been ok, instead of trying to make my thinking on it.

"ADD EVERYTHING BETWEEN *********** AND ********** MEANS JUST THAT!

Thank you for hack, tested works great!

pirotess 09-14-2005 03:57 PM

Any chance this can be ported to the plugin system of 3.5? I love this mod and already have the table rows built up from a long period of use so dont want to lose all that functionality.

brvheart 12-24-2005 04:38 PM

any chance of getting this enhanced version ported to 3.5.x?

brvheart 01-05-2006 06:59 PM

Quote:

Originally Posted by ravenes
any chance of getting this enhanced version ported to 3.5.x?


bump :)

YLP1 01-13-2006 11:21 PM

Quote:

Originally Posted by ravenes
bump :)

Ditto!

Chris583 01-22-2006 10:09 PM

me too!

cherieann 02-22-2006 02:39 PM

would love a 3.5 as well if you have it?

realdes@hotmail 03-08-2006 09:33 PM

i do all the step in a new Version forum .. it is good hack and a nice work ..

but when i do same all step in my forum i have error in sql db

what can i do plez ?

bjs144 03-09-2006 03:35 PM

Works a treat on 3.0.8. Cracking Mod. Well done

Would like the "User viewed this thread at time & date" info as my small board needs to record when people read the thread.

Many thanks again.


All times are GMT. The time now is 06:09 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.02124 seconds
  • Memory Usage 2,134KB
  • 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
  • (12)bbcode_code_printable
  • (8)bbcode_php_printable
  • (18)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)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