PDA

View Full Version : [Module] Members who have visited the forum


Pages : [1] 2

Tom M
09-09-2007, 12:09 PM
This simple module requires that the similarly named product by Paul M be installed first. The version for vb 3.6.x can be found here (http://www.vbulletin.org/forum/showthread.php?t=121883).

Once this is installed and configured (see below) just install this module into CMPS and you are good to go. This makes direct use of the global_start plugin and does make an assumption that there aren't any other plugins that will conflict.

For this version to work with CMPS it is necessary to configure the plugin to show on all pages. This is done via the ACP...

ACP -> vBulletin Options -> Who Has Visited Today -> Code Option -> Run Code on all pages

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.

Revisions

9/14/2007
Revised php code to no longer need the global definition with vBa as this conflicted when needing to have the Process PHP File Modules Within A Function set to 'Yes.' The updated version now work with the setting is either Yes or No.

9/11/2007
Revised php code to make use of the global data available via the plugin. To update, delete the existing version then install the new version replacing any existing files/templates.

yotsume
09-11-2007, 01:38 AM
Ok because your instructions in my book are very NOT clear... I have to ask why I get this error when I activate this module:

Fatal error: Cannot redeclare construct_jump2() (previously declared in /xxxxxx/xx/xxxxxxx/docs/forum/global.php(356) : eval()'d code:31) in /xxxxxx/xx/xxxxxxx/docs/forum/modules/todays_users.php(3) : eval()'d code on line 31

What did I miss? I do have Paul Ms installed already. Maybe a conflict with something else?

Our Sponsors
 

Tom M
09-11-2007, 02:25 AM
Ok because your instructions in my book are very NOT clear...Sure know a good way to ask for help, eh? The module is really very, very simple so I didn't include all the basic step-by-step installation on how to install a module. ;)

What versions of vb and vBa are you running? Based on the error message I'm guessing it's not 3.6.8 as the line numbers don't match up.

What other plugins do you have that have global_start as the hook location?

EDIT: It looks like you must have the Forum Jump In Navbar hack installed. If so, you should be able to get rid of the error by wrapping the construct_jump2 function in a conditional. Open that specific plugin and in front of the function declaration add
if(!function_exists('construct_jump2'))
{
After the function close add another '}' without the quotes.

You'll probably also need to do the same thing for the jumpforumbits2html function - just change the function name in the above if(...) example.

yotsume
09-11-2007, 02:33 AM
Aaa I am on 3.6.4 and CMPS v3.0 RC1

As for the other plug I might have using global_start I have no Idea... there an easy way to check?

Our Sponsors
 

Tom M
09-11-2007, 02:40 AM
See my update in the prior post.

To check what plugins use which hook locations use the ACP -> Plugins & Products -> Plugin Manager and the hook locations will be displayed.

yotsume
09-11-2007, 02:53 AM
I have a number of plugins that use that hook. Your edit to the forum jump plugin kills the plugin. The menu will not popup with your edit instructions in place.

yotsume
09-11-2007, 03:11 AM
Oh I am sorry if my request for help seems rude but if people knew how to write clear instructions there would be 1000s of less posts on the forum!

People assume to much and it would be best to write instructions by taking the time to include all levels of user. I feel this needs to be a rule on this forum. If you make an addition in anyway to the vBadvanced products there should be some rules set for posting your additions with CLEAR instructions for all levels of users.

Again I am NOT being rude just blunt! I hope you consider rewriting your posts. If you put some more energy into making a clear first post you will NOT have to waste more time explaining what you mean.

vBadvanced forum is littered with poor instructions and posts all over. Good intentions yes... poor writing skills BIG TIME!

I will get this sorted out an implemented on my older board... Again I have a number of plugins as will many that use that hook location. That version of Forum Jump Menu is older as well but runs on pre 3.6.8 boards...

Tom M
09-11-2007, 03:29 AM
I have a number of plugins that use that hook. Your edit to the forum jump plugin kills the plugin. The menu will not popup with your edit instructions in place.If the edit was applied correctly it should NOT kill the plugin as all the edit does is make sure that the function can only be defined once. The only other possibility is that there's some other interaction or change that is needed due to it being a plugin. Since I don't have that hack installed it makes it a bit tougher to troubleshoot and I guess my being proactive and looking it up for you and trying to provide a solution doesn't get any points. :eek:

I fully support the modules I create but am no longer willing to document to a level that complete novices need. Users need to be willing to do a bit of learning before taking on more advanced capabilities and not rely on other people holding their hands all the way through the process. Truthfully, I have done modules with detailed installation/configuration instructions and still gotten very basic questions even though it was covered in the write up. As far as support goes, I reply promptly to requests and even take on the task of making it work for people if they don't have enough experience to get it working on their own.

If you desire additional assistance with this I'm perfectly willing to provide it, including doing the edits for you to make sure things work properly.

yotsume
09-11-2007, 03:35 AM
I will deactivate the jump menu and test your module.

Like I said there needs to be forum rules set for submissions. Your work might be good but would be great if documented correctly... Oh you support gets points... But again you will have to provide maybe more support then was needed if DOCUMENTED CORRECTLY! LOL

yotsume
09-11-2007, 03:49 AM
OK! It is 100% the "Forum Jump Menu". Your mod works perfect now.

So what can I send you or post to help with how I need to add your code changes so I have a better clue to fix up the jump menu mod?

yotsume
09-11-2007, 04:00 AM
Attached is the Forum Jump Menu code in a text file.

I am not sure how to make your changes... :)

Tom M
09-11-2007, 12:32 PM
Attached is the Forum Jump Menu code in a text file.

I am not sure how to make your changes... :)Rather than mess with that I've revised the module to (hopefully) eliminate any conflicts while still using the hook code. Download and install the updated version from the first post and overwrite the existing versions of the templates, php file, etc.

yotsume
09-11-2007, 01:20 PM
Installed New Version!

That fixed the conflict with the Forum Jump menu. Thank you very much it all looks great!

I have one question... What is the difference if any between the two templates: 1) adv_portal_active_users and 2) Display_Vistors?

