[pmwiki-users] New Cookbook : CurrentVisitors

Ben Wilson ameen at dausha.net
Mon Aug 1 13:10:02 CDT 2005


Right, just as a bit of useless chiming-in documentation: SDV() will write a
value to a given variable _only if_ the variable has no value. Thus, if the
admin sets the variable in his local/config.php, it will not be inadvertantly
overwritten by the recipe.

Regards,
Ben

Quoting Daniel Scheibler <scheibi at gmail.com>:

> Hi Christophe,
>
> the script looks nice.
> I have only one hint to you:
> use
> SDV($MaximumNumberOfSecondsToConsiderAVisitorAsCurrent, 1800);
> SDV($CurrentVisitorsDirectory, $WorkDir . '/' . 'CurrentVisitors');
>
> instead of
> $MaximumNumberOfSecondsToConsiderAVisitorAsCurrent = 1800;
> $CurrentVisitorsDirectory                          = $WorkDir . '/' .
> 'CurrentVisitors';
>
> so a user could change the values in local/config.php before
>   include_once('cookbook/CurrentVisitors.php');
>
> Greets,
>
> scheiby
> --
> Daniel Scheibler     ========:}       student at
> eMail: scheibi at gmail.com              BTU Cottbus/Germany
> WWW:   http://www.scheiby.de
>
> 2005/8/1, Christophe David <pmwiki at christophedavid.org>:
>>
>> http://www.pmwiki.org/wiki/Cookbook/CurrentVisitors
>>
>> Question
>>
>> Can I know how many visitors are currently surfing on my site ?
>>
>> Answer
>>
>> Copy CurrentVisitors.php&#916; to the cookbook directory and add
>> include_once("local/CurrentVisitors.php"); to config.php.
>>
>> Notes and Comments
>>
>> In your wiki pages, add the markup (:CurrentVisitors:) to display the
>> number of visitors (strictly speaking "different IP addresses") that came
>> to your site during the last
>> $MaximumNumberOfSecondsToConsiderAVisitorAsCurrent .
>>
>> The counter will update only when action=browse.
>>
>>     * This recipe was last tested on PmWiki version: 2.0 beta 52
>>     * This recipe requires at least PmWiki version: 2.0
>>
>> Comments and suggestions welcome.
>>
>> Christophe
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://host.pmichaud.com/mailman/listinfo/pmwiki-users
>



-- 
Regards,
Ben Wilson

"Mundus vult decipi, ergo decipiatur"





More information about the pmwiki-users mailing list