WordPressで逆アクセスランキングの設置
WordPressに逆アクセスランキングを設置したかった。
ただ、広告が出ないタイプが必要。
プラグインか何かで済ませられないかと探すとドンピシャのがあった。
Sim Access
http://log.noiretaya.com/script/simaccess
「Download simaccess_1.1.1.zip」をダウンロードして解凍後、適当なディレクトリにアップする。
パーミッションを下記の通り変更。
1 2 3 4 5 6 7 8 9 |
simaccess ├ admin ├ class ├ log ( 707 or 777 ) ├ .htaccess ├ access.php ├ access.sqlite ( 606 or 666 ) ├ index.php └ rank.html ( 606 or 666) |
ほんでそのディレクトリのURLを叩くとログイン画面が出るので、
ID:admin
PASS:pass
でログイン。
で、フッターかフッターに解析用のJSタグを埋めておく。
1 2 3 |
<script type="text/javascript"><!-- document.write("<script type=\"text/javascript\" src=\"./simaccess/access.php?referrer=" + document.referrer + "\"></script>"); //src部分は適宜書き換え // --></script> |
アクセスランキングの表示はファイルに直接、
1 |
<?php include("rank.htmlへのパス"); ?> |
と指定してもいいし、
Executable PHP widgetというプラグインを入れて、ウィジェットで呼び出してもいい。
尚、デフォのランキング表示はけっこう質素なので、
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
ol{ counter-reset:number;/* 名前を付けたカウンターをリセット */ list-style:none;/* olが数字を付けることをキャンセル */ margin:0; padding:0; } ol li{ /* リスト部分は好きに装飾! */ } ol li:before{ /* カウンタ(数字になる部分) */ counter-increment: number;/* 任意の名前を付けて! */ content: counter(number);/* 名前を付けたカウンターを呼び出し */ /* 色を変えたり、背景画像を敷いたり!自由自在! */ } |
とか、
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
ol { counter-reset:li; /* Initiate a counter */ padding:0; /* Remove the default left padding */ list-style:none; /* Disable the normal item numbering */ } ol li { position:relative; /* Create a positioning context */ margin:0 0 6px 2em; /* Give each list item a left margin to make room for the numbers */ padding:4px 8px; border-top:2px solid #666; background:#f6f6f6; } ol li:before { content:counter(li); /* Use the counter as content */ counter-increment:li; /* Increment the counter by 1 */ /* Position and style the number */ position:absolute; top:-2px; left:-2em; width:2em; padding:4px 0; border-top:2px solid #666; color:#fff; background:#666; font-weight:bold; font-family:"Helvetica Neue", Arial, sans-serif; text-align:center; } |
とかで装飾するとよろしいかと。
olタグとかよくわかんない、tableタグが良いとかHTMLタグを変更したい場合は「class.access.php」を書き換える。
関連記事
-
-
WordPressのfunctions.phpの初期設定
WordPressのテーマ作成時にfunctions.phpを書くが、いつも内容 ...
-
-
WordPress Popular Postsのサムネイルが表示されない
WordPressの人気記事を表示させるWordPress Popular Po ...
-
-
WordPressでメモリを節約しつつ高速化する設定方法
メモリ1GのVPSを借りてWordpress以外にも、ちょいちょいものを置いてい ...
-
-
WordPressのユーザー画像とプロフィール
WordPressでユーザー毎に画像とプロフィール部分にHTMLタグを登録したか ...
-
-
WordPressで動画(mp4)ファイルの再生
WordPressでyoutube等の動画サイトの埋め込みタグではなく、mp4フ ...
-
-
WordPressを停止しないままサーバ移設する方法
WordPressを設置しているサーバのリソースがそろそろ危ういので移設を検討す ...
-
-
WordPressのメール送信フォームに画像認証を設置する
■やりたかった事 ココで作成したメール送信フォームに画像認証を設置する ■方法 ...
-
-
WordPressで固定ページに記事一覧を表示させるプラグイン
WordPressで固定ページ編集時にショートコードを書くことで、記事一覧を表示 ...
-
-
ACFでセレクトメニューを動的に生成
WordPressでカスタムフィールド設定用のプラグインAdvanced Cus ...
-
-
WordPressでカスタムフィールドとCSVファイル投稿
WordPressでカスタムフィールド設定している環境に、CSVファイルアップロ ...