Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Another Members that have Visited Statistics mod Details »»
Another Members that have Visited Statistics mod
Version: 1.0.2, by Marco van Herwaarden Marco van Herwaarden is offline
Developer Last Online: Dec 2010 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 3.6.2 Rating:
Released: 01-01-2007 Last Update: 01-18-2007 Installs: 39
Uses Plugins Template Edits
Additional Files  
No support by the author.

This modification will make it possible to show statistics on the number of members that have visited. There are other modifications of this type, this one is however aimed at busy boards and written with performance in mind. Statistics are not real-time, but by default updated every 10 minutes by a cron.

Features:
- No extra queries on Forum Homepage
- 3 Timespans settible to show statistics for
- Optional show the membernames that have visited during the first timespan
- Information is collected by Scheduled Task to prevent processing on Forum Home
- Optional use filesystem caching
- Plus more optional settings
- This modifcation will not list the names of Members that are set to Invisible!

Please note that this is not marked as supported, as i don't have much time for that.

Changelog:
2007-01-19: v1.0.2
- Warning: implode() [function.implode]: Bad arguments. in /includes/cron/mh_mv_stats.php on line 144
This is caused by a changed behaviour between MySQL 4.1 and 5.x.
Changed:
AND NOT options & 512
To:
AND NOT (options & 512)
2007-01-02: v1.0.1
- Initial release

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 01-19-2007, 02:52 AM
sportsoutlaw sportsoutlaw is offline
 
Join Date: Nov 2004
Location: Texas
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Steve B View Post
Just tried this and I am getting the following error when the cron is run..



line 144 reads
Code:
,    '" . $vbulletin->db->escape_string(implode(", ", $names_a_short)) . "'
I have tried it with both the database writing and also the file writing with the same error.

Any ideas please?
Quote:
Originally Posted by Al-Fateh View Post
I installed the mod, however the members names who actually keep visiting the site are not shown on the list...

is there something wrong?
I have both of these issues.

php 4.4.4
Set to 200 members, which is lower than what I actually would have.
Reply With Quote
  #23  
Old 01-19-2007, 03:57 AM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Steve B View Post
line 144 reads
PHP Code:
,    '" . $vbulletin->db->escape_string(implode(", ", $names_a_short)) . "' 
I have tried it with both the database writing and also the file writing with the same error.

Any ideas please?
Quote:
Originally Posted by sportsoutlaw View Post
I have both of these issues.
I don't have this mod installed, but by the looks of line 144, it could be causing both.

Try changing line 144 to:
PHP Code:
,    '" . $db->escape_string(implode(", ", $names_a_short)) . "' 
If what I say below is true, then this shouldn't change much, except make your code cleaner.

Quote:
Originally Posted by Steve B View Post
Test site with closed access apart from 4 mods: its showing no names at all, but under Members Visited Statistics: Last 24 Hours: 1 - Last 7 Days: 2 - Last 30 Days: 4 which seems to be right?
This would result in you having only 1 value for $names_a_short which either wouldn't count as an array (but you would get the error 'supplied argument is not an array') OR implode() just wouldn't be happy imploding less than 2 pieces. There is nothing in the php.net documentation about this, though, so it might not be the issue. Just a thought.

In any case, is there a check to do the following?
PHP Code:
if (count($names_a_short) < 2)
{
     
// no commas necessary
     
$whatever_the_string_is $db->escape_string($names_a_short);

EDIT: Having downloaded the code, and looking at it, the problem seems to be at line 82:
PHP Code:
        $names_a_short $names_a_short[0]; 
Looking back at line 81, we see that $names_a_short[0] is in fact from an array, multi-dimensional thanks to array_chunk():
PHP Code:
        $names_a_short = (intval($vbulletin->options['mh_mv_max_forumhome']) == ? array($names_a) : array_chunk($names_aintval($vbulletin->options['mh_mv_max_forumhome']))); 
The array $names_a_short is formed from whatever $names_a is. The most recent definition of $names_a is line 73, where it is compressed to a single-level array:
PHP Code:
        $names_a["$name[username]"] = $names_a["$name[username]"]['username']; 
Thus, even though my logic makes no sense, this error makes no sense. Line 82 turns record 0 of the multi-level array not into another array, but into a string "Array". And we cannot implode a string...

Comment out line 82 and change line 144 to:
PHP Code:
,    '" . $db->escape_string(implode(", ", $names_a_short[0])) . "' 
OR

Change line 82 to:
PHP Code:
        $names_a_short array_merge($names_a_short[0]); 
Reply With Quote
  #24  
Old 01-19-2007, 07:24 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Al-Fateh View Post
I installed the mod, however the members names who actually keep visiting the site are not shown on the list...

is there something wrong?
make sure you have set the member names to show in the vBulletin Options, and that the Scheduled Task has ran since you turned on showing membernames.
Reply With Quote
  #25  
Old 01-19-2007, 08:33 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Version 1.0.2 released to fix a bug with MySQL 4.x

Changelog:
2007-01-19: v1.0.2
- Warning: implode() [function.implode]: Bad arguments. in /includes/cron/mh_mv_stats.php on line 144
This is caused by a changed behaviour between MySQL 4.1 and 5.x.
Changed:
AND NOT options & 512
To:
AND NOT (options & 512)
Reply With Quote
  #26  
Old 01-19-2007, 08:36 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Warning: implode() [function.implode]: Bad arguments. in /includes/cron/mh_mv_stats.php on line 144
As per my previous post, this was caused by a change in behaviour between MySQL 4.x (tested on 4.1.21) and 5.x (development was done on 5.0). The WHERE-clause that should filter members that are set to invisible was causing the query to return no results with MySQL 4.1.21.

Adding () around the condition solved the problem. Also added test to avoid errors if no members returned.
Reply With Quote
  #27  
Old 01-19-2007, 12:58 PM
Steve B Steve B is offline
 
Join Date: Jul 2005
Location: Munich
Posts: 18
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you for taking the time to fix this.

Its now installed on our live site and working well
Reply With Quote
  #28  
Old 01-19-2007, 01:07 PM
sportsoutlaw sportsoutlaw is offline
 
Join Date: Nov 2004
Location: Texas
Posts: 159
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thanks Marco, it seems to be working perfectly for me now.
Reply With Quote
  #29  
Old 01-19-2007, 01:15 PM
Al-Fateh Al-Fateh is offline
 
Join Date: Apr 2006
Posts: 57
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

working great now!!!
Reply With Quote
  #30  
Old 01-19-2007, 03:09 PM
thincom2000 thincom2000 is offline
 
Join Date: May 2006
Location: Bronx, NY
Posts: 1,205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Haha, or caused by $db->num_rows($names_a_short) < 1

That could work too. Glad you worked it out.
Reply With Quote
  #31  
Old 03-06-2007, 06:26 PM
PinkDaisy's Avatar
PinkDaisy PinkDaisy is offline
 
Join Date: Sep 2006
Posts: 274
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This isn't showing at all for me, I did all the instructions on installing. ???
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 07:51 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07175 seconds
  • Memory Usage 2,328KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)bbcode_code
  • (8)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete