mktlab.info

MaKoTo igarashi LABoratory?

mktlab.info random header image

Blogtimes Plugin

Saturday, January 27th, 2007 at 1:05 am · 晴のち曇 最高13度/最低7度 · No Comments · TrackBack URI

サイドバーに表示している、投稿した時刻のグラフ画像を作ってくれるプラグインです。ダウンロードはここから。blogtimes.phpを以下のように修正。

<?php
if (!$saveFile) $saveFile = ABSPATH . 'wp-images/blogtimes.png';
// added by MKT
$last_x_days = 60;
$width = 190;
$height = 65;
$saveFile = ABSPATH . 'wp-includes/images/blogtimes.png';

//...//

$border_color = $black;
// added by MKT
$mkt_blue   = ImageColorAllocate ($im, 22,106,202);
$mkt_pink   = ImageColorAllocate ($im, 218,16,116);
$mkt_gray   = ImageColorAllocate ($im, 240,240,240);
$box_color = $mkt_gray;
$line_color = $mkt_blue;
$tick_color = $mkt_pink;
$border_color = $mkt_gray;

//...//

//for ($i = 0; $i <= 23; $i=$i+1) modified by MKT
for ($i = 0; $i <= 24; $i=$i+1)

//...//

//ImageString($im, 2, $right - 5, $bottom,  0, $text_color); commented by MKT

//...//

//add_action('edit_post', 'updateBlogTimePNG'); use for test added by MKT
add_action('publish_post', 'updateBlogTimePNG');
?>

コンソールで以下を実行。

$ touch wp-includes/images/blogtimes.png
$ chown www-data:www-data wp-includes/images/blogtimes.png

 



Tags: wordpress

0 responses so far ↓

  • There are no comments yet...Kick things off by filling out the form below.

Leave a Comment