歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 25, 2024, 09:44:36 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
  列出文章
頁: [1]
1  支援 / 安裝與設定 / LifeType 1.0.6 升級 1.1.6 經驗 於: 二月 20, 2007, 08:29:58 下午
主機商 Powweb
MySQL 4.1.18
PHP 4.4.4

執行下列步驟後可以完成升級

1. 刪掉主機上1.0.6檔案,plug-in也要刪,因為1.1.x的plug-in需改寫。我沿用自1.0.x改出來的template而沒有刪改,在安裝完1.1.6後仍然可用。
2. 上傳1.1.6至主機
3. 修改config.properties.php為正確設定
4. 確定php.ini內的session.save_path為正確 (我碰過錯誤發生,但這應該是主機商的問題而不是LT)
5. 執行wizard.php,先按1.0 to 1.1的link
6. 正確執行後,再從頭跑wizard.php一次
7. 將新版plug-in上傳至主機目錄中 (我用recentcomments和authimage)
8. 我有排序網頁連結的習慣,修改 class/dao/mylinks.class.php,在 function getLinks 中,將 Array( "date" => "DESC" ) 改成 Array( "name" => "ASC" )
2  支援 / 安裝與設定 / 1.0升級至1.0.1的問題 於: 六月 14, 2005, 09:11:28 下午
修改\class\database\adodb\drivers\adodb-mysql.inc.php後果然就正常了。
我把1.0版中存在但1.0.1版消失的三段hacks全帶進來。

程式碼:

else if (ADODB_PHPVER >= 0x4200)
$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword,
$this->forceNewConnect);
else
$this->_connectionID = mysql_connect($argHostname,$argUsername,$argPassword);

/** hack to adodb **/
if ($this->_isSupportUtf8() && $argDatabasename) {
$dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
if ($dbEncoding) {
mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
}
}
/** end of hack **/

if ($this->_connectionID === false) return false;
if ($argDatabasename) return $this->SelectDB($argDatabasename);
return true;


程式碼:

if ($this->_connectionID === false) return false;
if ($this->autoRollback) $this->RollbackTrans();

/** hack to adodb **/
if ($this->_isSupportUtf8() && $argDatabasename) {
$dbEncoding = $this->_getDbDefaultEncoding($argDatabasename);
if ($dbEncoding) {
mysql_query("SET NAMES $dbEncoding", $this->_connectionID);
}
}
/** end of hack **/

if ($argDatabasename) return $this->SelectDB($argDatabasename);
return true;


程式碼:

$this->forceNewConnect = true;
return $this->_connect($argHostname, $argUsername, $argPassword, $argDatabasename);
}
/** start of adodb hack **/
function _isSupportUtf8() {

// check mysql version first. Version lower than 4.1 doesn't support utf8
$serverVersion = mysql_get_server_info($this->_connectionID);
$version = explode('.', $serverVersion);
if ($version[0] < 4) return false;
if ( ($version[0] == 4) && ($version[1] == 0) ) return false;

// check if utf8 support was compiled in
$result = mysql_query("SHOW CHARACTER SET like 'utf8'", $this->_connectionID);
if (mysql_num_rows($result) > 0) {
return true;
}
return false;
}

function _getDbDefaultEncoding($argDatabasename)
{

if (!$argDatabasename) {
return false;
}

// We use a SHOW CREATE DATABASE command to show the original
// SQL character set when DB was created.
$result = mysql_query("SHOW CREATE DATABASE $argDatabasename", $this->_connectionID);
if (mysql_num_rows($result) < 0 ) {
// The specified db name is wrong!
return false;
}
$dbInfo = mysql_fetch_row($result);
$pattern = '/40100 DEFAULT CHARACTER SET (\w+) /';
if ( (preg_match($pattern, $dbInfo[1], $match) > 0) ) {
return $match[1];
}
return false;
    }
    /** end of hack **/

  function &MetaColumns($table)
3  支援 / 安裝與設定 / 1.0升級至1.0.1的問題 於: 六月 13, 2005, 08:22:43 下午
我看過了,但我不解的是,最開始時我就已將MySQL charset設成UTF-8 Unicode (utf8), MySQL connection collation設成utf8_general_ci,plog 1.0安裝完後,用phpMyAdmin 2.6.1-pl3進入讀取,中文都能正確顯示,這代表database中的資料應該是以UTF-8存在的。

我的plog 1.0和1.01都選擇成UTF-8編碼,覆蓋1.0成1.01版,從mysql讀出來的中文還是變成問號。

