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)

Ocean 07-07-2004 10:10 AM

Quote:

Originally Posted by rocol

@ 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 ;)

:)

I'm glad everything's working well. :)

FWF 07-13-2004 02:58 AM

I was told this didnt work corectly for 3.0.1 ?

xmitchx 07-17-2004 06:29 AM

It works for all 3.0.x so far (tested). :)

gotvenm 07-19-2004 11:27 PM

i guess im just stoopid cause i cant get this mod to work without a parse error.

what exactly is mod'd in the showthread.php ?

I dont understand this statement in the instructions
Code:

OPEN FILE showthread.php AND FIND
// ********************************************************************************  *
//set thread last view
set_bbarray_cookie('thread_lastview', $threadid, TIMENOW);




ABOVE ADD
---------

<if condition="is_member_of($bbuserinfo,6)">

$showinvisible = 1;

// Get who has already viewed this thread
$currentthread = $DB_site->query_first("SELECT whoviewed FROM ".TABLE_PREFIX."thread WHERE threadid = $threadid");
$vieweduserids = explode(" ", $currentthread['whoviewed']);

$userinfo = fetch_userinfo($bbuserinfo['userid']);

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");
    }
}

// Who has viewed this thread?
if (empty($currentthread['whoviewed']))
{
    $thread['viewers'] = '('.strtolower($vbphrase['none']).')';
}
else
{
    $result = $DB_site->query("SELECT userid, username FROM ".TABLE_PREFIX."user WHERE userid IN (" . implode(", ", $vieweduserids) . ")");
    $viewers = array();
    while ($user = $DB_site->fetch_array($result))
    {
            array_push($viewers, "<a target=\"_blank\" href=\"member.php?".$session['sessionurl'] . "u=".$user['userid'] . "\">" . htmlspecialchars($user['username']) .    "</a>");
    }
    $thread['viewers'] = implode(", ", $viewers);
}
</if>

i put this in the showthread template above $poll

Code:

<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"><tbody>
<tr>
<td class="thead">
<a style="float:$stylevar[right]" href="#top" onClick="return toggle_collapse('forumhome_todayactiveusers')"><img id="collapseimg_forumhome_todayactiveusers" src="$stylevar[imgdir_button]/collapse_thead$vbcollapse[collapseimg_forumhome_todayactiveusers].gif" alt="" border="0" /></a>
$vbphrase[already_viewed_this_thread]
</td>
</tr>
</tbody>
<tbody id="collapseobj_forumhome_todayactiveusers" style="$vbcollapse[collapseobj_forumhome_todayactiveusers]">
<tr>
<td class="alt1"><div class="smallfont">
$thread[viewers]
        </div></td>
</tr>
</tbody>
</table>
<br />

thanks...

gotvenm 07-22-2004 08:12 PM

anyone using this mod ?

help ? please ?

flame 08-24-2004 09:16 PM

the reason your getting a parse error is because you have this (<if condition="is_member_of($bbuserinfo,6)">) in your .php file whereas it should be in your showthread template.

Also a small requesy ont knoe if its posible, but what aout changing the font colour for ppl wo have replied to thread theat way we can see quicly who has replied and who hasnt.

I had a look at whosposted, and the only way i can think of is to "compare" $posters against $viewers any matchs result in font change? is there such a function to compare to exlpoded lists?

Flame

Loki12 08-26-2004 10:51 PM

Quote:

Originally Posted by Gary King

ADD PHRASE:
already_viewed_this_thread / Already viewed this thread:

Where does one add this phrase??? :ermm:

Ocean 08-30-2004 07:41 PM

Hi, everyone!


A while back, I posted some suggestions for improving this already excellent hack. As some time had passed, I decided to make some of those modifications myself and offer them as an enhanced version of this hack.

I have just released it earlier today. For anyone who's interested, Gary has put a link to it from the first post of this thread.


Or, here it is again: https://vborg.vbsupport.ru/showthread.php?t=68876


:)

Edric 09-13-2004 10:42 AM

I installed this about 12 hours ago on 3.0.1 but I do not get the list of Members that viewed threads (and Members did view threads for sure), the box is there for each thread but no Members are listed, any idea what am I doing wrong?

Bison 12-23-2004 03:50 PM

bump ...


All times are GMT. The time now is 01:10 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.01167 seconds
  • Memory Usage 1,745KB
  • 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
  • (2)bbcode_code_printable
  • (2)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
  • (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