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) {
35 return HTML::div(array('class' => "error"), "Error: no ACCESS_LOG");
37 $args = $this->getArgs($argstr, $request);
38 $table = HTML::table(array('cellpadding' => 1,
41 'class' => 'pagelist'));
42 if (!$args['noheader'] and !empty($args['caption']))
43 $table->pushContent(HTML::caption(array('align'=>'top'), $args['caption']));
45 $limit = $args['limit'];
46 $accesslog =& $request->_accesslog;
47 if ($logiter = $accesslog->get_referer($limit, "external_only")
48 and $logiter->count()) {
49 $table->pushContent(HTML::tr(HTML::th("Target"),HTML::th("Referrer"),
50 HTML::th("Host"),HTML::th("Date")));
51 while($logentry = $logiter->next()) {
52 $table->pushContent(HTML::tr(HTML::td($logentry['request']),
53 HTML::td($logentry['referer']),
54 HTML::td($logentry['host']),
55 HTML::td($logentry['time'])
63 // (c-file-style: "gnu")
68 // c-hanging-comment-ender-p: nil
69 // indent-tabs-mode: nil