I've tried both in your module and they both work and look the same on my forum...

In your updated instructions I would change them and tell people that it is better to actually delete the previous module and template before updating because the update makes a second module that you will have to make a new identifier for. It does not perfectly overwrite.

Tom M
09-11-2007, 01:52 PM
I have one question... What is the difference if any between the two templates: 1) adv_portal_active_users and 2) Display_Vistors?

I've tried both in your module and they both work and look the same on my forum...They are indeed very similar from a display standpoint when used as just the "Who visited today" scenario. However (this goes back a ways and I'd have to look up what it took) the adv_portal_active_users template can also be used in combination with the who's online module and still function properly.

cmb7684
09-12-2007, 02:30 PM
Tom,

I'm having the same issue as I was in the previos version of this module. Its uploaded and showing on the page. Its the expandable block that will collapse and has Today's Visitors and Registered Visitors but its not showing any of the names of the visitors. This Paul M install is working fine bvulletin pages

Tom M
09-12-2007, 02:43 PM
Tom,

I'm having the same issue as I was in the previos version of this module. Its uploaded and showing on the page. Its the expandable block that will collapse and has Today's Visitors and Registered Visitors but its not showing any of the names of the visitors. This Paul M install is working fine bvulletin pages
Did you add the global variables (totaltoday and whotoday) to the list as instructed in the first post?

Lionel
09-12-2007, 02:56 PM
cool mod, thanks

Manor
09-12-2007, 03:45 PM
For anybody that doesn't have the above stated product, here's a quick fix.

Add this code before the "$whotoday = ..." statement in the "todays_users.php" file.

$visitorsq = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user WHERE lastvisit >= " . (time() - 86400) . " ORDER BY lastvisit DESC");
$totaltoday = $db->num_rows($visitorsq);
$whotoday = '';
$comma = '';

