]> 4ch.mooo.com Git - test.git/blobdiff - lib/lib_common.php
modified: config.php
[test.git] / lib / lib_common.php
index 483556b98d5e5c1495801726aa15261c5b66d6bb..9bacbc95d443a36f609edd3a1f06ab16862b2944 100755 (executable)
@@ -106,14 +106,13 @@ function form(&$dat, $resno, $iscollapse=true, $retURL=PHP_SELF, $name='', $mail
                                '{$FORM_NOATTECHMENT_FIELD}' => '<input type="checkbox" name="noimg" id="noimg" value="on" />');
                        }
        }
-       if(OPTION || USE_UPSERIES){ //++++ more options will be added on later
+       if(OPTION){ //++++ more options will be added on later
                $pte_vals['{$FORM_OPTION1_TEXT}'] = _T('form_option1');
-       }
-       if(USE_UPSERIES){ // 啟動連貼機能
-               $pte_vals['{$FORM_CONTPOST_FIELD}'] = '<input type="checkbox" name="up_series" id="up_series" value="on"'.((isset($_GET["upseries"]) && $resno)?' checked="checked"':'').' />';
-               $pte_vals['{$FORM_CONTPOST_TEXT}'] = _T('form_contpost');
-       }
-       if(OPTION){ //options hook
+               if(USE_UPSERIES){ // 啟動連貼機能
+                       $pte_vals['{$FORM_CONTPOST_FIELD}'] = '<input type="checkbox" name="up_series" id="up_series" value="on"'.((isset($_GET["upseries"]) && $resno)?' checked="checked"':'').' />';
+                       $pte_vals['{$FORM_CONTPOST_TEXT}'] = _T('form_contpost');
+               }
+               // options hook
                $pte_vals['{$FORM_OPTION_HOOK}'] = '';
        }
        if(USE_CATEGORY){
@@ -219,7 +218,7 @@ function str_cut($str, $maxlen=20){
                        $return_str = $return_str.'…';
                        break;
                }
-    }
+       }
        return $return_str;
 }
 
@@ -372,26 +371,21 @@ function sp($string, $value, $shownull = false){
 
        if($plu_word) return($plu_word); else return($string);
 }
+
 //++++----
 //++++----
 /* comment too long function */
-// truncate $str to $max_lines lines and return $str and $abbr
+// truncate $str to $config['LINE_NUMBER'] lines and return $str and $abbr
 // where $abbr = whether or not $str was actually truncated
 function abbreviate($str, $max_lines){
-       if(!defined('MAX_LINES')){
-               if(defined('BR_CHECK')) define('MAX_LINES', BR_CHECK);
-               else define('MAX_LINES', 24);
-
-               $max_lines = MAX_LINES;
-       }
        $lines = explode("<br />", $str);
        if(count($lines) > $max_lines){
                $abbr = 1;
                $lines = array_slice($lines, 0, $max_lines);
                $str = implode("<br />", $lines);
        }else $abbr = 0;
-       //close spans after abbreviating
-       //XXX will not work with more html - use abbreviate_html from shiichan
+       // close spans after abbreviating
+       // XXX will not work with more html - use abbreviate_html from shiichan
        $str .= str_repeat("</span>", substr_count($str, "<span") - substr_count($str, "</span"));
        return array($str, $abbr);
 }