TotalCounter-Archive
TotalCounter Archive
Old, archived discussions about TotalCounter
Great recipe! I wonder if it's possible to have a referrer statistic per page in order to find out which page is accessed by which other page within the wiki? (I admit that this might not fit the original design philosophy of "counting totals" :-) --Henning December 28, 2005, at 05:32 AM
Thanks for the answer! Though I do indeed have some (not very smooth) way of accessing the logs, an integrated tool that keeps tracks of everything without postprocessing overhead would of course hold considerable attraction. However, I don't think that it would be a good idea to turn an elegant tool into a complex kludge for that purpose! :-/ --Henning December 30, 2005, at 04:30 AM
I admit that I had thought of the administrator's overhead and not of the system's, but of course you have a very good point there! --Henning January 03, 2006, at 05:27 AM
In order for users to work UserAuth should be installed. AuthUser doesn't work.Additionally, you may have to set:
$TotalCounterBlacklist[Pages]=array("");
$TotalCounterBlacklist[Users]=array("");
$TotalCounterBlacklist[Referers]=array("");
?totalcounter
page will display some errors until a webbot searches your site.Warning: Invalid argument supplied for foreach() in cookbook/totalcounter.php on line 224
Warning: Invalid argument supplied for foreach() in cookbook/totalcounter.php on line 237
Warning: Invalid argument supplied for foreach() in cookbook/totalcounter.php on line 251
$TotalCounterBlacklist[Pages]=array(""); $TotalCounterBlacklist[Users]=array(""); $TotalCounterBlacklist[Referers]=array(""); include_once('cookbook/totalcounter.php');
Blues January 05, 2006, at 08:32 AM
Markup('','<','/\\{\\$PageCount\\}/e',$PageCount);
Markup('','<','/\\{\\$TotalCount\\}/e',$TotalCount);
Blues January 17, 2006, at 07:52 AM
- Locations are only recognized correctly, if the TLD is in lower case. We get a lot of hits that are resolved as .DE (instead of .de) which are then classified as "unknwon". Perhaps an i-Modifier should be added to the host-matching regex.
tthelen January 28, 2006
- I will correct this problem and release a new version soon. Thanks for pointing it out.
Blues January 30, 2006, at 02:57 AM
- New version (1.3) corrects this problem.
Blues January 30, 2006, at 04:23 AM
- We encountered problems when using totalcounter for a wiki farm and some fields use a different
$DefaultGroup
than the farm's default. Since totalcounter.php sets$pagename
if it's not set, you must alter your farmconfig to ensure that totalcounter.php is included after the field's config. Example from our farmconfig.php:$EnableLocalConfig
=0; # turn off auto-loading field config after farmconfig## include field config here
if (file_exists('local/config.php')) include_once('local/config.php');
elseif (file_exists('config.php'))include_once('config.php');
# now do farm config that overrides local settings or has to be performed after local config
include_once("
$FarmD
/cookbook/totalcounter.php");
tthelen January 26, 2006
- Thanks for reporting this, I added a note above in the Notes section and in the Configuration section.
Blues January 26, 2006, at 06:22 AM
- Although it seems to work perfectly on my local home copy, as soon as I set it on my provider (free.fr) system I cannot access my pmwiki farm anymore (any page). My home system runs under windows while the other runs under Linux. Is there some specific file access rights issue?
Philippe January 23, 2006
- What means you can't access the pages anymore? Does it display any error? Or they are just blank? The recipe uses only one file in the
wiki.d
directory: the file is.total.counter
. Since the directory already has write permissions there shouldn't be problems... give a look anyway, and please let me know.
Philippe January 23, 2006, at 08:30 PM
- The first call successfully creates the lock file but cannot delete it because of file permissions, so the next calls find it still locked and don't continue... It looks like in your system the files are created with wrong permissions, I'll see how to correct it.
Blues January 24, 2006, at 03:04 AM
- I think I found the problem, please download the new version (1.2) and let me know if it works OK.
Blues January 24, 2006, at 03:38 AM
Philippe January 23, 2006, at 08:30 PM
- With the new version (1.2) how are the permissions in the created files? It should be 777 for the lock directory and 666 for the .total.counter file.
Blues January 25, 2006, at 02:36 AM
Philippe January 25, 2006, at 11:16 PM
- Yes I've read that but the new version should create the files with correct permissions. If it is still wrong I will try with another approach...
Blues January 26, 2006, at 03:00 AM
- Let's try this new version: now it should use the same permissions that PmWiki uses for its own pages.
Blues January 26, 2006, at 03:07 AM
Philippe January 27, 2006, at 09:16 PM
Philippe January 28, 2006, at 09:05 AM
unlink($lock)
instead of rmdir($lock)
,and
touch($lock)
instead of mkdir($lock)
I tried on Free.fr, it works for me (changes made on v1.2b)
Emmanuel January 28, 2006, at 10:11PM (UTC)
- Emmanuel is correct, with a file lock it will work. The reason that the script uses a directory instead than a file is that the function mkdir() is atomic (meaning that it is executed in one step and can't be interrupted), while theoretically the file creation could be interrupted and two different scripts could acquire the lock. Now, seeing the problems, I guess we can accept the risk and change it to create a file for lock. I will release a new version soon.
Blues January 30, 2006, at 02:57 AM
- New version (1.3) should now work correctly.
Blues January 30, 2006, at 04:23 AM
Emmanuel January 30, 2006, at 10:30AM (UTC)
- Yes you are correct, I re-uploaded it, sorry. For the discussion about the atomicity of the lock functions give a look at http://www.php.net/manual/en/function.flock.php
Blues January 30, 2006, at 09:10 AM
Philippe February 03, 2006, at 09:39 PM