Deprecated: Function ereg() is deprecated in /home/silence/blog.silence.idv.tw/wp-content/plugins/tantan-flickr/flickr.php on line 56

Deprecated: Assigning the return value of new by reference is deprecated in /home/silence/blog.silence.idv.tw/wp-content/plugins/tantan-flickr/flickr.php(83) : runtime-created function on line 1

Strict Standards: Non-static method TPGuestbook::get_instance() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/tp-guestbook/tp-guestbook.php on line 506

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GoogleSitemapGeneratorLoader::Enable() should not be called statically in /home/silence/blog.silence.idv.tw/wp-includes/plugin.php on line 311

Warning: Cannot modify header information - headers already sent by (output started at /home/silence/blog.silence.idv.tw/wp-content/plugins/tantan-flickr/flickr.php:56) in /home/silence/blog.silence.idv.tw/wp-includes/feed-rss2.php on line 8
SILENCE Blog » WordPress http://blog.silence.idv.tw The Blog Belongs to us Wed, 20 Mar 2013 13:11:41 +0000 http://wordpress.org/?v=2.6 en 升級至 Wordpress 2.1 http://blog.silence.idv.tw/2007/01/27/wordpress-21 http://blog.silence.idv.tw/2007/01/27/wordpress-21#comments Fri, 26 Jan 2007 19:03:08 +0000 SILENCE http://blog.silence.idv.tw/2007/01/27/wordpress-21/ Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1229

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1245

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wp-lightbox2/wp-lightbox2.php on line 45

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::the_content() should not be called statically in /home/silence/blog.silence.idv.tw/wp-includes/plugin.php on line 163

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232
今天花了點時間將Wordpress Blog 從 2.0.7升級到 2.1﹐由於已經知道 Pagebar 這個Plugin會有相容性的問題﹐所以到作者網站當漏1.3.1版即可。 Plugin相容性: 以我的Blog內而言﹐需要更新的 plugin 為: Pagebar(已發佈新版) Postview Plus(已發佈新版) UTW(尚未發佈) tinymce 吃掉 <div> 標籤: TinyMCE 改為 tabbed 的方式﹐可以快速切換原始碼﹐這功能自從用過了官方網站的 Blog 後﹐已經肖想很久了﹐不過居然帶來一點小麻煩﹐會吃掉<div></div>這個標籤﹐並且以<p>來取代﹐所以必須手動修改一下位在 wordpress/wp-incluede/js/tinymce 的 tiny_mce_config.php 檔: 於 24 行: $valid_elements = ‘p/-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘; 將「p/-div[*],」去掉改成: $valid_elements = ‘-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘; Post Formatting 問題: 另外 2.1 版本也順便更新了 wpautop 這個 function﹐會在輸出文章時﹐自動修改格式﹐所以也很要命的幫我把 <div></div> 標籤內自動加上 <p></p>﹐變成<div><p></p></div>﹐這 function 在2.1版本是放在 wp-includes/formatting.php 內﹐只要把第 66 行的 $pee = preg_replace( ‘|<p>(<div[^>]*>\s*)|’, “$1<p>”, $pee ); 註解掉即可 TinyMCE 切換 visual, code 時會造成斷行格式亂掉 這問題似乎只會出現在 Firefox [...]]]>
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1229

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1245

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wp-lightbox2/wp-lightbox2.php on line 45

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::the_content() should not be called statically in /home/silence/blog.silence.idv.tw/wp-includes/plugin.php on line 163

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232

天花了點時間將Wordpress Blog 從 2.0.7升級到 2.1﹐由於已經知道 Pagebar 這個Plugin會有相容性的問題﹐所以到作者網站當漏1.3.1版即可。

Plugin相容性:

以我的Blog內而言﹐需要更新的 plugin 為:

  1. Pagebar(已發佈新版)
  2. Postview Plus(已發佈新版)
  3. UTW(尚未發佈)

tinymce 吃掉 <div> 標籤:

TinyMCE 改為 tabbed 的方式﹐可以快速切換原始碼﹐這功能自從用過了官方網站的 Blog 後﹐已經肖想很久了﹐不過居然帶來一點小麻煩﹐會吃掉<div></div>這個標籤﹐並且以<p>來取代﹐所以必須手動修改一下位在 wordpress/wp-incluede/js/tinymce 的 tiny_mce_config.php 檔:
於 24 行:

$valid_elements = ‘p/-div[*],-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘;

將「p/-div[*],」去掉改成:

$valid_elements = ‘-strong/-b[*],-em/-i[*],-font[*],-ul[*],-ol[*],-li[*],*[*]‘;

Post Formatting 問題:

另外 2.1 版本也順便更新了 wpautop 這個 function﹐會在輸出文章時﹐自動修改格式﹐所以也很要命的幫我把 <div></div> 標籤內自動加上 <p></p>﹐變成<div><p></p></div>﹐這 function 在2.1版本是放在 wp-includes/formatting.php 內﹐只要把第 66 行的

$pee = preg_replace( ‘|<p>(<div[^>]*>\s*)|’, “$1<p>”, $pee );

註解掉即可

TinyMCE 切換 visual, code 時會造成斷行格式亂掉

這問題似乎只會出現在 Firefox 身上﹐使用 IE 就不會﹐這我沒找到原因﹐但使用 冰漾 所修改的 TinyMCE 完整版 後就沒這個問題了!

