Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 11:52 pm EST

Geeklog Forums

Visitor Stats 1.3


Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
hopeful
Here goes -- I am releasing the updated Visitor Stats Plugin. Here is a summary of the changes: -- Added indexes to speed up queries (on sites with large databases or slow server you may get a time out here -- if that happens use the update.sql to complete the update). -- Modified index page to limit number of months displayed $_ST_months controls the number of months -- Modified day page to limit number of days displayed $_ST_days controls the number of days -- Modified so that a Geeklog install in a subdirectory works correctly $_ST_sub should be set to the sub-directory -- Made page by request that shows most popular pages and most active users per day and month. Note: it is not accessible through any link you must access it directly stats/popular.php. -- Added preliminary referer page which summarizes refers by host so that e.g. all the google.com are seen together. From here you can drill down to see the detail. -- Fixed permissions -- Fixed user totals -- Updated WhosOnline block to respect user perference for showing name. -- Added several configuration variables to control display of Who\'s Online block -- see config.php for details. -- Added page ignore like ip and user ignore list. -- Added the ability to put in a partial ip and have stats ignore all that match that partial. e.g. You can enter \'192.168.\' and it will ignore all ips that begin with these two numbers. -- Included several sql files to perform maintenance tasks. (These sql commands take to long on a busy site to be handled by php and thus must be executed manually by the admin using the source command). All the sql files have gl_ hardcoded as the table prefix. If yours is different then you must change this. ---- bot.sql can be used to clean you database of common bot accesses. ---- ignore.sql inserts these bot ips into your ignore list. Together these two can get rid of google, et all from you database. note: It would be good for the community to add to this list by posting new ips as they are found. ---- jan.sql thru dec.sql simply deletes that particular month from you database when it begins to get too big. ---- stats.sql and upgrade.sql are the sql to create the database or upgrade it. -- Added caching of the queries to further speed things up. This is controlled by the $_ST_cache variable. It requires that the cache subdirectory in the public_html/stats directory be writable by the webserver. You can get it from Sourceforge. Hope it works well for you. TomW
 Quote

Status: offline

Ectropian

Forum User
Chatty
Registered: 06/19/02
Posts: 61
Wow, you said a mouthfull Tom Mr. Green Installing now.. glad to see progress, no matter how small Smile thanks for the upgrade.
--Ted(Ectropian)
 Quote

Status: offline

Agent X20

Forum User
Junior
Registered: 06/11/03
Posts: 27
I\'ve just finished installing the new version.

It makes a huge difference to the page rendering time. I\'ve not yet looked through the detailed stats yet to get a feel for what\'s changed in there although the caching looks very promising!

Anyway I wanted to point out a wee problem.

/admin/plugins/vstats/index.php

is throwing the following error:

Warning: Invalid argument supplied for foreach() in /www/admin/plugins/vstats/index.php on line 159

159 is where it\'s trying to render the _ST_PAGE_IGNORE array. I don\'t have any pages to be ignored yet (although I do have one ip and one user to ignore) and the _ST_PAGE_IGNORE array is null. Subsequently when I try to add a page to be ignored then the problem repeats itself because _ST_PAGE_IGNORE is still NULL and rejects the array_push() call.

I must admit I can\'t see where you populate any of the three main arrays for this page in the default case when the page is first rendered so I can\'t really offer any more help... (and I\'m not gonna learn the plugin API just this minute!) In fact I can\'t see a SELECT statement anywhere!?!

I hope this is useful.

Nice work with the speed and the new features.
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
Looks to me like you did not get the functions.inc replaced. It is at the beginning of this file that the array is created and filled. TomW
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
For some reason people think that the stats pages are exactly the same as in previous versions. They are not! There are three pages that are different you should note (I have been asked repeatedly about them). 1) The admin page now has the pages to ignore along with the ips and users. 2) The page showing each day is not paged. By default it will only show 16 days at a time. You can change this in the config.php file. 3) The referer page now shows a summary of each referer. Click on the number of refererals to see the detailed list of each referal. And read the two files about database maintenance and the sql files that are included. You will miss a lot of the benefit of the changes if you don\'t. Look at the config.php. I have more than doubled the configuration options there. You can tweak a lot of things, especially the Stats Block. TomW
 Quote

Status: offline

Agent X20

