* Pixmicat! Common Library
*
* 存放常用函式供主程式引入
- *
+ *
* @package PMCLibrary
* @version $Id: lib_common.php 690 2009-04-06 01:30:13Z scribe $
* @date $Date: 2009-04-06 09:30:13 +0800 (星期一, 06 四月 2009) $
/* css data */
$style_load = false;
-$style_bar = false;
+$style_bar = '';
if(file_exists(DATA_DIR.CSV_SS)){ // Load FuuR4 CSS data
$style_data = DATA_DIR.CSV_SS;
$jsdonk = 'var style_cookie = "';
$jsdonk .= ($style_bar) ? 'yo_style' : '';
$jsdonk .= '";';
+// http://www.magmagateau.com/fuukaba/ is the source of the code above w
////++++
/* 輸出表頭 */
global $PTE, $PMS, $language, $style_load, $style_bar, $jsdonk;
$title = '';
- // Title from old yotsubanome //++++----
+ // Title code from old yotsubanome //++++---- suigintou v.3.0+ code
if(SHOWTITLEIMG == 1){
$title = '<img src="'.TITLEIMG.'" alt="'.TITLE.'" />';
if(SHOWTITLETXT) $title .= '<br />';
if(SHOWTITLETXT) $title .= '<br />';
}
if(SHOWTITLETXT) $title .= TITLE;
-
+//++++----
$pte_vals = array('{$TITLE}'=>TITLE,'{$TITLEHEAD}'=>$title,'{$TITLECOM}'=>strip_tags(TITLECOM),'{$RESTO}'=>$resno?$resno:'','{$STYLE_LOAD}'=>$style_load,'{$STYLE_BAR}'=>$style_bar,'{$JS_DIR}'=>JS_DIR,'{$CSS_DIR}'=>CSS_DIR,'{$JSDONK}'=>$jsdonk,'{$FAV_ICON}'=>FAV_ICON,'{$LANGUAGE}'=>PIXMICAT_LANGUAGE);
$dat .= $PTE->ParseBlock('HEADER',$pte_vals);
$PMS->useModuleMethods('Head', array(&$dat,$resno)); // "Head" Hook Point
/* 網址自動連結 */
/* オートリンク */
-function auto_link_callback($matches){
+function auto_link_callback($matches){
return (strtolower($matches[3]) == "</a>") ? $matches[0] : preg_replace('/(https?|ftp|news|gopher)(:\/\/[\w\+\$\;\?\.\{\}%,!#~*\/:@&=_-]+)/u', '<a href="$1$2" rel="_blank">$1$2</a>', $matches[0]);
}
function auto_link($proto){
return $_SERVER['REMOTE_ADDR'];
}
-/*css style sheet */
+/* css style sheet */
function format_js_var($var_name){
return("'".$var_name."'");
}
return $apng = FALSE; // not APNG
}
-/* total amount of ommited posts/images */
-function _res($posts, $images=0){
+/* total amount of ommited posts/images */ // suigintou v.3.0+ code
+function _res($posts, $images = 0){
$omitp = ($posts) ? sp(_T('notice_omitted_posts'), $posts) : false;
$omiti = ($images) ? sp(_T('notice_omitted_images'), $images) : false;
return($omitp.$omiti);
if($plu_word) return($plu_word); else return($string);
}
-
+//++++----
+//++++----
/* comment too long function */
// truncate $str to $max_lines lines and return $str and $abbr
// where $abbr = whether or not $str was actually truncated