[懶人週間文摘] 20051202

Saturday, December 3rd, 2005 at 5:47 am

Games

  • Ace Combat Zero: 新宣傳影片、新桌布下載
  • Final Fantasy XII: 兩張新桌布提供下載
  • Front Mission 5: 新增 Wanzer 桌布下載
  • 聖劍傳說 DS - Children of Mana 發售日確定: 2006.02.23
  • 戰國無雙 2 發售日確定: 2006.02.09
  • [link] 李秉憲擔任 Capcom 於 Xbox 360 上新作的角色,會是鬼武者4 嗎?
  • Wordpress Plugins

  • Google analytics plugin for WordPress
    Semiologic 版本的 Google Analytics Plugin for WP
  • Quick Post
    在 blog 上新增一個快速發表文章的地方,功能類似許多論壇上的快速回應
  • Expire Posts
    使文章在有限時間出現的 plugin
  • Friends RSS Aggregator
    好友聯播功能,可以在單一頁面顯示加入的 RSS feed 文章
  • Alphabetical Plugins
    啟用後,可將 plugin list 依照字母排列
  • del.icio.us Style MP3 Player
    del.icio.us 樣式的線上 MP3 播放器
  • by hsuyo

    WP: Contextual Related Posts

    Tuesday, November 29th, 2005 at 7:05 am

    WP Plugin: Contextual Related Posts,會在每篇文章底部加入可能關聯的文章,亦可指定關聯文章的數量。

    安裝方法: 直接把 PHP 檔放到 plugin 資料夾即可。

    Posted in WP 速記
    by hsuyo

    [WP] WP-GoogleStats

    Friday, September 23rd, 2005 at 8:55 pm

    眼尖的人應該可以發現首頁或每篇文章底端,都有一個類似 Googlebot visited this page at 9/22, 8:55 pm 的東西,這是使用 WP-GoogleStats 這個 plugin 的效果,可以顯示 Googlebot 訪問 blog 的頻率、次數、以及最後到訪的時間。裝了有一段時間,有人在留言板問了,所以我介紹一下簡易的安裝步驟。

    step 1.
    於資料庫中建立一個新的 table,

    CREATE TABLE `wp_googlestats` (
    `page` varchar(100) NOT NULL DEFAULT '',
    `lastvisit` int(11) NOT NULL DEFAULT '0',
    `frequency` int(11) NOT NULL DEFAULT '0',
    `visits` int(11) NOT NULL DEFAULT '0',
    `timestamp` timestamp(14) NOT NULL,
    KEY `page` (`page`)
    )

    step 2.
    WP-GoogleStats 頁面下載 .phps 檔案並重新命名為 .php (mirror),將檔案放至 /wp-content/plugins/,於控制後台啟動。

    step 3.
    編輯 theme 底下的 footer.php,在 <div id="footer"> 範圍內任一地方加入

    <?php if (function_exists ('wp_ftr_googlestats')) wp_ftr_googlestats('l, F j, Y'); ?>

    'l, F j, Y' 為時間顯示的格式,可以參考 PHP.net 的 date 頁面。存檔後即可在首頁或文章底端看到效果。

    Posted in WP 速記
    by hsuyo

    [WP] User Online Plugin

    Sunday, May 15th, 2005 at 4:42 pm

    ricky 在留言板問了 User Online 的外掛,這是使用 WordPress 1.5 User Online,以下為簡易的安裝說明:

    Step 0.
    於 GameZ 的 programming 頁面 下載檔案: WordPress 1.5 User Online;

    Step 1.
    修改 wp-settings.php,尋找 Table names 底下的這一行:

    $wpdb->postmeta = $table_prefix . 'postmeta';

    在其下一行加入:

    $wpdb->useronline = $table_prefix . 'useronline';

    Step 2.
    放置壓縮檔裡的檔案:

    useronline-install.php 放入 wp-admin 資料夾
    wp-useronline.php 放入 WordPress 安裝根目錄下
    useronline.php 放入 wp-content/plugins 資料夾

    並在控制台啟用這個 plugin

    Step 3.
    於瀏覽器中瀏覽 http://你的blog網址/wp-admin/useronline-install.php
    執行後看到空白的頁面表示新的 table 已在資料庫中建立

    Step 4.
    於 header.php 或 sidebar.php 中加入

    <a href="wp-useronline.php"><?php get_useronline(); ?>

    即大功告成,可將 useronline-install.php 刪除或更名。

    Posted in WP 速記
    by hsuyo

    [WP] 在首頁排除/指定特定分類文章

    Saturday, April 30th, 2005 at 12:20 am

    這個 plugin: Front Page Categories,其實是我為了解決裝了 Jerome’s Keywords Plugin 之後,與右側的隨地大小便分類所衍生出來的問題而找到的。

    由於我之前參考這篇文章: How do I hide a category from the front page (index.php) ?,利用其中的方法將隨地大小便的分類排除在首頁中 (也就是該分類的文章不會出現在 index.php 裡),但使用 Jerome’s Keywords Plugin 後,Tags 連結裡的該分類文章也會被排除掉。於是在 WordPress Forum 苦尋替代方法,最後在原本文章的留言找到了解答。

    Plugin 的安裝方法更簡單了,把頁面中的 code 存成 PHP,修改下面那行之後,放入 wp-content/plugins 資料夾:

    $cats_to_show = '1';

    將其中的數字替換成欲在首頁顯示的分類 ID,多個 ID 間使用空白 space 隔開 (分類 ID 可以在管理介面的 管理 > 分類 中找到。) 最後於外掛管理介面啟用即可。

    Posted in WP 速記
    by hsuyo

    [WP] Tag Your WordPress

    Friday, April 29th, 2005 at 11:28 pm

    之前看到 QQ 裝了 Jerome’s Keywords Plugin,感覺滿有用的,研究一下把它裝上了。

    keywords tags

    安裝方法很簡單,只要將解壓縮後的檔案放入 wp-content/plugins 資料夾裡,於外掛管理介面啟用後,便可以看到在發表文章的下方出現 Keywords 的輸入欄,如左圖。

    要讓這些 Keywords/Tags 顯示在文章上,必須修改 Theme 之下的 index.php 以及 single.php,使用 <?php the_post_keytags(); ?> 來呼叫,需注意的是 <?php the_post_keytags(); ?> 必須加在 loop 之間。

    再以 <?php the_post_keytags(); ?> 為例,可以加入 include_cats、local_search、linktitle 三種不同的控制參數,預設分別為: false (文章分類不列入 Tags 之中)、'tag' (Tags 的連結導向本地端)、'Search site for ' (滑鼠移至連結上時顯示 Search site for )

    作者 Jerome 舉了例子:

    example 1.

    <?php the_post_keytags(true); ?>

    文章分類列入 Tags 之中;

    example 2.

    <?php the_post_keytags(false, 'technorati'); ?>

    文章分類不列入 Tags 之中、Tags 的連結導向 Technorati;

    example 3.

    <?php the_post_keytags(true, 'tag', 'View all posts on geewhiz.com for '); ?>

    文章分類列入 Tags 之中、Tags 的連結導向本地端、滑鼠移至連結上時顯示 View all posts on geewhiz.com for 你的 Tag;

    如果不需改變,則直接使用 <?php the_post_keytags(); ?> 即可。

    最後,如果有使用 permalink,記得至後台重新更新一次狀態,或是手動 (個人建議) 將以下 code 加入你的 .htaccess:

    RewriteRule ^tag/(.+)/feed/(feed|RDF|RSS|rss2|atom)/?$ /index.php?tag=$1&feed=$2 [QSA,L]
    RewriteRule ^tag/(.+)/(feed|RDF|RSS|rss2|atom)/?$ /index.php?tag=$1&feed=$2 [QSA,L]
    RewriteRule ^tag/(.+)/page/?([0-9]{1,})/?$ /index.php?tag=$1&paged=$2 [QSA,L]
    RewriteRule ^tag/(.+)/?$ /index.php?tag=$1 [QSA,L]

    至於俏麗的 Tag Cosmos 的功能,我想用 Static Page 的方式來呈現,可是出現了一點錯誤,只好先擱一旁。 使用作者提供的檔案,將 cosmos.php 放入 theme 的資料夾下,再新增一個 page ,template 選擇 cosmos 使用即可!

    Posted in WP 速記
    by hsuyo

    [WP] 表情符號 wp-grins

    Friday, February 25th, 2005 at 5:25 am

    juusa 在留言裡問到:

    如果要顯示表情符號的話
    除了啟用wp-grins的外掛外
    還要貼語法在使用中的theme的index.php裡嗎?
    謝謝囉!!
    juusa ^^

    如果想在 WordPress 1.5 中使用 Alex King 的 WP Grins 外掛,則需要做以下改良,編輯 wp-admin/admin-functions.php,約在第 574 行的地方可找到:

    <script type="text/javascript">edToolbar();</script>
    ';

    在其下一行加入:

    if (function_exists("wp_grins")) { echo "
    "; wp_grins(); }

    完成,如此一來在發表文章的地方就有標情符號的快捷列了。

    如果要加在留言發表的地方,則編輯 comments.php
    把 <?php wp_grins(); ?> 加入於 textarea 標籤上方的位置即可。

    相關網頁:

  • wp-grins for 1.5 ?
  • Posted in WP 速記
    by hsuyo

    [WP] 近期實用外掛整理 (20041210)

    Friday, December 10th, 2004 at 10:39 pm

    Useful plugins for WordPress (20041210):

  • del.icio.us Smart Tag (jonathan deutsch’s weblog)
    結合 del.icio.us 書籤的外掛,只要文章中的文字出現你的 del.icio.us 內的 tag 分類,就會標示出來。
  • Previous ‘n’ Posts (WP Themes.info)
    閱讀文章時,於 sidebar 顯示前幾篇文章標題的外掛。
  • Spelling Checker (coldforged.org)
    英文拼字檢查器。
  • Posted in WP 速記
    by hsuyo

    [WP plugin] 讓文章內的連結皆為另開新視窗

    Friday, June 18th, 2004 at 12:13 pm

    作者: zonble

    外掛程式如下,存成.php檔案後,放在wp-content/plugins/,然後啟用即可。

    <?php

    /*
    Plugin Name: External Links
    Plugin URI: http://zonble.twbbs.org/
    Description: Add "target='_blank'" tag to all your links in your stories, and as the visitors click on the links in your stories, it will open a new browsing window.
    Author: Weichung Yang
    Author URI: http://zonble.twbbs.org/
    */

    if (function_exists('add_filter')) {
    function __target_blank($content) {
    $content = preg_replace_callback("/<a href="([^>]*)>/is",
    '__target_blank_back',
    $content);
    return $content;
    }

    function __target_blank_back($match) {
    $code = $match[1];
    if(!strstr($code, get_bloginfo('URL'))){
    $code .= " target="_blank"";
    }

    return "<a href="$code>";
    }

    add_filter('the_content', '__target_blank');
    }

    ?>

    Posted in WP 速記
    by hsuyo