while($v = $db->fetch_array($visitorsq))
{
$whotoday .= $comma . '<a href="member.php?' . $session['sessionurl'] . 'u=' . $v['userid']. '" rel="nofollow">' . $v['username'] . '</a>';
$comma = ', ';
}

cmb7684
09-12-2007, 03:47 PM
the carriage return that looks like this? <'totaltoday'><'whotoday'>

Tom M
09-12-2007, 03:52 PM
For anybody that doesn't have the above stated product, here's a quick fix.

Add this code before the "$whotoday = ..." statement in the "todays_users.php" file.

While I appreciate that you are trying to help, most of the people looking for this mod also want to have the data available on the FORUMHOME page - which is waht the Paul M plugin does. That's why this version makes use of the plugin code as the queries are already being run. So please don't recommend modifying this module w/o getting permission first as it's considered bad form. :(

As an aside, in the current version of vb it's recommended to use $db->query_read_slave() instead of $db->query_read() to increase performance on heavily loaded systems.

Tom M
09-12-2007, 03:54 PM
the carriage return that looks like this? <'totaltoday'><'whotoday'>They should be entered on separate lines like thistotaltoday
whotoday

Manor
09-12-2007, 03:56 PM
Sorry, just helping out. Okay, without this being "bad form" another way would be to add a plugin at "style_fetch".

Out of curiosity, did you get the original author's permission to use his addon?

Tom M
09-12-2007, 04:05 PM
Sorry, just helping out. Okay, without this being "bad form" another way would be to add a plugin at "style_fetch".

Out of curiosity, did you get the original author's permission to use his addon?Since the original code isn't being touched and only the results of the existing plugin are being utilized (which is already designed to run on all pages) that isn't really necessary. ;)

There are indeed several ways a similar result could be had. However the way this is implemented it also allows users to combine the output with the Online Users module by using the existing template and a small mod to the onlineusers.php file.

Now, back to our regular programming...

cmb7684
09-12-2007, 04:10 PM
ok that fixed it.......

I had to delete the quotes and the < > symbols around the totaltoday and whotoday and put them exactly as shown in your above post.


Thanks a million.

Tom M
09-14-2007, 08:06 PM
There is an updated version of the module available in the first post which now works whether the Process PHP File Modules Within A Function setting is Yes or No.

cyclone02
09-16-2007, 01:19 PM
For anybody that doesn't have the above stated product, here's a quick fix.

Add this code before the "$whotoday = ..." statement in the "todays_users.php" file.

$visitorsq = $db->query_read("SELECT * FROM " . TABLE_PREFIX . "user WHERE lastvisit >= " . (time() - 86400) . " ORDER BY lastvisit DESC");
$totaltoday = $db->num_rows($visitorsq);
$whotoday = '';
$comma = '';

while($v = $db->fetch_array($visitorsq))
{
$whotoday .= $comma . '<a href="member.php?' . $session['sessionurl'] . 'u=' . $v['userid']. '" rel="nofollow">' . $v['username'] . '</a>';
$comma = ', ';
}


Hi

thanks a lot for this code, but is it possible to display colored usernames? using that colors assigned to each members usergroup? if i use that vb product i see that all the member names are colored but i dont want to use that plugin(only want to show todays visitors on cmps page) so could you please post some code or something using which i can get colored usernames?

Thanks in advance

Tom M
09-16-2007, 02:31 PM
Hi

thanks a lot for this code, but is it possible to display colored usernames? using that colors assigned to each members usergroup? if i use that vb product i see that all the member names are colored but i dont want to use that plugin(only want to show todays visitors on cmps page) so could you please post some code or something using which i can get colored usernames?

Thanks in advanceYou can use the plugin but disable the display on the FORMHOME page by setting the ATCS: Enable option for the plugin to 'No'.

ThePhlexican
09-21-2007, 11:30 PM
This is a great mod and I've had no problems with it...But I was wondering if there was a way to also count guest visits and also show that as in 'x members and x guests' like the online now block?