Forum User
Junior
Registered: 06/11/03
Posts: 27
Quote by tomw: Looks to me like you did not get the functions.inc replaced. It is at the beginning of this file that the array is created and filled. TomW
I\'ve double checked functions.inc (in my case the \'modified\' version due to renaming package vstats) and it looks correct ie it is the one from the new version. However there\'s no _ST_PAGE_IGNORE array. I grep\'d the code before I posted my inital message to make sure I wasn\'t missing anything. I\'ve spotted the problem: functions.inc /////////////////////////////////////////////////////////////////// /// Set up config variables and call to add stats to database // ///////////////////////////////////////////////////////////////// $_ST_IP_IGNORE=array(); $_ST_USER_IGNORE=array(); $_ST_PAGE_IGNORE=array(); $_ST_VARS=array(); setup_stats(); however functions.inc-MODIFY has: /////////////////////////////////////////////////////////////////// /// Set up config variables and call to add stats to database // ///////////////////////////////////////////////////////////////// $_ST_IP_IGNORE=array(); $_ST_USER_IGNORE=array(); $_ST_VARS=array(); setup_stats(); Pasting the missing line in fixes the problem and admin/index.php works correctly.
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
Yep you are correct. I did not get that into the MODIFY version of the functions.inc. Thanks for finding that for me. Fixed it now. TomW
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Tom, getting the following errors when i try to sign in/out Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 735 Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 737 Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/system/lib-sessions.php on line 310 Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 903 Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 906 Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 934 any suggestions?
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
See if an extra newline got added after the close in config.php. I have had another report of this, though it is not in my copy. Must be the archivers. TomW
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
i'm assuming this is in plugins/stats/config.php. no extra new lines... Confused Reinstalling the entire plugin ? I did do an upgrade, not a new install... I must say it went VERY smooth... Also, the error is complaining about the english.php file... 130 'cleanmsg' => 'Clean Database of IPs above' 131 ); 132 133 ?> ---- No extra lines ----- The error: Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 687 Warning: Cannot modify header information - headers already sent by (output started at /home/okanagan/plugins/stats/language/english.php:133) in /home/okanagan/public_html/users.php on line 689 Lines 686 -> 690 of users.php:
Text Formatted Code
$_CONF['cookie_path'], $_CONF['cookiedomain'],
$_CONF['cookiesecure']);
setcookie ($_CONF['cookie_name'], '', time() - 10000, $_CONF['cookie_path'],
$_CONF['cookiedomain'], $_CONF['cookiesecure']);
$display = COM_refresh($_CONF['site_url'] . '/index.php?msg=8');

-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
I spoke wrong, it was the english.php that had the extra line. TomW
 Quote

Adrian

Anonymous
OK, I upgraded from Visitor Stats 1.2 by replacing all the files and when I tried to run upgrade.php, I just got this message: 1054: Unknown column 'showonline' in 'field list' Now no page of my site will load, I just get that message. PLEASE can someone tell me what has gone wrong here? I am trying not to panic. Thanks, Adrian
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
Let me guess, you did not disable the stats plugin before the upgrade and/or you are running an older version of geeklog. The showonline field is new to Geeklog 1.3.8 and it is only used in the stats block. You might try to set the stats config variable $_ST_online to false. This will show all users as anonymous but should let your site function. The new version of Stats was designed for 1.3.8 and following. TomW
 Quote

Adrian

Anonymous
Well you're right, I am not running 1.3.8 and your fix did work. I guess I will spend part of today upgrading to 1.3.8 so I can run your new stats package properly. For some reason I thought I read somewhere that it would work OK on previous versions. Must have been some other plugin I was looking at last night. Damn. Thanks for your quick help, Tom. And now you can ignore the panicked email I sent you. Adrian
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Tom... i\'m still getting the overall slowness of the stats plugin... when enabled pages take anywhere from 2-20 seconds.. disabled its .05-2 seconds. any suggestions...? (other than not using it)
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

Status: offline

tomw

Forum User
Full Member
Registered: 08/12/02
Posts: 300
You can speed up your site by reducing the size of you gl_userstats table. How you do this depends on what you want. Lets assume that you want the stats plugin to run and you want to keep your history. The best of both worlds. Here is what you would do. Back up your database or at least your gl_userstats table before trying this unless you are confident of your sql abilities. 1) Enable caching. Create the cache directory and set the config variable. 2) Invoke the stats plugin and look at every page on the earliest month that you want to keep which can be quit a few. Looking at the pages will put them in the cache. 3) However you do it delete the records from the gl_userstats table which correspond to that month. Here is the sql I would use: delete from gl_userstats where year=\'your year\' and monthn = Number of month; 4) Insert a dummy record in stats for that month to hold the place. Again here is the sql: insert into gl_userstats set ip=\'0.0.0.0\', host=\'0.0.0.0\', month = \'Short name of month\', monthn=number of month, year=\'year\', page=\'index.php\', date=\'date\'; form of last date is yyyymmdd. 5) Do it again for next month. 6) When you are all through you should run the optimize table command to reclaim space and speed up the database. You may ask why I did not make something like this available in the admin interface. Its simple. On a moderate to large database some of these commands can take several minutes and a php page would time out long before they completed. On a similar note: do this maintenance at a time when your site is slow, because it can really slow things down. If that don\'t speed it up, then don\'t use the plugin. TomW
 Quote

Status: offline

destr0yr

Forum User
Full Member
Registered: 07/06/02
Posts: 324
Sorry for being such a PITA. The instructions you posted are great. The site is loading fast with the plugin enabled. Thanks. Mr. Green
-- destr0yr
"I love deadlines. I like the whooshing sound they make as they fly by." -- Douglas Adams
 Quote

All times are EST. The time is now 11:52 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content