Wordpress に OpenID plugin を入れようとしたものの失敗

weblog — Hidekichi @ 2008/1/6 日曜日

今更ながら、OpenIDは良いなぁと思い始めた。

そういうわけで、うちのブログもOpenIDにならないものかとのプラグインを探すとありました。「WP-OpenID」

早速ダウンロードしてインストール、有効化、とここままで来てつまずく。

Plugin could not be activated because it triggered a fatal error.
Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in /web/hidekichi.net/www/wp/wp-content/plugins/openid/Auth/Yadis/Yadis.php on line 278

こんなエラーが出て、プラグインを有効化できない。

プラグインのところの掲示板によると、

Looks like WP-Open ID requires PHP 5 now.

とのコメントが。そういえば、うちのサーバのPHPもまだ4でした。5に上げるのもいいけど、色々確認が手間だからなぁ。


wordpress 2.3.1でアップロードした写真のサムネイルサイズ変更

weblog — Hidekichi @ 2007/11/3 土曜日

これ、バージョンアップするたびに毎回設定しなおしで、時々やり方が変わるから油断できない。

そういうわけで、2.3.1でまた変わったサムネイルのサイズ変更方法。

例示しているのは128×96(デフォルト)から320×240にするやり方。

編集するファイルは、wp-admin/includes/image.php

function get_udims( $width, $height) {
// if ( $height <= 96 && $width <= 128 )
if ( $height <= 240 && $width <= 320 )
return array( $width, $height);
elseif ( $width / $height > 4 / 3 )
// return array( 128, (int) ($height / $width * 128 ));
return array( 320, (int) ($height / $width * 320 ));
else
// return array( (int) ($width / $height * 96 ), 96 );
return array( (int) ($width / $height * 240 ), 240 );
}

の3箇所と

function wp_generate_attachment_metadata( $attachment_id, $file ) {
$attachment = get_post( $attachment_id );


$metadata = array();
if ( preg_match('!^image/!', get_post_mime_type( $attachment )) ) {
$imagesize = getimagesize($file);
$metadata['width'] = $imagesize['0'];
$metadata['height'] = $imagesize['1'];
list($uwidth, $uheight) = get_udims($metadata['width'], $metadata['height'
]);
$metadata['hwstring_small'] = “height=’$uheight’ width=’$uwidth’”;
$metadata['file'] = $file;

$max = apply_filters( 'wp_thumbnail_creation_size_limit', 3 * 1024 * 1024,
$attachment_id, $file );

if ( $max < 0 || $metadata['width'] * $metadata['height'] < $max ) {
// $max_side = apply_filters( ‘wp_thumbnail_max_side_length’, 128, $a
ttachment_id, $file );
$max_side = apply_filters( ‘wp_thumbnail_max_side_length’, 320, $a
ttachment_id, $file );
$thumb = wp_create_thumbnail( $file, $max_side );

の1箇所。

love sushi

画像をアップロードすると、こんな感じ。


wordpress 2.3.1 にアップグレードでsitemapプラグインの不具合発生

weblog — Hidekichi @ 2007/10/30 火曜日

2.3.1 が出ていたので、なんとなくアップグレードしてみた。

ざっとみたところ、管理画面でプラグインのバージョンをチェックしてくれており、インストールしているプラグインの新しいバージョンが出ている場合、教えてくれるようだ。

なんて喜んでいたら、コメントのポスト時にエラーを出すことが判明。

database error: [Table '.wp_post2cat' doesn't exist]
SELECT cat_ID AS ID, MAX(post_modified) AS last_mod FROM `wp_posts` p LEFT JOIN `wp_post2cat` pc ON p.ID = pc.post_id LEFT JOIN `wp_categories` c ON pc.category_id = c.cat_ID WHERE post_status = 'publish' GROUP BY cat_ID

なんか悪いことしたっけ?って明らかにバージョンアップのせいですな。

調べていくと、 Sitemaps というプラグインが悪さをしていることが判明。無効にするとエラーが出なくなった。

めでたしめでたし。じゃないよね、Sitemap使えないんだし。

2007年11月6日追記:

XML Sitemapsの問題、解決した。

(more…)


« 前のページ次のページ »

HTML convert time: 3.065 sec. Powered by WordPress ME