2 rcs_id('$Id: RecentReferrers.php,v 1.2 2004-11-07 18:34:29 rurban Exp $');
5 * Analyze our ACCESS_LOG
9 include_once("lib/PageList.php");
11 class WikiPlugin_RecentReferrers extends WikiPlugin
14 return _("RecentReferrers");
17 function getVersion() {
18 return preg_replace("/[Revision: $]/", '',
22 function getDefaultArguments() {
25 PageList::supportedArgs(),
33 function run($dbi, $argstr, &$request, $basepage) {
34 if (!ACCESS_LOG) return;
35 $args = $this->getArgs($argstr, $request);
36 $table = HTML::table(array('cellpadding' => 1,
39 'class' => 'pagelist'));
40 if (!$args['noheader'] and !empty($args['caption']))
41 $table->pushContent(HTML::caption(array('align'=>'top'), $args['caption']));
43 $limit = $args['limit'];
44 $accesslog =& $request->_accesslog;
45 if ($logiter = $accesslog->get_referer($limit, "external_only")
46 and $logiter->count()) {
47 $table->pushContent(HTML::tr(HTML::th("Target"),HTML::th("Referrer"),
48 HTML::th("Host"),HTML::th("Date")));
49 while($logentry = $logiter->next()) {
50 $table->pushContent(HTML::tr(HTML::td($logentry['request']),
51 HTML::td($logentry['referer']),
52 HTML::td($logentry['host']),
53 HTML::td($logentry['time'])
61 // $Log: not supported by cvs2svn $
62 // Revision 1.1 2004/11/06 04:52:29 rurban
63 // simple version at first
66 // (c-file-style: "gnu")
71 // c-hanging-comment-ender-p: nil
72 // indent-tabs-mode: nil