Difference: RecentVisitorPluginTest (1 vs. 2)

Revision 217 Oct 2017 - TomCrane1

Line: 1 to 1
 

RecentVisitorPlugin

Revision 117 Oct 2017 - TomCrane1

Line: 1 to 1
Added:
>
>

RecentVisitorPlugin

<--
   Contributions to this plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/RecentVisitorPlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/RecentVisitorPluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.
-->
This plugin is
sponsored by:
Twiki, Inc.
Show statistics of recent visitors to the TWiki site

Introduction

This plugin shows statistics of recent visitors to a TWiki site. The time of last visit and the IP address used can be shown of individual users. The recent report shows latest visitors in chronological order.

Syntax Rules

Recent visit of an individual

%RECENTVISITOR{ action="user" ... }%

Parameter Description Default
"user" or
action="user"
Show statistics of individual user. (none)
name="..." WikiName of person (current user)
format="..." Format of report. Supported tokens:
$date - date of last visit
$time - time of last visit (GMT)
$ago - how long ago
3.238.96.184 - IP address (only shown to non-administrators if enabled in configure)
$n, $nop, $quot, $percnt, $dollar - standard FormatTokens
"Last seen $ago ago"
notfound="..." Message shown if user is not found. "Never seen"

Report of recent visitors

%RECENTVISITOR{ action="recent" ... }%

Parameter Description Default
"recent" or
action="recent"
Show statistics of most recent visitors. (none)
format="..." Format of each line of the report. Supported tokens:
$username - login name of user
$wikiname - WikiName of user
$wikusername - WikiName prefixed with Public web name
$date - date of last visit
$time - time of last visit (GMT)
$ago - how long ago
3.238.96.184 - IP address (only shown to non-administrators if enabled in configure)
$n, $nop, $quot, $percnt, $dollar - standard FormatTokens
"   * $wikiusername
      last seen $ago ago"
separator="..." Separator between lines. Standard FormatTokens are expanded. "$n" (newline)
limit="..." Limit the number of lines. "10"

See also VarRECENTVISITOR documentation for TWikiVariables.

Examples

Example: Show most recent visit of TWikiAdminUser

You type You get (if installed) Simulated example
%RECENTVISITOR{
 action="user"
 name="TWikiAdminUser"
 format="Last seen $ago ago ($date 
$time)"
}%
Last seen 104 months ago (2012-10-03 18:15) Last seen 3 weeks ago (2011-02-03 06:22)

Example: Show recent visitors, default bullet list report

You type You get (if installed) Simulated example
%RECENTVISITOR{
 action="recent"
 limit="5"
}%

Example: Show recent visitors, table report

You type You get (if installed) Simulated example
%RECENTVISITOR{
 action="recent"
 format="| $wikiusername | $date |"
 limit="5"
}%
OwenHilton 2021-05-07
AntonioPerezFernandez1 2021-05-07
TomCraneAdmin 2021-05-07
AndrewCasey 2021-05-07
SamHill 2021-05-05

NielsBohr 2011-02-03
KlausFuchs 2011-02-03
AlbertEinstein 2011-02-02
EnricoFermi 2011-01-19
DavidBohm 2010-11-27

Example: Show recent visitors with geolocation

This example uses the TWiki:Plugins.GeoLookupPlugin to resolve IP addresses to geolocations.

You type You get (if installed) Simulated example
| *Name* | *Last seen* | *Where* |
%RECENTVISITOR{
 action="recent"
 limit="5"
 format="| $wikiusername | $ago ago
 | $percntGEOLOOKUP{%REMOTE_ADDR%}$percnt |"
}%
Name Last seen Where
OwenHilton 1 day ago , , USA
AntonioPerezFernandez1 1 day ago , , USA
TomCraneAdmin 1 day ago , , USA
AndrewCasey 1 day ago , , USA
SamHill 3 days ago , , USA

Name Last seen Where
NielsBohr moments ago Oak Ridge, TN, USA
KlausFuchs 3 hours ago Cupertino, CA, USA
AlbertEinstein 1 day ago Oak Ridge, TN, USA
EnricoFermi 15 days ago Los Alamos, TN, USA
DavidBohm 2 month ago Los Alamos, NM, USA

Plugin Installation & Configuration

Note: You do not need to install anything on the browser to use this plugin. The following instructions are for the administrator who installs the plugin on the TWiki server.

  • For an automated installation, run the configure script and follow "Find More Extensions" in the in the Extensions section.

  • Or, follow these manual installation steps:
    • Download the ZIP file from the Plugins home (see below).
    • Unzip RecentVisitorPluginTest.zip in your twiki installation directory. Content:
      File: Description:
      <-- -->
      Sorted ascending
      lib/TWiki/Plugins/RecentVisitorPluginTest.pm Plugin Perl module
      data/TWiki/RecentVisitorPluginTest.txt Plugin topic
    • Set the ownership of the extracted directories and files to the webserver user.
    • Install the dependencies (if any).

  • Plugin configuration and testing:
    • Run the configure script and enable the plugin in the Plugins section.
    • Configure additional plugin settings in the Extensions section if needed:
      $TWiki::cfg{Plugins}{RecentVisitorPlugin}{Debug} = 0;      # debug flag, 0 or 1
      $TWiki::cfg{Plugins}{RecentVisitorPlugin}{ShowIP} = 0;     # show IP address, 0 or 1
      $TWiki::cfg{Plugins}{RecentVisitorPlugin}{OnlyAdmins} = 0; # show reports to administrators only, 0 or 1
    • Test if the installation was successful: See example above.

Plugin Info

  • One line description, is shown in the TextFormattingRules topic:
    • Set SHORTDESCRIPTION = Show statistics of recent visitors to the TWiki site

Plugin Author: TWiki:Main.PeterThoeny, Twiki, Inc.
Copyright: © 2011 TWiki:Main.PeterThoeny
© 2011 TWiki:TWiki.TWikiContributor
License: GPL (GNU General Public License)
Plugin Version: 2011-06-06
Change History:
<-- versions below in reverse order -->
 
2011-06-06: TWikibug:Item6725: Plugins: Change global package variables from "use vars" to "our" -- TWiki:Main.PeterThoeny
2011-05-14: TWikibug:Item6701: Small fix in Config.spec -- TWiki:Main.PeterThoeny
2011-05-01: TWikibug:Item6701: Fix small warning issue if plugin is run by a shell script
2011-02-03: TWikibug:Item6646: Initial version
TWiki Dependency: $TWiki::Plugins::VERSION 1.1
CPAN Dependencies: none
Other Dependencies: none
Perl Version: 5.005
TWiki:Plugins.Benchmark: GoodStyle nn%, FormattedSearch nn%, RecentVisitorPluginTest nn%
Plugin Home: http://TWiki.org/cgi-bin/view/Plugins/RecentVisitorPlugin
Feedback: http://TWiki.org/cgi-bin/view/Plugins/RecentVisitorPluginDev
Appraisal: http://TWiki.org/cgi-bin/view/Plugins/RecentVisitorPluginAppraisal

Related Topics: VarRECENTVISITOR, TWikiPlugins, DeveloperDocumentationCategory, AdminDocumentationCategory, TWikiPreferences

META FILEATTACHMENT attachment="twiki-logo-80x40-t.gif" attr="h" comment="" date="1296756257" name="twiki-logo-80x40-t.gif" path="twiki-logo-80x40-t.gif" size="1999" user="TWikiContributor" version="1"
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 1999-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding RHUL Physics Department TWiki? Send feedback
Note: Please contribute updates to this topic on TWiki.org at TWiki:TWiki.RecentVisitorPluginTest.