The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
![]()
Hello,
i'm trying to get a page to show $activeusers content on a page. Actually it's a Cyb ChatBox for Vb 3.8.4 but it is not supported so i thought it should be simple for me to do that on my own but i failed. What i tried is i copied the part of code from my SHOWTHREAD template to the chat template. This is the code: Code:
<if condition="$show['activeusers']"> <!-- currently active users --> <div class="div-header"> <div class="div-header-right" style="float:right"></div> <div class="div-header-left"></div> <phrase 1="$totalonline" 2="$numberregistered" 3="$numberguest">$vbphrase[users_viewing_this_thread_x_y_z]</phrase> </div> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="alt1" colspan="2"><span class="smallfont">$activeusers</span></td> </tr> </table> <!-- end currently active users --> </if> <if condition="$show['activeusers']">$template_hook[showthread_after_activeusers]<br /> </if> Do you have any idea how to show what forum members are currently active on that page? Because on a chat, it's lame to have no list of active users... Thanks in advance |
#2
|
|||
|
|||
![]()
The problem is that the template gets it's information from variables which must be set in the php code for the page you're displaying. If you look at showthread.php and search for each occurance of 'activeusers' you'll see that there is quite a bit of code involved in building up the $activeusers variable before it's used in the template (although some of it might be doing other things as well).
|
#3
|
|||
|
|||
![]()
I'm not a PHP programmer, but i usually don't have big problems to make small php alterations, at least for vbulleting templates, i inspected the source of the showthread template but didn't really find any other "hooks" of code needed for $activeusers to be displayed.
Could you give me some hints of what to look for in it? Thanks in advance |
#4
|
|||
|
|||
![]()
Well, if you search in showthread.php for:
PHP Code:
I think this is start of the part that adds the current user. A little below that is: PHP Code:
Then below that is a loop which starts: PHP Code:
That looks like the part that adds all the other active users, one at a time. A little below that is: PHP Code:
The ".=" appends to the string, so that line adds one more user. Since you are using misc.php whihc doesn't have this code, $activeusers (which appears in the part of the template you borrowed from SHOWTHREAD) will be blank. So, you could try copying the block of code between these comments: PHP Code:
ETA: ...also, there may be important things that happen in the code before the block I mentioned above, in which case you may need to copy more that just that block. |
#5
|
|||
|
|||
![]()
Thank you. I didn't think at all about that i should edit PHP file. I tried the things you suggested but it didn't work, so now i'm trying different things to find a working solution.
|
#6
|
|||
|
|||
![]()
Yeah, I was kind of afraid that it wouldn't work. I don't know anything about that mod, so I don't know if the code for "users viewing a thread" has anything to do with the code that would be needed for "users currently chatting".
BTW, as far as editing php files, if you have to add code it's better to find a hook and insert the code as plugin, if possible. So if you figure out what code to add to create your list, you might be able to find a hook someplace in misc.php (or in some included file like global.php or init.php) and make it a plugin. |
#7
|
|||
|
|||
![]()
Well, after like 10 tries, i gave up. I don't have brains of a programmer to find the answer
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|