====== 記事アクセスランキング ====== monobookプラグインで、PageViewCountでカウントしたデータに基づいて、アクセスランキングを表示。 * ファイルが存在しないものはランキングから外します。 * アクセス権がないものもランキングから外します。 - lib/tpl/monobook/do_ranking.phpを作成。

アクセスランキング

id; if (!$itemid) {continue;} if (isHiddenPage($itemid) || auth_quickaclcheck($itemid) < AUTH_READ) {continue;} if (!file_exists(wikiFN($itemid))) {@mysql_query("DELETE FROM $pvc_table WHERE id='$itemid'");continue;} $views = $row->views; $permanent = DOKU_URL.$itemid; print '\n"; $num++; } } } ?>
#タイトル閲覧数
'.$num.''; tpl_pagetitle($itemid,$ret); print ''.$views."
※UTF-8で保存。 - lib/tpl/monobook/main.phpにリンクを追加。 else if ($_REQUEST['mbdo'] == 'media') @include(dirname(__FILE__).'/do_media.php'); の後ろに else if ($_REQUEST['mbdo'] == 'ranking') @include(dirname(__FILE__).'/do_ranking.php'); を追加。 - lib/tpl/monobook/user/pref.phpにツールボックスの項目を追加 $monobook['toolbox']['ranking']['href'] = DOKU_BASE."doku.php?mbdo=ranking"; $monobook['toolbox']['ranking']['text'] = 'アクセスランキング'; $monobook['toolbox']['ranking']['rel'] = "nofollow"; ※UTF-8で保存。