2009年10月2日

WordPress MU: search or display different blogs content in Master Blog

BEFORE
<?php if (have_posts()) : while (have_posts()) : the_post(); ? >

ADD THIS
<?php switch_to_blog(2); ?>
Define the BLOG ID -> The number in ()

Define how many transaction you need
<?php $recent = new WP_Query("showposts=3"); ?>

-- full code --
<?php 
if(have_posts()) :
$recent = new WP_Query("showposts=3");
while($recent->have_posts()) : $recent->the_post();
?>

2009年9月16日

Customize how many results

in Settings -> Reading
You can set up general amount in

Blog pages show at most 10 post

Otherwise, if you want Customize amountin certain page
insert this code befor Loop

<?php query_posts('showposts=3'); ?>

Search: Define searching post_type

Find The Loop and insert the code before


 // ----- define searching type ----- //
<?php query_posts('post_type=post'); ?>

2009年8月14日

Quicktime 7.4 & Sorenson 3

Apples latest Quicktime 7.4 update disables some ‘legacy’ codecs, specifically Sorenson and Sorenson 3.

If you need to use these codecs, you must enable them

Edit -> Quicktime Preferences -> Advanced

check "Enable encoding using legacy codecs"

2009年7月14日

PHP: active CURL library

1. open php.ini
2. extension=php_curl.dll
3. copy "libeay32.dll" & "ssleay32.dll" to windows/system32
4. restart Apache

2008年7月15日

session start(); 出現error

使用 session start() 時
出現error訊息如下:cannot send session cache limiter-headers already sent (output start at ............)

錯誤訊息的意思是在SESSION開始前就有資料送出到使用者端,一般還有下面幾種情形可供偵錯參考:

1. 引用了UTF-8格式的文件有些UTF-8格式的文件會在文件的開始放入判斷字元(BOM),
啟用PHP.INI的設定output_buffering = 4096

2. 手誤像是少了一個引號、多按了一個空白之類的,所以經常看的到...

2008年7月7日

JavaScript: 開啟視窗

目的: JavaScript 指令來開啟新視窗。 新視窗會顯示別的 HTML 文件。

【程式範例】
window.open('demo.html', 'opennewwindow', config='height=300,width=300')

【程式說明】
window.open('欲開啟的檔案', '新視窗名稱-不能有空格','定義新視窗')

【config指令】
toolbar: 指定要不要有工具列在視窗出現。(工具列包含 "前一頁" "下一頁" "停止" "重 新整理")
menubar: 指定要不要有目錄列在視窗出現。(目錄列包括 "檔案" "編輯" "檢視")
scrollbar: 指定要不要有下拉軸在視窗出現。
resizable: 指定要不要讓訪客可自行種視窗大小。
location: 指定要不要有"輸入網址的那一列"在視窗出現。
directories: 指定要不要有directory bar 在視窗出現。 (像是有 "bookmark" 的那一列)
status: 指定要不要有狀態列在視窗出現。 (最底下的這個列, 常常有人放跑馬燈的地方)

【關閉視窗】
<a onclick="window.close()" href="http://www.blogger.com/">關閉視窗</a>