Archive for category 程式

Date: 十月 17th, 2008
Cate: 程式
3 msgs

程式設計師的格言

(轉載引用自http://buttaiwan.wordpress.com/2008/10/12/programmers_rule/)

程式設計師的格言(盜作不少)

譯自
http://www2.biglobe.ne.jp/~oni_page/other/etc/pr03.html
http://mixi.jp/view_community.pl?id=1772737

(版本2 2008/10/12更新) more))

Date: 十月 15th, 2008
Cate: 程式

Curl

以下是今天寫一隻擷取網頁程式用所找到的參考資料,存起來以後用得到 XD

bool curl_setopt (int ch, string option, mixed value)
more))

Date: 七月 16th, 2008
Cate: 程式

WordPress 2.6 Tyner Released

本來就沒在怕當白老鼠的,看到的第一時間就更新了,使用上沒有問題,
只是有個plugin需要修改才可以正常運作,這我後面再提。

WordPress 2.6版主要新功能:

  • 文章修改歷史紀錄,可比對新舊版本、抓出被修改的部份
  • 可還原成文章被修改前的版本
  • 強化「Press This!」發文按鈕,可置於瀏覽器上方,方便快速引用、發文
  • 可在圖片下方設定「圖片標題」說明文字
  • 套用Theme佈景主題前,可先在後台預覽
  • 新增Turbo功能,透過Gears機制加快網站存取速度(瀏覽器快取)
  • 內建編輯器新增「字數統計功能」
  • 媒體庫(Gallery)支援滑鼠拖拉、管理功能
  • 外掛(Plugin)管理介面新增全選欄位與刪除外掛功能
  • 可修改預設Avatar大頭貼圖示(如果有啟用的話),參考:這篇
  • 文章管理介面支援〔Shift〕鍵+滑鼠左鍵的多選功能,可一次選取多篇文章
  • WordPress後台支援SSL登入(推~
  • 改善遠端登入的安全性,預設XML-RPC為關閉狀態
  • 可自訂wp-config.php設定檔跟wp-content資料夾的位置
  • Stronger better faster versions of TinyMCE, jQuery, and jQuery UI.
  • 其他網站安全增強與修改

翻譯引自 重灌狂人

這次多了很多不錯的功能,但我好像沒有特別會使用到哪個……就當作例行更新吧!
more))

Date: 七月 8th, 2008
Cate: 程式
7 msgs

To 藍嵐網友

Before

[source lang='php']function pw_hint($content=』") {
global $post;
$p = get_post($post->ID);

if ( !empty($post->post_password) ) { // if there’s a password
if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password )
{
if(get_post_meta($post->ID, ‘hint’, true) != 』)
$output = __(‘Hint:’,'pw_hint’).』 『.get_post_meta($post->ID, ‘hint’, true);
$content = $content . $output;
return $content;
}
}

return $content;
}
add_action(‘the_content’,'pw_hint’,1);[/source]

After

[source lang='php']function pw_hint($content=』") {
load_plugin_textdomain(‘pw_hint_locale’);
global $post;
$p = get_post($post->ID);

if ( !empty($post->post_password) ) { // if there’s a password
if ( !isset($_COOKIE['wp-postpass_'.COOKIEHASH]) || stripslashes($_COOKIE['wp-postpass_'.COOKIEHASH]) != $post->post_password )
{
if(get_post_meta($post->ID, ‘hint’, true) != 』)
$output = __(‘Hint:’,'pw_hint’).』 『.get_post_meta($post->ID, ‘hint’, true);
$content = $content . $output;
echo $content;
}
}
}
//add_action(‘the_content’,'pw_hint’,1);[/source]

然後將佈景裡需要顯示的地方,在檔案相對位置 輸入 <?php pw_hint(); ?>

應該會有 index.php, archive.php, category.php, single.php, search.php…等檔案需要使用。

請依使用需求調整修改