另外,我曾用MS Word修改plog 1.0的部分檔案 (mylinks.class.php,config.properties.php,locale_zh_TW.php,footer.template,main.template,post.template,.htaccess,error.php),因為當時我沒有支援UTF-8的text editor,後來我才知道MS Word會將檔案存成UTF-8(BOM),也許會造成問題?

但我猜想造成上述問題的關鍵還是跟mysql比較有關係...
4  支援 / 安裝與設定 / 1.0升級至1.0.1的問題 於: 六月 04, 2005, 12:27:13 下午
我的網站在 http://blog.trevoryu.net

剛用1.0.1覆蓋,刪除wizard.php,修改config.properties.php後,未清tmp


清tmp,reload頁面後


進admin,編輯舊文章,中文仍為問號


用原備份檔案覆蓋,又恢復正常
5  支援 / 安裝與設定 / 1.0升級至1.0.1的問題 於: 六月 02, 2005, 08:33:51 下午
我重來一次,
1. zip the plog 1.0 to one file
2. unzip plog 1.0.1 to overwrite all files
3. 修改config.properties.php
4. tmp目錄清空

結果舊文章的中文依舊顯示為問號,目前仍無解?

我的主機商是powweb
apache 1.3.33
php 4.3.11
mysql 4.1.9
perl 5.006001
6  支援 / 安裝與設定 / 可能是1.0.1在處理中文上與1.0有所不同? 於: 五月 29, 2005, 09:36:36 下午
我耐心地檢查過執行wizard.php前和後的所檔案差異,若以檔案時間區分的話,執行wizard.php後唯一有被動過的檔案就只有config.properties.php而已。我猜想會有中文顯示錯誤的問題,可能出自於1.0.1和1.0在處理中文上有所不同。

原來用1.0.1覆蓋後,我曾發表一篇含中文的文章,結果仍無法正確顯示。

然後再用先前備份的1.0覆蓋回去,舊文章的中文完好如初,但先前用1.0.1發表的中文文章居然也是亂碼。

感覺上很有可能是1.0.1和1.0在某個地方所用的encoding方法並不一致。(not UTF-8?)
7  支援 / 安裝與設定 / 補充 於: 五月 29, 2005, 01:37:51 下午
我改過的檔案有

/.htaccess
/error.php
/class/dao/mylinks.class.php
/config/config.properties.php
/locale/locale_zh_TW.php
/templates/standard/footer.template, main.template, post.template, style.css

我又試了一次,發現剛用1.0.1覆蓋完後出現的sql error是因為config.properties.php尚未設定所引起。設定正確後首頁即可顯示,但文章的中文仍顯示為問號。(注意此時我只修改了config.properties.php而已,其他檔案尚未更動)

我有把/tmp內除了.htaccess的檔案全部清掉過。

我在另一個地方用wizard.php重新安裝1.0.1試用,除了月份顯示為亂碼外,中文顯示都沒有問題。
8  支援 / 安裝與設定 / 1.0升級至1.0.1的問題 於: 五月 28, 2005, 11:46:49 下午
我升級的方法是將原來1.0版已被我修改過的檔案備份,將1.0.1全部丟到主機上,再將已修改的1.0版備份檔覆蓋進去。

起先會出現sql error,後來我先備份sql database後,執行了wizard.php,但在database那一步因為我輸入的名稱與現有database同名,被拒絕而沒有繼續安裝。

此時再進入plog已無sql error,但文章內之中文全變成問號,換言之來自sql databse中的中文無法正確顯示。再進入sql檢查,舊文章的中文仍為正確。

進admin介面發表一篇新文章,英文正確但中文卻部份可顯示,部分仍為問號。

不知各位可否提供解決之道?
9  支援 / 安裝與設定 / 此法成功 於: 四月 24, 2005, 09:43:24 上午
自問自答,上面的方法是可行的,因為我誤把mylinks.class.php以binary模式上傳,導致失效,甚至連帶讓檔案中心的圖檔無法顯示;重新以ASCII模式上傳後,一切正常。
10  支援 / 安裝與設定 / 如何排序網站連結? 於: 四月 23, 2005, 09:22:41 下午
我依照 http://www.lifetype.net/forums/viewtopic.php?t=618&highlight=sort+link ,將class/dao/mylinks.class.php內的
程式碼:
$query = "SELECT * FROM ".$this->getPrefix()."mylinks WHERE blog_id = ".$blogId;
            if( $categoryId != 0 )
               $query .= " AND category_id = ".$categoryId;
            $query .= " ORDER BY id ASC;";

改成ORDER BY name,網頁內的網站連結依舊無法按照字母順序排列,但在admin介面中的網站連結列表卻已能夠照字母順序排列,想請問各位正確的修改方式?
Thanks!
頁: [1]