Tom M
09-22-2007, 12:21 AM
This is a great mod and I've had no problems with it...But I was wondering if there was a way to also count guest visits and also show that as in 'x members and x guests' like the online now block?There is an add-on over at vb.org that will count Guests but it's separate from this. I would imagine that it might be possible to combine the output of the two plugins into a single vBa module if one was motivated enough.

nostalgia
09-30-2007, 01:49 AM
Works perfectly!!
Thanks Tom.
*VB3.6.8 + CMPS 3.0RC2

bangag
10-03-2007, 11:37 PM
i installed this module but nothing is showing up.
blank for totaltoday and whotoday.

i couldn't find this option under Who Has Visited Today options:
ACP -> vBulletin Options -> Who Has Visited Today -> Code Option -> Run Code on all pages

thanks in advance

Tom M
10-04-2007, 12:01 AM
i installed this module but nothing is showing up.
blank for totaltoday and whotoday.

i couldn't find this option under Who Has Visited Today options:
ACP -> vBulletin Options -> Who Has Visited Today -> Code Option -> Run Code on all pages

thanks in advanceJust to verify, have you installed and configured the plugin (http://www.vbulletin.org/forum/showthread.php?t=121883) that's required? There's an updated version for 3.6.8 so if you are running a prior version you should upgrade.

bangag
10-04-2007, 06:03 AM
yes, i had it installed. but it seems mine was outdated (4.41), i have now updated to 4.42! didn't see that there was a new version. thanks and sorry for the hassle!

GateKeper
10-04-2007, 09:56 AM
Works perfectly!!

Thanks

*VB3.6.5 + CMPS 3.0RC2

I keep getting better and better at this, yesterday was a nightmare, today it was just a dream, and it came true..

:D

Rop
10-10-2007, 08:57 PM
While trying to get this to work I've gotten myself into a bind: I tried to use the "Upload Module" function from the CP to add the 'todaysvisitors.module' file to my vBa CMPS install. Paul M's latest visitor stats plugin was already installed. Nothing showed in the "Edit Modules" list after uploading the module, so I tried a few more times. At that point I noticed several 'empty' (for lack of a better term) modules, just a checkbox without a title, in the "Edit Modules" list. Every time I tried uploading this module it would add another emty entry to the list of modules. Those bogus modules are set to show in the left column, nothing is showing though.

So, I now have 5 of those empty modules, with no mechanism to remove them. They don't have a title, so no hyperlink to get into the module's settings, and no option that can be accessed to delete it. Any idea on how to (manually) remove those bogus modules from vBa? The next question is, what happened here?

My forum is running vB v3.6.8 and vBa v2.2.1. In case anyone wants to take a look, the URL is http://www.greenpowertalk.org/

Thanks!

-Rob-

gorp
10-10-2007, 09:12 PM
works as advertised - in your ACP under "Who Has Visited Today" make sure you check the "Change this if you want this modifications code to run on all vb pages, not just the forum homepage" (Code Option) to "Run Code on all pages"

Rop
10-11-2007, 09:14 PM
I've managed to get rid of the 5 ghost modules by directly editing them out of the database table of modules. They were empty rows in the database, no name, nothing.

Could it be that this new 'todaysvisitors.module' only works on CPMS v3.x? I'm not seeing any restriction on CPMS version number mentioned anywhere, but who knows. Uploading it on my v2.2.1 system invariably fails. I was running an older version of this module before (made for vB v3.5.x, if I remember right, and patched to work with Paul M's previous version). That was deleted before trying to upload this new version of Today's Visitors. The old one worked fine, until I upgraded Paul M's hack to the current one. That's what prompted me to install this module. Unfortunately with a profound lack of success...

Any suggestions?

-Rob-

