The solution to the missing link on the new user link is very simpel.
Just open the default.php from your \extention\statistics page and scroll down to the "function GetUserLink($Username) {" aprox line 192
between the line that says "function GetUserLink($Username) {" and "$USER_TABLE = (isset($this->Context->DatabaseTables['User']))"...... add the following:
$Username=trim($Username);
So your lines should look like:
function GetUserLink($Username) {
$Username=trim($Username);
$USER_TABLE = (isset($this->Context->DatabaseTables['User'])) ? $this->Context->DatabaseTables['User'] : $Context->DatabaseTables['User'];
Bug: username with ' sample ol'chous generate цarning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /.../extensions/Statistics/default.php on line 192
I'm having the same problem. I had to turn the addon off. is there a fix for this? Thanks for your help this is a great addon!
Vincent:
If you bring an update pls dont forget to update the "Version: 0.4.6" in "default.php"
else the update routine will not check that the newest version is installed and will ask anytime to get the latest.
I just updated this extension but it still says 0.4.5 in default.php.
I thought I should let you know
And thanks for "trim()" fix. it took me half an hour to figure out the error in the code. I came here to comment but it was already being discussed.
BTW Thanks for this extension
Hi,
I wanted the statistics to disappear on the settings-page.
My plan:
changing line 293 into "...settings.php"
but: have to change line 305 too - because that enables to change settings through the settings.php if line 293 ist "index.php"
so, for example, delete the "else" of "else if"
By change line 293 into: if ($Context->SelfUrl == "settings.php" or "index.php") {
the statistics will appear on both (or more) pages.
Will try to translate the extention into German - if your interessted contact me.
I was wondering if there is a place where I can reset the information that is shown with this add-on? I installed the forum and added this add-on (together with some others), but now I want to go live. With all my testing and logging in and out, it has obviously now exploded my stats. When I go live, I would like the stats to be clear.
Is there also a what to exclude specific users? I have a test account and also and administrator's account, but I do not what these accounts to be added to the stats.
Thanks and this is a great add-on (as everyone else has also already stated).
Julian.
replace the last two chars "; on the end of line 86 in default.php with
\nusers_in_the_last_24_hours".$GlobalKey."1".$GlobalKey."0".$GlobalKey."0";
add the following line to default.php at line 41
$Context->SetDefinition("Statistic_users_in_the_last_24_hours", "Users Logged on the last 24 hours");
insert the followingline at line 123 to default.php
$this->StatisticsSQL['users_in_the_last_24_hours'] = "SELECT count(*) FROM `".$this->Context->DatabaseTables['User']."` WHERE DATE_SUB(NOW(),INTERVAL 1 DAY) <= ".$this->Context->DatabaseTables['User'].".".$this->Context->DatabaseColumns['User']['DateLastActive'].";";
Still meant to be somewhat accurate? At least linenumbers to insert code are not..
Tested this and all it resulted was losing the total comments count. Appreciated if somebody knows how to add data of Users Logged on the last 24 hours with latest release of Vanilla.
Admin option to show phantom users to selected groups would also be just superb feature. (Supposing that does not exist or am I just missin something?)
Comments
Just open the default.php from your \extention\statistics page and scroll down to the "function GetUserLink($Username) {"
aprox line 192
between the line that says "function GetUserLink($Username) {" and "$USER_TABLE = (isset($this->Context->DatabaseTables['User']))"......
add the following:
$Username=trim($Username);
So your lines should look like:
function GetUserLink($Username) { $Username=trim($Username); $USER_TABLE = (isset($this->Context->DatabaseTables['User'])) ? $this->Context->DatabaseTables['User'] : $Context->DatabaseTables['User'];
This should do the trick.
I'm having the same problem. I had to turn the addon off. is there a fix for this? Thanks for your help this is a great addon!
Posted: Tuesday, 24 June 2008 at 5:02PM
$Username=mysql_escape_string(trim($Username));
I think that will fix the bug with the apostrophe, and the userlink!
Tested this and all it resulted was losing the total comments count. Appreciated if somebody knows how to add data of Users Logged on the last 24 hours with latest release of Vanilla.
Admin option to show phantom users to selected groups would also be just superb feature. (Supposing that does not exist or am I just missin something?)