View Full Version : [Module] Members who have visited the forum
Tom M
12-12-2005, 01:39 PM
This simple module requires that the similarly named product (http://www.vbulletin.org/forum/showthread.php?t=82769) by Paul M be installed first.
Once this is installed and configured just install this module into CMPS and you are good to go. This makes direct use of the forumhome_start plugin and does make an assumption that there aren't any other plugins that will conflict.
Edit the adv_portal_active_users template to say whatever you wish. Alternatively, you may use the Display_Vistors template that comes with the plugin - simply change the reference in the todays_users.php module. There's no need to add it to the module definition as it's already cached.
geoff
12-12-2005, 01:41 PM
very cool...will have to try this
Drago912
12-12-2005, 02:23 PM
Ive been looking for this module but it wont showup on the portal page.........hmm
Tom M
12-12-2005, 02:33 PM
Ive been looking for this module but it wont showup on the portal page.........hmm
Did you already install the other thing that's required? Is it marked as active?
geoff
12-12-2005, 09:22 PM
Hmmm..the link to the actual members shows up as /member and not /forum/member as where my members list is...any quick fix?
Tom M
12-12-2005, 09:49 PM
Hmmm..the link to the actual members shows up as /member and not /forum/member as where my members list is...any quick fix?Oops. I've added some code to do a fixup on members.php. Download the updated version from the first post and reinstall.
geoff
12-12-2005, 10:09 PM
heh...that's what i am talking about...a quick fix!
god work man
Gothmog
12-13-2005, 02:28 AM
sweet! I've been looking for something like this!
Thanks!
e-steki
12-13-2005, 10:30 AM
/me clicks install :p
Thank you!
Ramses
12-14-2005, 12:37 AM
Thank you Tom
wissamnasr
12-14-2005, 02:59 PM
is there a way to merge it with the online users block?
Tom M
12-14-2005, 04:08 PM
is there a way to merge it with the online users block?In onlineusers.php add the bit in red eval('$home[$onlinemod[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_onlineusers') . '";');
($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval($hook) : false;
$whotoday = str_replace( "member.php", $vbulletin->options['bburl'] . "/member.php", $whotoday);
eval('$home[$onlinemod[\'modid\']][\'content\'] .= "' . fetch_template('adv_portal_active_users') . '";');
if ($mods['useshell'])
Then, replace your adv_portal_active_users template with<tr>
<if condition="$onlinemod[title] == 'Online Users'">
<td class="thead"><span class="smallfont">Registered Visitors: $totaltoday</span></td>
<else />
<td class="thead"><span class="smallfont"><strong>Registered users that have visited today: $totaltoday</strong></span></td>
</if>
</tr>
<tr>
<td class="alt1" width="100%"><div class="smallfont">$whotoday</div></td>
</tr>The updated adv_portal_active_users template will then work with the original module as well as with this modification.
EDIT: Don't forget to add adv_portal_active_users to the list of templates used in the Online Users module.
sully02
12-17-2005, 04:26 PM
I seem to be having issues with this one, so I'll go through and see what I've done, perhaps there is a mistake along the way:
1] Install Paul M's Plugin (Works on Forum Index)
2] Download module and install via AdminCP
3] Edit todays_users.php to use Display_Visitors template
No table shows up on the homepage at all, using vBulletin 3.5.1
sully02
12-17-2005, 05:04 PM
I seem to be having issues with this one, so I'll go through and see what I've done, perhaps there is a mistake along the way:
1] Install Paul M's Plugin (Works on Forum Index)
2] Download module and install via AdminCP
3] Edit todays_users.php to use Display_Visitors template
No table shows up on the homepage at all, using vBulletin 3.5.1
Upon further review, it may be a problem on my end as opposed to that of the module. Temporarily disregard.
caimakale
01-06-2006, 01:14 AM
I have found a problem and wonder if anybody has a solution. I integrate alot of my pages into CMPS, the forum homepage being one of them. When I view the forums, I have the column on the left which shows who was online, but the default on installed from vb.org for the forums shows up twice. If I disable the cmps version, the second one goes away.
Any ideas how to fix this?
Tom M
01-06-2006, 01:29 AM
Are you saying you have the FORUMHOME page displayed on your CMPS page and that you have both the Paul M "who's visited" showing as part of the forum and the "who visited" CMPS module? If you disable the CMPS module that neither shows up - or is it that if you disable the one on the FORUMHOME version that neither shows up (which would make sense as the CMPS module uses the FORUMHOME one to display the data).
Do you have a link?
caimakale
01-06-2006, 01:56 AM
I attached a picture.
When I disable the CMPS module, one of those two "Members who visited today" sections in the footer disappear and it displays normally. You can kind of see my CMPS left column in the picture.
It only exists when viewing the forums with the cmps integrated.
I hope this is a little clearer.
Tom M
01-06-2006, 02:23 AM
Do you have a link so I can see it 'live'?
caimakale
01-06-2006, 02:54 AM
You have a PM
mikelbeck
01-09-2006, 10:13 PM
I seem to be having issues with this one, so I'll go through and see what I've done, perhaps there is a mistake along the way:
1] Install Paul M's Plugin (Works on Forum Index)
2] Download module and install via AdminCP
3] Edit todays_users.php to use Display_Visitors template
No table shows up on the homepage at all, using vBulletin 3.5.1
I've got this same issue, but I'm on vB 3.5.3.
Any ideas?
{edit}
Never mind, my own fault. If you don't select "update all pages" it won't be displayed. ;-)
{/edit}
tidy_boy
01-18-2006, 02:44 PM
excellent worked a treat :D
nolnet
01-19-2006, 10:38 AM
I've installed the module and activated the module on a page but I get this error when the page loads:
Fatal error: Call to a member function on a non-object in /home/oklahoma/public_html/modules/onlinetoday.php on line 8
When I remove the module from the page the error goes away.
I am running version 3.5.3
Tom M
01-19-2006, 12:40 PM
I've installed the module and activated the module on a page but I get this error when the page loads:
Fatal error: Call to a member function on a non-object in /home/oklahoma/public_html/modules/onlinetoday.php on line 8
When I remove the module from the page the error goes away.
I am running version 3.5.3Do you have the vb plugin by Paul M installed?
The other thing is that there is no onlinetoday.php file that's part of this module. Did you rename it? Any additional details would be good.
caimakale
01-27-2006, 10:44 PM
Ok this is driving me nuts. It doesn't have anything to do with templates because it is even happening on the default vb template. I think it has to do with the fact that I have the left column of vba cmps integrated into the forums.
Brian can you shed any light on this? Will any entries into the error_replacements plugin fix this?
Tom M
01-27-2006, 11:08 PM
Ok this is driving me nuts. It doesn't have anything to do with templates because it is even happening on the default vb template. I think it has to do with the fact that I have the left column of vba cmps integrated into the forums.
Brian can you shed any light on this? Will any entries into the error_replacements plugin fix this?The light bulb just went off and I know what's happening.
The reason it's in the forum twice is because the plugin does an automatic template edit as well as calculate what's supposed to be displayed. The edit is being run twice because the plugin is being called twice. Once by the forum code and once by the CMPS module. This result in the cached template being edited twice! :eek:
Try this... I have no idea if this will work or not but it's worth a shot. In the todays_users.php file replace the hook call with 'global $whotoday;' and see if that works. You might also need to add $whotoday to the list of globals in the CMPS defaults section. This will solve it for when it's used with forumhome but will break it elsewhere. However once you get it working on forumhome it can be taken care of with a minor code tweak.
caimakale
01-27-2006, 11:47 PM
I added $whotoday to the Portal Output Global Variables section of vBa CMPS. I left off the $ as per the instructions and just put in whotoday.
As for the other part....
<?php
($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval($hook) : false;
$whotoday = str_replace( "member.php", $vbulletin->options['bburl']. "/member.php", $whotoday);
eval('$home[$mods[\'modid\']][\'content\'] = "' . fetch_template('adv_portal_active_users') . '";');
?>
Exactly where do you make the edit? I tried multiple variations and didn't get any different results. I want to make sure I try the right edit to test it.
Tom M
01-28-2006, 01:15 AM
Exactly where do you make the edit? I tried multiple variations and didn't get any different results. I want to make sure I try the right edit to test it.Try removing or commenting this line...($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval($hook) : false;
caimakale
01-28-2006, 02:04 AM
OK...I was wondering why it wouldn't work...I have the hack integrated into the whos online box. (that's why my previous edits weren't working)
I edited onlineusers.php...commenting that line out The second box disappears in the forums now...but the users completely disappear in the CMPS hack.
*edit - to clarify, the box itself in the cmps hack is still there....but the names are no longer in it.
Tom M
01-28-2006, 02:40 AM
OK...I was wondering why it wouldn't work...I have the hack integrated into the whos online box. (that's why my previous edits weren't working)
I edited onlineusers.php...commenting that line out The second box disappears in the forums now...but the users completely disappear in the CMPS hack.
*edit - to clarify, the box itself in the cmps hack is still there....but the names are no longer in it.Did you add the 'global $whotoday;' line?
Here's something else to try if you're up to it ;)
1. Undo the changes you just made.
2. Modify the Members who have visited plugin.
In the plugin for forumhome_start find near the bottom$search_text = '<!-- end logged-in users -->';and replace with$search_text = '<!-- end logged-in users -->' . chr(0x0d);Because of the way the edit works this should now only insert it once.
caimakale
01-28-2006, 02:52 AM
Doing the second mod you suggested...I still have the same problem.
The first mod...after I add
'global $whotoday;'
and erase
($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval($hook) : false;
I get this error:
Parse error: parse error, unexpected T_VARIABLE in /home/website/public_html/modules/onlineusers.php on line 189
caimakale
01-28-2006, 02:55 AM
I just replaced
'global $whotoday;'
with
'global $whotoday';
The error went away but it still doesn't show any users in the cmps block.
Tom M
01-28-2006, 03:11 AM
Try it without the quotes. The line should beglobal $whotoday;
If that doesn't work and you'd like me to poke around a bit I'll be happy to do so tomorrow. I'd do it on my system but don't have the code changes to have the CMPS and forums on the same page.
caimakale
01-28-2006, 04:52 AM
I am not the best with this stuff but here is how I fixed it.
The hook in the vBa CMPS module was calling for and spitting out what was already there. To fix it I wanted to find a way to display this info without using that hook.
I am sure there are better ways of doing this, my php skills are horrible at best, but here is how I resolved it. I used the code from the original vb hack that was relevant and copied in place of the hook.
Each users mileage will vary. I am posting my onlineusers.php code, if you don't have this hack incorporated with the online users block, this may not work for you. Tom M can confirm and and re-release his hack if needed.
***Code removed to prevent confusion...a working fix is posted below***
After adding this code, it resolves all of my problems so far. There could be other issues that I am not yet aware of....remember my php skills are horrible at best.
I will report any problems that I may have.
Tom M...thanks for your help and for steering me in this direction...let me know if you see possible problems that this may cause.
Tom M
01-28-2006, 10:50 AM
let me know if you see possible problems that this may cause.The only issue I see doing it this way is that when updates are made to the basic version of the plugin your update won't see them. Other than that, if this works for you then there's nothing wrong with what's been done.
I'm pretty sure the problem should be resolvable by some relatively minor code tweaking in either the php file that comes with this module or in the plugin code from Paul M. The only thing I'm not sure of is when the forum code gets eval'd vs. when the CMPS code gets eval'd when building the integrated page. If the CMPS stuff is first then the change would need to be the plugin code. If the CMPS stuff is last then the change can be in the php file.
Tom M
01-28-2006, 12:00 PM
I've added the code to check this out to my test site and this simple mod works on my system.
In your todays_users.php file (or the equivalent line in your modified onlineusers.php file) replace
($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval($hook) : false;with($hook = vBulletinHook::fetch_hook('forumhome_start')) ? eval(str_replace('<!-- end logged-in users -->','<!-- ThIs WiLl NoT Be FoUnD -->',$hook)) : false;
That's it. When executed from the CMPS module the plugin code won't modify the FORUMHOME template. Doing it this way means the plugin code can be updated w/o impacting this code - unless the search strin is changed. It's possible to dynamically extract the string but that's probably a lot more trouble than it's worth.
This change only needs to be made if the forum is integrated with CMPS and you are using this module on the displayed page at the same time - though I'm unclear as to why one would want the info in both places.
caimakale
01-28-2006, 02:11 PM
I've added the code to check this out to my test site and this simple mod works on my system.
I tried this on my site instead of all of that other code and it worked just fine. I will stick with this way of doing it as it's much cleaner.
Thanks for your help Tom
Jon Matcho
02-02-2006, 07:29 PM
This module does not upload for me in vBa 2.1 (vB 3.5.3). I receive this message: "Could not find phrase 'adv_portal_invalid_modfile'." and the module does not load.
Tom M
02-02-2006, 08:18 PM
This module does not upload for me in vBa 2.1 (vB 3.5.3). I receive this message: "Could not find phrase 'adv_portal_invalid_modfile'." and the module does not load.Nope. It works just dandy with 2.1/3.5.
Are you able to upload other modules w/o any problems? If this is the first one you've tried make sure your module directory is set to chmod 777. If that's already the case I'll be happy to take a look at things for you.
dizzine
02-03-2006, 12:29 PM
having probs with this...
on forumhome the plugin from PaulM works fine..
i uploaded this module but cant for the life of me get it to show up..everything that should be enabled is, afaik...hte template is there, the .php file is on in my file system..i cant see any reason why its not showing on my CMPS home page..!
could someone post a checklist of things to ... erm .. check..?!
Tom M
02-03-2006, 12:37 PM
could someone post a checklist of things to ... erm .. check..?!Have you checked to make sure the module is both marked as Active and that it's enabled for the page you want it on? If this is the case and you'd like assistance PM me with the necessary info to login and check things out via the ACP.
IndyWebDesign
02-03-2006, 02:27 PM
I installed this and it shows on the index page but it doesn't show any members... any idea?
Tom M
02-03-2006, 03:36 PM
I installed this and it shows on the index page but it doesn't show any members... any idea?Have you checked to make sure the module is both marked as Active and that it's enabled for the page you want it on? If this is the case and you'd like assistance PM me with the necessary info to login and check things out via the ACP.
Jon Matcho
02-03-2006, 05:09 PM
Nope. It works just dandy with 2.1/3.5.It must be my eyes then.
I uninstalled vBa 2.1 entirely, and then re-installed. The phrases are now in the database, and so now I'm getting an English version of the message: "The file you have uploaded is not a valid module file."
(edit) I gave read-write permission to the modules folder and all is working now -- looks great! I'm using Windows IIS so "chmod 777" doesn't jump out at me.
dizzine
02-04-2006, 09:36 AM
hmmm..interesting..!
i deleted the module you gave and created a new file module..
i selected the todays_users.php file in the dropdown and then told it to use the adv_portal_active_users template, exactly as your module states..
now it works great on my home CMPS page..
thankyou..
anyone else having trouble getting the module to show up, just try creating your own module but use Toms' .php and template..works great..
cheers Tom
MamboKing
03-24-2006, 04:14 PM
Maybe I'm a little late and the mod and files have changed. Where is the todays_users.php file. It not with vb hack and it's not with the Add On Module? I been looking for the this since I installed my portal.
Please help. Thanx in advance
MamboKing
03-24-2006, 05:15 PM
Found it!! I was looking in the root. Found it in modules folder but it not working for me. Will not show up on port. Yes it is active.
MamboKing
03-24-2006, 06:35 PM
Third times the charm.
reRead everything. Took a little of and a little of that and it works fine. I had to recreate my todays_users.php also because I couldn't chmod it. I used Tom's merge onlineuser.php and adv_portal_active_users mod and it was all good after that. It was exactly what I wanted anyway, I didn't want a separate module.
Thanx Tom
Thanx to all who contribute.
kctalker
03-31-2006, 06:37 AM
I uninstalled vBa 2.1 entirely, and then re-installed. The phrases are now in the database, and so now I'm getting an English version of the message: "The file you have uploaded is not a valid module file."
(edit) I gave read-write permission to the modules folder and all is working now -- looks great! I'm using Windows IIS so "chmod 777" doesn't jump out at me.
I am using IIS also, but can not get around this problem, it will not upload for me. Can you tell me what you did to get it to work properly. Thanks.
kctalker
03-31-2006, 06:55 AM
Actually, forget that last post, I figured it out.
Here is a weird problem I am having, when I am logged in, I see say 5 members have been online today, but when I log out, I see 7 have been online today with a couple more names.
When I log back in, I see only 5 again.
Any ideas what would be causing this?
hi,
i am trying to translate the headline Module to hebrew , instead of "Registered users that have visited today: $totaltoday
but when i change it , i can not upload the Module.
i get this error- The file you have uploaded is not a valid module file
can you help?
thank you,
efil.
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.