歡迎光臨, 訪客. 請先 登入註冊一個帳號.
四月 25, 2024, 08:44:02 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
  列出文章
頁: 1 2 [3]
31  開發 / 核心補強精華區 / 點選"閱讀全文"時focus在延伸內文那一部份 於: 十月 01, 2005, 02:10:25 下午
修改  class/view/defaultview.class.php

程式碼:
function _addShowMoreLink()
{
    $posts = $this->_params->getValue( 'posts' );
    $locale = $this->_blogInfo->getLocale();

    //$textFilter = new TextFilter();
    $modifPosts = Array();
    $rg = RequestGenerator::getRequestGenerator( $this->_blogInfo );
    foreach( $posts as $post ) {
    if( $post->hasExtendedText()) {
          $result = $post->getIntroText();
          $showMoreText = $locale->tr( 'read_more' );
+         // patch for read more text focus by ericj.
!         $showMoreLink = "&nbsp;<a href=\"".$rg->postPermalink($post)."#More\">".$showMoreText."</a>";
          $post->setText( $result. $showMoreLink );
    }

    array_push( $modifPosts, $post );
}


view/viewarticleview.class.php

程式碼:
function render()
{
    // if our view is cached, there is not much to do here...
    if( $this->isCached()) {
    parent::render();
    return true;
    }

    // get the next and previous articles, based on the article we're going to show
    $article = $this->getValue( 'post' );

    // notify of certain events
    $postText = $article->getIntroText();

+   // patch for focus by ericj
!   $postExtendedText = "<a name="."\"More\"></a>".$article->getExtendedText();

    #$postExtendedText = $article->getExtendedText();
    $this->_pm->notifyEvent( EVENT_TEXT_FILTER, Array( 'text' => &$postText ));
    $this->_pm->notifyEvent( EVENT_TEXT_FILTER, Array( 'text' => &$postExtendedText ));
    $article->setIntroText( $postText );
    $article->setExtendedText( $postExtendedText );
    // and yet one event more
    $this->_pm->notifyEvent( EVENT_POST_LOADED, Array( 'article' => &$article ));

    // once ready, put the article back to the context of the view
    $this->setValue( 'post', $article );
    $this->setValue( 'comments', $article->getComments());
    $this->setValue( 'user', $article->getUser());
    $this->setValue( 'trackbacks', $article->getTrackbacks());

    // render the main view
    parent::render();
}

32  開發 / 外掛程式 / Re: 为什么无法使用plugins 於: 九月 29, 2005, 05:13:22 下午
調高 PHP.ini裡面的memory limit...
33  支援 / 使用與操作 / Re: 如何在每篇文章後加入修改文章的連結? 於: 九月 27, 2005, 12:09:04 上午
Wordpress是會判斷說你是不是已經登入後台了
如果是的話就在文章後面顯示EDIT這個連結讓你可以直接修改文章
不曉得有沒有判斷是不是已經登入過了呢?

用if加在前面的話版面會比較漂亮...
34  支援 / 安裝與設定 / Re: 預覽圖示顯示不行 >.< 於: 九月 06, 2005, 09:05:02 下午
檔名是中文??
35  支援 / 使用與操作 / Re: PLOG二级域名的问题、(已经找到问题所在了) 於: 八月 30, 2005, 12:02:42 下午
應該是Database裡該blog的mangled_blog字串若轉換失敗變成空白的話
那麼你輸入不存在的網誌位址他就會連到轉換失敗的那一個
SELECT * FROM `plog_blogs` WHERE `mangled_blog` = '';
這樣就能找到是哪個網誌的mangled_blog轉換失敗...

36  開發 / 核心補強 / [bug] pLog mangled_blogs, mangled_name 於: 八月 19, 2005, 11:52:40 下午
pLog會將網誌的站台名稱,在存進plog_blogs的mangled_blog時用一個函式去做轉換,
我目前還不曉得那個函式有什麼用途或者意義,因為中文字經過該函式的轉換後,通常都會變成ae或者eeecc 這一類無意義或者轉換後結果都類似的字串,目前已知,只要站台名稱使用中文時,該函式有時候會轉換失敗,存成空白,而plog_blogs裡的mangled_blog若是空白時,自訂網址就會出現問題,例如即使不存在的網址也都會連到mangled_blog是空白的那個網誌,正常的話應該是顯示該網誌不存在.

而mangled_name則是文章的分類轉換後存的colum,也是一樣,中文的分類名稱經轉換後存進plog_articles_categories的mangled_name時也會變成沒有意義而內容很類似的字串,

我想問的是,table裡要有mangled_blogs和 mangled_name這樣的欄位是有什麼意義呢?他對中文的轉換似乎很糟糕,還有一些資料夾的名稱如果用中文的話,也是會被轉換成一些無意義的字串,我想,如果沒有特殊目的的話,那些地方應該限制使用者只能填寫英文才能避免這一類的問題發生吧?

一來是會讓自訂網址很醜
二來是多存那個colum有什麼特殊的意義嗎?
三是發現目前有些用中文命名的資料夾裡面的圖片會無法正確refrerence到

這些情況都是發生在我有開啟"自訂網址" 這項功能時,
因為我不喜歡網址名稱很長,而且用數字來代表每個人的個人網誌位址

所以開啟"自訂網址"將每個人的網誌位址設定成
http://blog.ysmis.cc/userID

可以請教知道mangled_ooxx意義的人告訴我該怎麼對那個函式去做修正呢?
或者是要從程式碼那邊讓他不要經由函式轉換.而強制使用者必須輸入有意義的英文字串?
37  開發 / 模版設計 / Re: 我想修改自己風格的模板 於: 八月 19, 2005, 11:31:24 下午
引用自: bitemancat
我想修改自己風格的模板..
可是用dreamweaver開了.template檔
顯示出來的是程式碼
沒有整個版面的結構

請問dreamweaver開了.template檔顯示出來程式碼是正確的嗎?
如果想要修改現有的.template變成自己喜歡的樣式
有什麼程式可以用呢?


 吐舌頭


是正常的阿 , plog 將 整個網頁的架構由 template 組成, 分為  panel ,  herder ,footer , mian ..etc..
稍微試一下應該就可以從每個個別的ooxx.template去猜出他是控制哪個部分
我比較喜歡直接在console下用vim改耶XD


BTW,我覺得你現在用的template感覺不錯阿 吐舌頭
38  支援 / 安裝與設定 / Re: 菜鳥的問題 於: 八月 19, 2005, 07:21:29 下午
引用自: scv0923
我是用動態ip架站的
也有執行no-ip duc這個程式
上面也有笑臉顯示


Apache在windows上建議使用apache2版本
BTW, 有可能是apache httpd.conf的設定 ?

你的servername有改成你申請的動態dns了嗎?
39  支援 / 安裝與設定 / 沒有www這個blog 於: 八月 19, 2005, 07:17:21 下午
你可以在你的dn裡面指定 www.xxx.com 到 blog那台主機的IP
然後在apache那邊做一個 virtualhost 的設定

這樣 www.xxx.com 應該就可以優先被apache做 redirect的動作
而不是交給 plog 來判斷.
40  建議 / 發表與交流 / 資管地下窩 Blog Site 於: 八月 14, 2005, 11:45:36 下午
大家好,我們是中山大學,資管系的學生。
資管地下窩 Blog Site 是我們的畢業專題

網址是: http://blog.ysmis.cc

我們整合了 Maple itoc BBS 上的帳號
讓擁有bbs帳號的使用者可以申請自己的個人網誌
採用的blog系統是 plog-1.0.1

未來應該還會遇到許多問題,
請多多指教囉
41  開發 / 中文相關 / mysql41與UTF8編碼,校對的問題 於: 七月 24, 2005, 09:31:21 下午
引用自: markwu
如 James 說的你的 phpmyadmin 的語系必須選繁體中文(UTF-8) 才行。假設你已經選了繁體中文 utf-8 語系,那麼另一個可能是你的 mysql defaultcharset 並非 utf-8 編碼。所以顯示出來是錯的!

Mark


我找到問題的原因了   開懷大笑
答案在這篇文章就有提到了
http://forum.lifetype.org.tw/index.php?topic=47.0
mysql-4.1x 多了collation和charset的設定
除了connection要設定為utf-8外,每個欄位的校對(collation)也都要設成utf8_general_ci

另外光是這樣的設定plog預設存進mysql-4.1x 的中文在phpMyAdmin裡面看來還會是亂碼
但是讀取還是正常..

要解決的辦法就是像上面那篇文章說的.
修改class/database/adodb/drivers/adodb-mysql.inc.php
加上@mysql_query("SET NAMES 'utf8'", $this->_connectionID); 的判斷..
詳細的作法請看原作者的文章...

我只有做第一個的修正,增加了兩行SET NAMES的設定而已.

我的作業環境是
FreeBSD 4.11 RELEASE , apache2 + mod_php4.4.0.1 + plog 1.0.1 with ports , Mysql-server 4.1.13
42  開發 / 中文相關 / mysql41與UTF8編碼,校對的問題 於: 七月 21, 2005, 02:26:01 下午
要怎樣設定 mysql-41 才能夠讓 plog 存的中文字正常的出現在database裡 Orz

雖然網頁上看起來沒問題,但是看到資料庫裡面一堆亂碼心情就是不太好阿....

 MySQL 文字編碼:  UTF-8 Unicode (utf8)

 MySQL 連線校對:  utf8_general_ci

 table裡column的校對也設成 utf8_general_ci

為什麼網頁上的資料塞進DB後還是亂碼阿阿阿阿阿阿....

請問有人知道database這邊該怎麼設定嗎?我是用phpMyAdmin來管理MySQL的.
43  支援 / 安裝與設定 / 安裝1.0.1就空白 於: 七月 20, 2005, 06:49:39 下午
把php.ini裡面的memory_limit = 8M 改成 32M

今天剛解決這個問題 ;p
頁: 1 2 [3]