Rop
10-11-2007, 09:32 PM
Another update: I re-uploaded the old v3.5.x 'todaysvisitors.module'. This uploaded fine, and miraculously works fine too. This is in vB v3.6.8 and with Paul M's latest add-on of Today's Visitors. No idea why the old version works now, unfortunately I know too little about the underlying plumbing of vBa to tell. Maybe it is because the variables it uses are now made global (previously they were not). I'll quit while I'm ahead though.

-Rob-

Tom M
10-11-2007, 11:47 PM
works as advertised - in your ACP under "Who Has Visited Today" make sure you check the "Change this if you want this modifications code to run on all vb pages, not just the forum homepage" (Code Option) to "Run Code on all pages"Yes, indeed. Just like the instructions say in the first post ;)
For this version to work with CMPS it is necessary to configure the plugin to show on all pages. This is done via the ACP...

ACP -> vBulletin Options -> Who Has Visited Today -> Code Option -> Run Code on all pages

elitemerlin
12-07-2007, 01:27 AM
works great, thanks!

grahamsmythe
12-09-2007, 06:32 PM
Not sure if anyone can help, but here goes...

We're running vBulletin 3.6.8 Patch 2

1. We installed 'Members Who Have Visited' version 4.43. We did this buy going into our AdminCP/Plugins&Products/ManageProducts/AddImportProducts and the item is now showing up in our vBulletin Options lists, right at the bottom. We have turned on 'Run Code on all pages'.

2. We then installed the vBadvanced module, so it shows on our CMPS pages.

3. We've told it to show to every usergroup on our main front page.

4. We weren't too sure what any of this meant, so didn't do any of this, as we didn't think it applied to us. We only want a basic install. '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.'

Unfortunately, we still haven't been able to get the module to show on our homepage.

Has anyone got any ideas????

Thanking you in anticipation.

Tom M
12-09-2007, 07:07 PM
Unfortunately, we still haven't been able to get the module to show on our homepage.

Has anyone got any ideas????

Thanking you in anticipation.
Are you using a custom style? If so, did the templates get loaded into that style?

A link would be helpful as well.

elitemerlin
12-09-2007, 07:09 PM
would there be a way to make it 1 name per line like so

member1
member2
member3

instead like it is now like this

member1 member2
member3 member4 member5
member6

thanks

Tom M
12-09-2007, 08:31 PM
would there be a way to make it 1 name per line like so

member1
member2
member3

instead like it is now like this

member1 member2
member3 member4 member5
member6

thanks
In the todays_users.php add the bit in RED$whotoday = str_replace( "member.php", $vbulletin->options['bburl'] . "/member.php", $whotoday);
$whotoday = str_replace( ", ", "<br />", $whotoday);

grahamsmythe
12-10-2007, 06:02 AM
Are you using a custom style? If so, did the templates get loaded into that style?

A link would be helpful as well.


Yes, we are using a custom style, and as far as I know, it did get loaded, but how would I check?!?!?

Apologies for not giving you the link it is...


www.vincentownersclub.co.uk/forum

Tom M
12-10-2007, 11:12 AM
Yes, we are using a custom style, and as far as I know, it did get loaded, but how would I check?!?!?See if the template adv_portal_active_users is listed in the style. If not, copy it there from wherever it was placed.

Ozzie
05-20-2008, 07:03 AM
Anyone get this to work in vB 3.7.0 and CMPS 3.0.1 yet?

I had it working in 3.6.10 but don't see the module after upgrading the above. The adv_portal_active_users isn't found in either the custom style or the default style so I'm assuming the module didn't import correctly.

Any help would be appreciated. Thanks.

/edit - nevermind. Got it working. It really helps to follow the instructions correctly. :o

MediaHound
06-15-2008, 02:59 AM
Great mod, thank you.

kctalker
11-08-2008, 11:48 AM
All I am getting is a blank block. No error present, but no output either. Is this common and if so how do I fix it?

gogo
11-17-2008, 05:50 AM
I just updated to the 3.8 version of the who was online modand this module stopped working. Anyone knows how to solve this?