[[WordPress]] #contents * wpng-calendar [#k3e5ca9b] wpng-calendar導入には、あらかじめGoogleアカウントの登録とGoogleカレンダーの作成(および、カレンダーの公開設定)が必要です。~ ここでは既にそれらが終わっているものとして、wpng-calendarの導入と有効化のみ記述します。 ** wpng-calendar概要 [#wf9c44eb] Google Calendarの予定表をWordPressに読み込むpluginです。 #br ** ダウンロードサイト [#i27e62d4] wpng-calendarは以下のサイトからダウンロード。~ Mar 2008時点で Version 0.8.5 が最新。 #ref(http://code.google.com/p/wpng-calendar/,wpng-calendar); #br ** Google GDATA API key取得 [#j8c83f78] #ref(http://gd.google.com/html/signup.html,"Google Data API"); ダウンロードサイトにもリンクがありますが、Google Data APIのキーをもらうためにサインアップします。~ URLを入れるだけで、ながーいキーがもらえます。 #ref(http://gd.google.com/html/signup.html,"Google Data API"); #br ** wpng-calendar導入 [#uf37f67a] - plugin導入~ wpng-calendarのダウンロードサイトからtar-ballをダウンロード、plugins/へ展開。 $ cd ~ $ wget http://wpng-calendar.googlecode.com/files/wpng-calendar_0.8.5.zip $ cd ~/.avfs/***/wpng-calendar_0.8.5.zip# $ cp -a wpng-calendar ~/***/wp-content/plugins/. - date-js導入~ 日本語表示のためのjsを展開。 $ cd ~ $ wget http://datejs.googlecode.com/files/Datejs-all-Alpha1.zip $ cd ~/.avfs/***/Datejs-all-Alpha1.zip# $ cp -a Datejs-all/build/date-ja-JP.js ~/***/wp-content/plugins/wpng-calendar/js/. - wpng-calendar.php修正~ 日本語表示用jsを読み込むよう、 $ cd ~/***/wp-content/plugins/wpng-calendar/ $ cp -a wpng-calendar.php wpng-calendar.php.org 以下diffイメージで修正。 $ diff -brNup wpng-calendar.php.org wpng-calendar.php --- wpng-calendar.php.org 2008-11-09 14:04:31.000000000 +0900 +++ wpng-calendar.php 2008-11-09 14:04:30.000000000 +0900 @@ -160,7 +160,7 @@ if (!class_exists("WPNGCalendar")) { // Add the plugin's necessary objects to the header function addWPNGHeader() { // Add the DateJS file - wp_enqueue_script('date-js', get_bloginfo('wpurl') . '/wp-content/plugins/wpng-calendar/js/date.js', null, 'alpha-1'); + wp_enqueue_script('date-js', get_bloginfo('wpurl') . '/wp-content/plugins/wpng-calendar/js/date-ja-JP.js', null, 'alpha-1'); // Add the ThickBox files wp_enqueue_script('jquery-js', get_bloginfo('wpurl') . '/wp-content/plugins/wpng-calendar/js/jquery.js', null, '6124'); wp_enqueue_script('thickbox-js', get_bloginfo('wpurl') . '/wp-content/plugins/wpng-calendar/js/thickbox.js', null, '3.1'); #br ** wpng-calendar有効化 [#z4c4f20b] WordPressの管理画面でwpng-calendarを有効化します。 - [プラグイン]->[Wordpress Google Calendar]を[使用する] - [設定]->[WPNG Calendar Plugin] -- [Google GDATA API Key]にAPIキーをペースト -- [Google Calendar Feed]にGoogleカレンダーのURLをペースト --- GoogleカレンダーのURLはGoogleカレンダーの設定画面で[カレンダーのアドレス]->[XML]からペースト~ URLは ***/basic ではなく ***/full に書き換える - あとは好きに設定 - [Update Setings]で設定保存 #br ** 新規ページを作成 [#c57e524e] WordPressの管理画面で新規に予定表を埋めこむためのページを作成します。 - [作成]->[ページ] -- タイトル, パーマリンク, ページ内容は好きに記入 -- カスタムフィールドに以下を追加 --- キー: show-wpng-calendar --- 値: 予定表示対象週数