更新できるよ、
ってなってたんでやってみました。
メジャー番号が2から3になりましたね。
Windows7などのOS名やChromeなどのブラウザ名を
ちゃんと認識できるようになったみたい。
んで、以前やったようにカスタマイズ。
・昨日のぶんのアクセス数を表示させるための関数を追加
・管理画面でIPやホスト名を表示させるように調整
counterize.php と counterize_install.php に手を加えました。
個人的な忘備のために差分を書いておきます。
$ diff counterize_org.php counterize.php
166a167,176
> // Returns amount of hits yesterday
> function counterize_gethitsyesterday()
> {
> global $wpdb;
> $today = date("Y-m-d");
> $yesterday = date("Y-m-d",strtotime("-1 day"));
> $sql = "SELECT COUNT(1) FROM ".counterize_logTable()." WHERE timestamp >= '$yesterday' AND timestamp < '$today'";
> return $wpdb->get_var($sql);
> }
>
498a509,517
> // Returns amount of unique hits yesterday
> function counterize_getuniquehitsyesterday()
> {
> global $wpdb;
> $today = date("Y-m-d");
> $yesterday = date("Y-m-d",strtotime("-1 day"));
> $sql = "SELECT count(DISTINCT ip) FROM ".counterize_logTable()." WHERE timestamp >= '$yesterday' AND timestamp < '$today'";
> return $wpdb->get_var($sql);
> }
781c800
< $sql .= "'" . substr( md5($wpdb->escape( $remoteaddr ) ), 1, 16) . "',";
---
> $sql .= "'" . $wpdb->escape( $remoteaddr ) . "',";
1154a1174
>
1171a1192
> ip, '
', @gethostbyaddr($entry->ip); ?>
$ diff counterize_install_org.php counterize_install.php
184c184
<
---
> /*
190c190
<
---
> */