希望以上對有遇類似問題的朋友們有幫助

]]>
http://blog.silence.idv.tw/2007/01/27/wordpress-21/feed
更改 MySQL 資料庫編碼 http://blog.silence.idv.tw/2006/10/31/%e6%9b%b4%e6%94%b9-mysql-%e8%b3%87%e6%96%99%e5%ba%ab%e7%b7%a8%e7%a2%bc http://blog.silence.idv.tw/2006/10/31/%e6%9b%b4%e6%94%b9-mysql-%e8%b3%87%e6%96%99%e5%ba%ab%e7%b7%a8%e7%a2%bc#comments Tue, 31 Oct 2006 05:27:03 +0000 SILENCE http://blog.silence.idv.tw/2006/10/31/%e6%9b%b4%e6%94%b9-mysql-%e8%b3%87%e6%96%99%e5%ba%ab%e7%b7%a8%e7%a2%bc/ Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1229

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1245

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wp-lightbox2/wp-lightbox2.php on line 45

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::the_content() should not be called statically in /home/silence/blog.silence.idv.tw/wp-includes/plugin.php on line 163

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232
由於剛申請 Dreamhost 不久後﹐便匆匆忙忙搞 Blog﹐相簿搬移和設定 卻忘記注意 MySQL 編碼﹐後來在安裝 Ultimate Tag Warrior 這個 Plugin 時 發現有點不正常﹐去 check 後﹐才發覺了是編碼的問題….. 原來 Dreamhost 建立 database 的預設編碼是 latin1 而不是 utf8。搞得在 phpmyadmin 內看到的都是亂碼 XD 所以就得花點時間做轉換了。 以下為轉換步驟: 啟用 wordpress 內建的 database backup plugin﹐並做備份 將備份完的 .sql 開啟(記得用有支援 UTF-8 的編輯器) 將檔案內所有的 「DEFAULT CHARSET=latin1」 改為 「DEFAULT CHARSET=utf8」 將檔案內所有的 「COLLATE=latin1_bin」 改為 「COLLATE=utf8_general_ci」 存檔 由 dreamhost 的 panel 新建立一個 databse 將此新建的 database 「校對」改為 utf8_general_ci (phpmysqladmin 此選項在點了資料庫後的「管理」內) 使用 phpmyadmin 的「載入」功能將您的 .sql 檔案載入 更改 wordpress/wp-config.php 內新資料庫的名稱 (因為 dreamhost 不允許 user 於 phpmyadmin 改資料庫名字) 以上便大功告成! 若您用瀏覽器開啟 [...]]]>
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1229

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wpg2/wpg2embed.inc on line 1245

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/silence/blog.silence.idv.tw/wp-content/plugins/wp-lightbox2/wp-lightbox2.php on line 45

Strict Standards: call_user_func_array() expects parameter 1 to be a valid callback, non-static method GA_Filter::the_content() should not be called statically in /home/silence/blog.silence.idv.tw/wp-includes/plugin.php on line 163

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_article_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 250

Strict Standards: Non-static method GA_Filter::ga_parse_link() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 241

Strict Standards: Non-static method GA_Filter::ga_get_domain() should not be called statically in /home/silence/blog.silence.idv.tw/wp-content/plugins/googleanalytics.php on line 232

由於剛申請 Dreamhost 不久後﹐便匆匆忙忙搞 Blog﹐相簿搬移和設定
卻忘記注意 MySQL 編碼﹐後來在安裝 Ultimate Tag Warrior 這個 Plugin 時
發現有點不正常﹐去 check 後﹐才發覺了是編碼的問題…..
原來 Dreamhost 建立 database 的預設編碼是 latin1
而不是 utf8。搞得在 phpmyadmin 內看到的都是亂碼 XD
所以就得花點時間做轉換了。

以下為轉換步驟:

  1. 啟用 wordpress 內建的 database backup plugin﹐並做備份
  2. 將備份完的 .sql 開啟(記得用有支援 UTF-8 的編輯器)
  3. 將檔案內所有的
    「DEFAULT CHARSET=latin1」
    改為
    「DEFAULT CHARSET=utf8」
  4. 將檔案內所有的
    「COLLATE=latin1_bin」
    改為
    「COLLATE=utf8_general_ci」
  5. 存檔
  6. 由 dreamhost 的 panel 新建立一個 databse
  7. 將此新建的 database 「校對」改為 utf8_general_ci
    (phpmysqladmin 此選項在點了資料庫後的「管理」內)
  8. 使用 phpmyadmin 的「載入」功能將您的 .sql 檔案載入
  9. 更改 wordpress/wp-config.php 內新資料庫的名稱
    (因為 dreamhost 不允許 user 於 phpmyadmin 改資料庫名字)

以上便大功告成!
若您用瀏覽器開啟 blog 後發現都是亂碼﹐請照下面步驟

  1. 開啟 wordpress/wp-include/wp-db.php
  2. 找尋「$this->dbh = @mysql_connect($dbhost, $dbuser, $dbpassword);」
  3. 在此行下面加上
    「$this->query("SET NAMES 'utf8'");」(注意別加上引號了)

這樣應該是能解決囉 :-)

]]>
http://blog.silence.idv.tw/2006/10/31/%e6%9b%b4%e6%94%b9-mysql-%e8%b3%87%e6%96%99%e5%ba%ab%e7%b7%a8%e7%a2%bc/feed