January 19,2005

[WP]新增WP外掛-Wp-Dstats2

這個外掛的資訊是從hsuyo BLOG看來的(大感謝)

個人覺得這個外掛真的是非常 powerful,可以列出很多資訊,相較於之前申請的免費訪客資訊的服務,顯然我是比較喜歡自己動手裝起來的東西啦!

Wp-Dstats2的功能可以看這裡,右下角的訪客資訊也是這個外掛的功勞,我看他的程式碼除了可以顯示今/昨天和在右下角看的的資訊,另外還可以顯示這個月和上個月的,希望自己的WP有這些功能而又喜歡自己打造的朋友可以試試看了。

下面是我的安裝筆記(僅是為自己做個紀錄,內容的教學可以看hsuyo BLOG這篇)

  1. 備份資料庫和blog目錄中的wp-settings.php、index.php兩個檔案
  2. http://www.delymyth.net/en/index.php?p=1007下載檔案,解壓縮後將 wp-dstats-advanced.php放入plugins 資料夾並在外掛程式中啟動它;其他的檔案則放在你blog的資料夾中
  3. 在資料庫中建立一個wp_dstats2的table
    CREATE TABLE `wp_dstats2` (
    `id` int(11) unsigned NOT NULL auto_increment,
    `IP` varchar(15) NOT NULL default '127.0.0.1',
    `time` datetime NOT NULL default '2001-01-20 00:00:00',
    `referrer` varchar(255) NOT NULL default '-',
    `keyword` varchar(255) NOT NULL default '-',
    `page` int(11) unsigned NOT NULL default '0',
    `browser` varchar(255) NOT NULL default '-',
    `OS` varchar(255) NOT NULL default '-',
    PRIMARY KEY (`id`)
    ) TYPE=MyISAM;
  4. 修改 wp-settings.php,在 Table names 項目中增加:
    $dstatstable = $table_prefix . 'dstats2';
  5. 修改 index.php 在 <body> 中任一地方加入
    <?php dstats2_record(); ?>
    再來在require('./wp-blog-header.php');之後加上
    require('./wp-dstats-functions.php'); 這樣就完成了
如果要看你 blog 的一些資訊可以到 http://你的網址/wp-dstats-summary.php
例如我的就是http://og2.twbbs.org/wp/wp-dstats-summary.php



Posted by yuanlin at 樂多Roodo! │02:07 │回應(0)引用(0)Blog
樂多分類:日記/一般 工具:加入樂多書籤編輯本文
Ads by Roodo! 

引用URL

http://cgi.blog.roodo.com/trackback/104292