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.
If what I say below is true, then this shouldn't change much, except make your code cleaner.
Quote:
Originally Posted by Steve B
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():
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:
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...
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)
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.