diff --dos -uNr kuzuhaphp.orig/bbs.php kuzuhaphp/bbs.php
--- kuzuhaphp.orig/bbs.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/bbs.php	Fri Apr 01 15:20:20 2005
@@ -242,6 +242,9 @@
   if ($CONF['ADMINPOST'] == '') {
     require_once(PHP_BBSADMIN);
     $bbsadmin = new Bbsadmin();
+    $bbsadmin->procForm();
+    $bbsadmin->refcustom();
+    $bbsadmin->setusersession();
     if ($_POST['ad'] == 'ps') {
       $bbsadmin->prtpass($_POST['ps']);
     }
@@ -475,6 +478,7 @@
    * @return  String  HTMLf[^
    */
   function prthtmlhead($title = "", $customhead = "", $customstyle = "") {
+    $this->t->clearTemplate('header');
     $this->t->addVars('header', array(
       'TITLE' => $title,
       'CUSTOMHEAD' => $customhead,
@@ -646,7 +650,6 @@
     $message['ENVADDR'] = '';
     $message['ENVUA'] = '';
     $message['ENVBR'] = '';
-    $message['ENVLIST'] = '';
     if ($this->c['IPPRINT'] or $this->c['UAPRINT']) {
       if ($this->c['IPPRINT']) {
         $message['ENVADDR'] = $message['PHOST'];
@@ -658,7 +661,13 @@
         $message['ENVBR'] = '<br />';
       }
       if ($message['ENVADDR'] or $message['ENVUA']) {
-        $message['ENVLIST'] = $this->c['TMPL_ENVLIST'];
+        $this->t->clearTemplate('envlist');
+        $this->t->setAttribute("envlist", "visibility", "visible");
+        $this->t->addVars('envlist', array(
+           'ENVADDR' => $message['ENVADDR'],
+           'ENVUA' => $message['ENVUA'],
+           'ENVBR' => $message['ENVBR'],
+        ));
       }
     }
 
@@ -696,7 +705,7 @@
    * @return  String  bZ[WHTMLf[^
    */
   function prtmessage($message, $mode = 0, $tlog = '') {
-    $this->setmessage($message, $mode = 0, $tlog);
+    $this->setmessage($message, $mode, $tlog);
     $prtmessage = $this->t->getParsedTemplate('message');
     return $prtmessage;
   }
@@ -844,7 +853,7 @@
       $this->f['g'] ? $this->c['GZIPU'] = 1 : $this->c['GZIPU'] = 0;
       $this->f['loff'] ? $this->c['LINKOFF'] = 1 : $this->c['LINKOFF'] = 0;
       $this->f['hide'] ? $this->c['HIDEFORM'] = 1 : $this->c['HIDEFORM'] = 0;
-      $this->f['si'] ? $this->c['SHOWIMG'] = 1 : $this->c['SHOWIMG'] = 0;
+      $this->f['sim'] ? $this->c['SHOWIMG'] = 1 : $this->c['SHOWIMG'] = 0;
       if ($this->f['m'] == 'c') {
         $this->f['fw'] ? $this->c['FOLLOWWIN'] = 1 : $this->c['FOLLOWWIN'] = 0;
         $this->f['rt'] ? $this->c['RELTYPE'] = 1 : $this->c['RELTYPE'] = 0;
@@ -1468,7 +1477,10 @@
   function msgsearchlist($mode) {
 
     if ($this->f['ff']) {
-      $fh = @fopen($this->c['OLDLOGFILEDIR'] . $this->f['ff'], "rb");
+      $fh = NULL;
+      if (preg_match("/^[\w.]+$/", $this->f['ff'])) {
+        $fh = @fopen($this->c['OLDLOGFILEDIR'] . $this->f['ff'], "rb");
+      }
       if (!$fh) {
         $this->prterror ("{$this->f['ff']}J܂łB");
       }
@@ -1480,8 +1492,7 @@
     if ($fh) {
       $linecount = 0;
       $threadstart = FALSE;
-      while (!feof ($fh)) {
-        $logline = Func::fgetline(&$fh);
+      while (($logline = Func::fgetline($fh)) !== FALSE) {
         if ($threadstart) {
           $linecount++;
         }
@@ -1919,12 +1930,12 @@
         $this->prterror ('QƋL܂B');
       }
       $refmessage = $this->getmessage($refdata[0]);
-      $refmessage['wdate'] = Func::getdatestr($refmessage['ndate'], $this->c['DATEFORMAT']);
-      $message['MSG'] .= "\r\r<a href=\"m=f&s={$message['REFID']}&r=&\">QlF{$refmessage['wdate']}</a>";
+      $refmessage['WDATE'] = Func::getdatestr($refmessage['NDATE'], $this->c['DATEFORMAT']);
+      $message['MSG'] .= "\r\r<a href=\"m=f&s={$message['REFID']}&r=&\">QlF{$refmessage['WDATE']}</a>";
 
       # ȈՎ쎩h~@\
       if ($this->c['IPREC'] and $this->c['SHOW_SELFFOLLOW']
-        and $refmessage['phost'] != '' and $refmessage['phost'] == $message['PHOST']) {
+        and $refmessage['PHOST'] != '' and $refmessage['PHOST'] == $message['PHOST']) {
         $message['USER'] .= '<span class="muh">iȃXj</span>';
       }
     }
@@ -1962,8 +1973,8 @@
     fseek ($fh, 0, 0);
 
     $logdata = array();
-    while (!feof ($fh)) {
-       $logdata[] = Func::fgetline(&$fh);
+    while (($logline = Func::fgetline($fh)) !== FALSE) {
+       $logdata[] = $logline;
     }
 
     $posterr = 0;
@@ -2638,13 +2649,18 @@
       return $value;
     }
 
-    $value = strtr($value, "+", " ");
+    #$value = strtr($value, "+", " ");
+
+    if (get_magic_quotes_gpc()) {
+      $value = stripslashes($value);
+    }
 
     # ꎞIEUCɕϊĕ
     if (!preg_match("/^\w+$/", $value)) {
-      $value_euc = JcodeConvert($value, 2, 1);
-      $value_euc = htmlentities($value_euc, ENT_QUOTES, 'EUC-JP');
-      $value = JcodeConvert($value_euc, 1, 2);
+      #$value_euc = JcodeConvert($value, 2, 1);
+      #$value_euc = htmlentities($value_euc, ENT_QUOTES, 'EUC-JP');
+      #$value = JcodeConvert($value_euc, 1, 2);
+      $value = htmlspecialchars($value, ENT_QUOTES);
     }
 
     $value = str_replace("\015\012", "\015", $value);
@@ -2652,9 +2668,9 @@
     $value = str_replace("\015$", "", $value);
 
     $value = str_replace(",", "&#44;", $value);
-    $value = str_replace("\\&quot;", "&quot;", $value);
+    #$value = str_replace("\\&quot;", "&quot;", $value);
 
-    $value = stripslashes($value);
+    #$value = stripslashes($value);
     return $value;
   }
 
@@ -2675,10 +2691,12 @@
 
     # ꎞIEUCɕϊĕ
     if (!preg_match("/^\w+$/", $value)) {
-      $value_euc = JcodeConvert($value, 2, 1);
-      $value_euc = strtr($value_euc, array_flip(get_html_translation_table(HTML_ENTITIES)));
-      $value_euc = preg_replace("/&#([0-9]+);/me", "chr('\\1')", $value_euc);
-      $value = JcodeConvert($value_euc, 1, 2);
+      #$value_euc = JcodeConvert($value, 2, 1);
+      #$value_euc = strtr($value_euc, array_flip(get_html_translation_table(HTML_ENTITIES)));
+      #$value_euc = preg_replace("/&#([0-9]+);/me", "chr('\\1')", $value_euc);
+      #$value = JcodeConvert($value_euc, 1, 2);
+      $value = strtr($value, array_flip(get_html_translation_table(HTML_ENTITIES)));
+      $value = preg_replace("/&#([0-9]+);/me", "chr('\\1')", $value);
     }
     return $value;
   }
@@ -2855,10 +2873,11 @@
    */
   function fgetline(&$fh, $maxbuffersize = 16000) {
     $line = '';
-    while (!feof($fh) and strrpos($line, "\n") === FALSE) {
+    do {
       $line .= fgets($fh, $maxbuffersize);
-    }
-    return $line;
+    } while (strrpos($line, "\n") === FALSE and !feof($fh));
+    
+    return strlen ($line) == 0 ? FALSE : $line;
   }
 
 
diff --dos -uNr kuzuhaphp.orig/conf.php kuzuhaphp/conf.php
--- kuzuhaphp.orig/conf.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/conf.php	Fri Apr 01 15:20:20 2005
@@ -20,7 +20,7 @@
   #------------------------- t@CƃfBNg -------------------------
 
   # Ot@C
-  'LOGFILENAME' => './bbs2.log',
+  'LOGFILENAME' => './bbs.log',
 
   # ߋOۑpfBNg̖O
   # (Ō/ĂB̏ꍇ͉ߋOۑ܂)
@@ -274,21 +274,21 @@
 ',
 
   # bZ[Wev[g
-  'TMPL_MSG' => '
-<div class="m" id="m{val postid}">
-  <span class="nw"><span class="ms">{val title}</span>&nbsp;&nbsp;<span class="mu">eҁF<span class="mun">{val user}</span></span>&nbsp;
-  &nbsp;<span class="md">eF{val wdate}<a name="a{val postid}" id="a{val postid}">&nbsp;</a>
-  {val btn}</span></span>
-  <blockquote>
-    <pre>{val msg}</pre>
-  </blockquote>
-{val envlist}</div>
-
-<hr /><!--  -->
-',
+#  'TMPL_MSG' => '
+#<div class="m" id="m{val postid}">
+#  <span class="nw"><span class="ms">{val title}</span>&nbsp;&nbsp;<span class="mu">eҁF<span class="mun">{val user}</span></span>&nbsp;
+#  &nbsp;<span class="md">eF{val wdate}<a name="a{val postid}" id="a{val postid}">&nbsp;</a>
+#  {val btn}</span></span>
+#  <blockquote>
+#    <pre>{val msg}</pre>
+#  </blockquote>
+#{val envlist}</div>
+#
+#<hr /><!--  -->
+#',
 
   # ϐ\ev[g
-  'TMPL_ENVLIST' => "<div class=\"env\">{val envaddr}{val envbr}{val envua}</div>\n",
+#  'TMPL_ENVLIST' => "<div class=\"env\">{val envaddr}{val envbr}{val envua}</div>\n",
 
   #------------------------- ANZXȂ -------------------------
 
diff --dos -uNr kuzuhaphp.orig/sub/bbsadmin.php kuzuhaphp/sub/bbsadmin.php
--- kuzuhaphp.orig/sub/bbsadmin.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/bbsadmin.php	Fri Apr 01 15:20:20 2005
@@ -191,8 +191,8 @@
     fseek ($fh, 0, 0);
 
     $logdata = array();
-    while (!feof ($fh)) {
-       $logdata[] = Func::fgetline(&$fh);
+    while (($logline = Func::fgetline($fh)) !== FALSE) {
+       $logdata[] = $logline;
     }
 
     $killntimes = array();
@@ -251,8 +251,7 @@
 
           if ($this->c['OLDLOGFMT']) {
             $needle = $killntimes[$killid] . "," . $killid . ",";
-            while (!feof ($fh)) {
-              $logline = Func::fgetline(&$fh);
+            while (($logline = Func::fgetline($fh)) !== FALSE) {
               if (!$hit and strpos($logline, $needle) !== FALSE and strpos($logline, $needle) == 0) {
                 $hit = TRUE;
               }
@@ -264,8 +263,7 @@
           else {
             $needle = "<div class=\"m\" id=\"m{$killid}\">";
             $flgbuffer = FALSE;
-            while (!feof ($fh)) {
-              $htmlline = Func::fgetline(&$fh);
+            while (($htmlline = Func::fgetline($fh)) !== FALSE) {
 
               # bZ[W̊Jn
               if (!$hit and strpos($htmlline, $needle) !== FALSE) {
diff --dos -uNr kuzuhaphp.orig/sub/bbsezweb.php kuzuhaphp/sub/bbsezweb.php
--- kuzuhaphp.orig/sub/bbsezweb.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/bbsezweb.php	Fri Apr 01 15:20:20 2005
@@ -34,29 +34,29 @@
 $GLOBALS['CONF_HDML'] = array(
 
   # f̖O
-  'bbstitle' => 'ez@PHP',
+  'BBSTITLE' => 'ez@PHP',
 
   # Pʂɕ\郁bZ[W̕\
-  'msgdisp' => 10,
+  'MSGDISP' => 10,
 
   # y[WTCY
   # Py[W̗eʂw肵oCg(ڈ)𒴂Ȃ悤ɕ\bZ[W܂
-  'ctrl_maxpagesize' => 2200,
+  'CTRL_MAXPAGESIZE' => 2200,
 
   # bZ[WTCYP
   # bZ[Ww肵oCg𒴂ꍇ͈ꕔȗ܂isPʁj
-  'ctrl_maxmsgsize' => 500,
+  'CTRL_MAXMSGSIZE' => 500,
 
   # bZ[WTCYQ
   # bZ[Ww肵oCg𒴂ꍇ͊Sɕ\܂
-  'ctrl_limitmsgsize' => 1200,
+  'CTRL_LIMITMSGSIZE' => 1200,
 
   # bZ[Ws
   # bZ[Wws𒴂ꍇ͈ꕔȗ܂
-  'ctrl_maxmsgline' => 10,
+  'CTRL_MAXMSGLINE' => 10,
 
   # bZ[Wev[g
-  'tmpl_msg' => '<br>{val title}{val btn}{val wdate} {val user}<br>{val msg}<br>',
+  'TMPL_MSG' => '<br>{val TITLE}{val BTN}{val WDATE} {val USER}<br>{val MSG}<br>',
 
 );
 
@@ -107,7 +107,7 @@
       $this->setuserenv();
 
       # [
-      if (@$this->c['restrict_mobileip']) {
+      if (@$this->c['RESTRICT_MOBILEIP']) {
         $uatype = Func::get_uatype(TRUE);
         if ($uatype != 'h') {
           $this->prterror ('gђ[ȊOIPAhX̓e͋֎~Ă܂B');
@@ -183,11 +183,11 @@
    */
   function prterror($err_message) {
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
     print <<<__HDML__
-<display name="error" title="{$this->c['bbstitle']}">
+<display name="error" title="{$this->c['BBSTITLE']}">
 <action type="soft1" label="߂" task="prev">
-<action type="accept" label="į" task="go" dest="?m=h{$this->s['tv']}">
+<action type="accept" label="į" task="go" dest="?m=h{$this->s['TV']}">
 G[:{$err_message}
 </display>
 __HDML__;
@@ -226,8 +226,8 @@
   function prthtmlfoot() {
     $htmlstr = '';
 
-    if (@$this->c['show_prctime'] and @$this->s['start_time']) {
-      $duration = Func::microtime_diff($this->s['start_time'], microtime());
+    if (@$this->c['SHOW_PRCTIME'] and @$this->s['START_TIME']) {
+      $duration = Func::microtime_diff($this->s['START_TIME'], microtime());
       $duration = sprintf("%0.3f", $duration);
       #$htmlstr .= '('.$duration.'b)';
     }
@@ -256,7 +256,7 @@
    */
   function setusersession() {
     parent::setusersession();
-    $this->s['tv'] = "&tv=" . base_convert(CURRENT_TIME, 10, 32);
+    $this->s['TV'] = "&tv=" . base_convert(CURRENT_TIME, 10, 32);
   }
 
 
@@ -275,21 +275,21 @@
 
     # JE^
     $counter = '';
-    if ($this->c['show_counter']) {
+    if ($this->c['SHOW_COUNTER']) {
       $counter = $this->counter();
     }
     $mbrcount = $this->mbrcount();
 
     # HTMLwb_o
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
 
     $action_nextpage = '';
 
     # irQ[g{^
     if ($eindex > 0 and $eindex < $lastindex) {
 
-      $query_nextpage = "?m=h&hm=p&p={$this->s['toppostid']}&b={$eindex}&reload=true{$this->s['tv']}";
+      $query_nextpage = "?m=h&hm=p&p={$this->s['TOPPOSTID']}&b={$eindex}&reload=true{$this->s['TV']}";
       if (@$this->f['u']) {
         $query_nextpage .= "&u=".urlencode($this->f['u']);
       }
@@ -303,18 +303,18 @@
 
     # tH[
     print <<<__HDML__
-<display name="bbs" title="{$this->c['bbstitle']}">
-<action type="accept" label="XV" task="go" dest="?m=h{$this->s['tv']}">
+<display name="bbs" title="{$this->c['BBSTITLE']}">
+<action type="accept" label="XV" task="go" dest="?m=h{$this->s['TV']}">
 $action_nextpage
-<a accesskey="7" label="XV" task="go" dest="?m=h{$this->s['tv']}">R</a>
+<a accesskey="7" label="XV" task="go" dest="?m=h{$this->s['TV']}">R</a>
 __HDML__;
-    if ($this->c['show_readnewbtn']) {
+    if ($this->c['SHOW_READNEWBTN']) {
       print "<a accesskey=\"0\" label=\"\" task=\"go\""
-      ." dest=\"?m=h&hm=p&p={$this->s['toppostid']}&readnew=true{$this->s['tv']}\"></a>";
+      ." dest=\"?m=h&hm=p&p={$this->s['TOPPOSTID']}&readnew=true{$this->s['TV']}\"></a>";
     }
     if (1) {
       print "<a accesskey=\"9\" label=\"e\" task=\"go\""
-      ." dest=\"?m=h&hm=p&write=true{$this->s['tv']}\"></a>";
+      ." dest=\"?m=h&hm=p&write=true{$this->s['TV']}\"></a>";
     }
     print "{$mbrcount}<br>";
 
@@ -368,86 +368,86 @@
       return;
     }
 
-    if (strlen($message['msg']) > $this->c['ctrl_limitmsgsize']) {
+    if (strlen($message['MSG']) > $this->c['CTRL_LIMITMSGSIZE']) {
       return;
     }
 
-    $message['wdate'] = date("H:i:s", $message['ndate']);
+    $message['WDATE'] = date("H:i:s", $message['NDATE']);
 
     # Ql̏
-    $message['msg'] = preg_replace("/<a href=[^>]+>QlF[^<]+<\/a>/i", "", $message['msg'], 1);
+    $message['MSG'] = preg_replace("/<a href=[^>]+>QlF[^<]+<\/a>/i", "", $message['MSG'], 1);
 
     # ^Ȍ
-    $message['msg'] = preg_replace("/<[^>]+>/", "", $message['msg']);
-    $message['user'] = preg_replace("/<[^>]+>/", "", $message['user']);
+    $message['MSG'] = preg_replace("/<[^>]+>/", "", $message['MSG']);
+    $message['USER'] = preg_replace("/<[^>]+>/", "", $message['USER']);
 
-    if ($mode == 0 or ($mode == 1 and $this->c['oldlogbtn'])) {
+    if ($mode == 0 or ($mode == 1 and $this->c['OLDLOGBTN'])) {
 
       # tH[e{^
-      $message['btnfollow'] = '';
-      if ($this->c['bbsmode_adminonly'] != 1) {
-        $message['btnfollow'] = "<a label=\"{$this->c['txtfollow']}\" task=\"go\" dest=\""
-          ."?m=h&hm=f&s={$message['postid']}&p={$this->s['toppostid']}\">{$this->c['txtfollow']}</a>";
+      $message['BTNFOLLOW'] = '';
+      if ($this->c['BBSMODE_ADMINONLY'] != 1) {
+        $message['BTNFOLLOW'] = "<a label=\"{$this->c['TXTFOLLOW']}\" task=\"go\" dest=\""
+          ."?m=h&hm=f&s={$message['POSTID']}&p={$this->s['TOPPOSTID']}\">{$this->c['TXTFOLLOW']}</a>";
       }
 
       # eҌ{^
-      $message['btnauthor'] = "";
-      if ($message['user'] != $this->c['anony_name'] and $this->c['bbsmode_adminonly'] != 1) {
-        $message['btnauthor'] = "<a label=\"{$this->c['txtauthor']}\" task=\"go\" dest=\""
-          ."?m=h&hm=s&s=". urlencode(preg_replace("/<[^>]*>/", '', $message['user'])) ."\">{$this->c['txtauthor']}</a>";
+      $message['BTNAUTHOR'] = "";
+      if ($message['USER'] != $this->c['ANONY_NAME'] and $this->c['BBSMODE_ADMINONLY'] != 1) {
+        $message['BTNAUTHOR'] = "<a label=\"{$this->c['TXTAUTHOR']}\" task=\"go\" dest=\""
+          ."?m=h&hm=s&s=". urlencode(preg_replace("/<[^>]*>/", '', $message['USER'])) ."\">{$this->c['TXTAUTHOR']}</a>";
       }
 
       # Xbh\{^
-      if (!$message['thread']) {
-        $message['thread'] = $message['postid'];
+      if (!$message['THREAD']) {
+        $message['THREAD'] = $message['POSTID'];
       }
-      $message['btnthread'] = '';
-      if ($this->c['bbsmode_adminonly'] != 1) {
-        $message['btnthread'] = "<a label=\"{$this->c['txtthread']}\" task=\"go\" dest=\"?m=h&hm=t&s={$message['thread']}\">{$this->c['txtthread']}</a>";
+      $message['BTNTHREAD'] = '';
+      if ($this->c['BBSMODE_ADMINONLY'] != 1) {
+        $message['BTNTHREAD'] = "<a label=\"{$this->c['TXTTHREAD']}\" task=\"go\" dest=\"?m=h&hm=t&s={$message['THREAD']}\">{$this->c['TXTTHREAD']}</a>";
       }
 
       # {^̓
-      $message['btn'] = "{$message['btnfollow']} {$message['btnthread']}";
+      $message['BTN'] = "{$message['BTNFOLLOW']} {$message['BTNTHREAD']}";
     }
 
     # [AhX
-    if (@$message['mail']) {
-      $message['user'] = "<a label=\"".'Ұ'."\" task=\"go\" dest=\"mailto:{$message['mail']}\">{$message['user']}</a>";
+    if (@$message['MAIL']) {
+      $message['USER'] = "<a label=\"".'Ұ'."\" task=\"go\" dest=\"mailto:{$message['MAIL']}\">{$message['USER']}</a>";
     }
 
     # ̓eҖ͔\
-    if ($message['user'] == $this->c['anony_name']) {
-      $message['user'] = '';
+    if ($message['USER'] == $this->c['ANONY_NAME']) {
+      $message['USER'] = '';
     }
 
     # tH[L̑薼͔\
-    if ($message['title'] == "{$this->c['anony_name']}") {
-      $message['title'] = '';
+    if ($message['TITLE'] == "{$this->c['ANONY_NAME']}") {
+      $message['TITLE'] = '';
     }
 
     # ÕX
-    #$message['msg'] = preg_replace("/(^|\r)&gt; &gt; [^\r]*\r/", "", $message['msg']);
+    #$message['MSG'] = preg_replace("/(^|\r)&gt; &gt; [^\r]*\r/", "", $message['MSG']);
 
-    $message['msg'] = trim ($message['msg']);
+    $message['MSG'] = trim ($message['MSG']);
 
     # ȗisƃoCgŔBPsڂƌ̍scĒ`j
     if ($abbreviate) {
-      $messagelines = explode("\r", $message['msg']);
-      if (count($messagelines) > $this->c['ctrl_maxmsgline'] or strlen ($message['msg']) > $this->c['ctrl_maxmsgsize']) {
-        $message['msg'] = array_shift($messagelines);
-        $testbuffer = $message['msg'];
+      $messagelines = explode("\r", $message['MSG']);
+      if (count($messagelines) > $this->c['CTRL_MAXMSGLINE'] or strlen ($message['MSG']) > $this->c['CTRL_MAXMSGSIZE']) {
+        $message['MSG'] = array_shift($messagelines);
+        $testbuffer = $message['MSG'];
         $abbcount = 0;
 
         # s
-        if (count($messagelines) > $this->c['ctrl_maxmsgline']) {
-          $abbcount = count($messagelines) - $this->c['ctrl_maxmsgline'] + 1;
-          array_splice($messagelines, 0, count($messagelines) - $this->c['ctrl_maxmsgline'] + 1);
+        if (count($messagelines) > $this->c['CTRL_MAXMSGLINE']) {
+          $abbcount = count($messagelines) - $this->c['CTRL_MAXMSGLINE'] + 1;
+          array_splice($messagelines, 0, count($messagelines) - $this->c['CTRL_MAXMSGLINE'] + 1);
         }
 
         # oCg
         for ($i = count($messagelines)-1; $i > 0; $i--) {
           $testbuffer .= $messagelines[$i];
-          if (strlen($testbuffer) > $this->c['ctrl_maxmsgsize']) {
+          if (strlen($testbuffer) > $this->c['CTRL_MAXMSGSIZE']) {
             $abbcount += $i + 1;
             array_splice($messagelines, 0, $i + 1);
             break;
@@ -456,20 +456,20 @@
 
         # ȗN
         if ($abbcount > 0) {
-          $message['msg'] .= "\r<a label=\"\" task=\"go\" dest=\"?m=h&hm=o&s={$message['postid']}\">[".$abbcount."sȗ]</a>";
+          $message['MSG'] .= "\r<a label=\"\" task=\"go\" dest=\"?m=h&hm=o&s={$message['POSTID']}\">[".$abbcount."sȗ]</a>";
         }
-        $message['msg'] .= "\r" . implode("\r", $messagelines);
+        $message['MSG'] .= "\r" . implode("\r", $messagelines);
       }
     }
 
     # 摜BBS̉摜\
-    $message['msg'] = Func::conv_imgtag($message['msg']);
+    $message['MSG'] = Func::conv_imgtag($message['MSG']);
 
-    $message['msg'] = str_replace("\r", '<br>', $message['msg']);
+    $message['MSG'] = str_replace("\r", '<br>', $message['MSG']);
     $this->hdml_escape($message);
 
     # bZ[W\e`
-    $prtmessage = $this->c['tmpl_msg'];
+    $prtmessage = $this->c['TMPL_MSG'];
     while (preg_match('/\{val (\w+)\}/', $prtmessage, $match)) {
       $prtmessage = str_replace($match[0], @$message[$match[1]], $prtmessage);
     }
@@ -502,7 +502,7 @@
 
     # HTMLwb_o
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
     print <<<__HDML__
 <nodisplay name="cd_vars">
 <action type="accept" task="gosub" vars="v={$dmsg}&u={$formu}&i={$formi}&t={$dtitle}" dest="#cd_form">
@@ -510,9 +510,9 @@
 
 <display name="cd_form">
 <action type="soft1" label="߂" task="prev">
-<action type="accept" label="į" task="go" dest="?m=h{$this->s['tv']}">
-<a task="go" label="e" dest="{$this->c['cgiurl']}" method="post"
-postdata="m=h&hm=w&p={$this->s['toppostid']}&pc={$pcode}&f={$dfid}&s={$dsid}&v=$(v:esc)&u=$(u:esc)&i=$(i:esc)&t=$(t:esc)">e</a>
+<action type="accept" label="į" task="go" dest="?m=h{$this->s['TV']}">
+<a task="go" label="e" dest="{$this->c['CGIURL']}" method="post"
+postdata="m=h&hm=w&p={$this->s['TOPPOSTID']}&pc={$pcode}&f={$dfid}&s={$dsid}&v=$(v:esc)&u=$(u:esc)&i=$(i:esc)&t=$(t:esc)">e</a>
 <a task="go" label="reset" dest="#cd_vars"></a>
 <br>
 <wrap>e<a task="go" label="e" dest="#cd_v">$(v:esc)</a>
@@ -557,7 +557,7 @@
       $this->prterror ( 'p[^܂B' );
     }
 
-    $result = $this->searchmessage('postid', @$this->f['s']);
+    $result = $this->searchmessage('POSTID', @$this->f['s']);
 
     if (!$result) {
       $this->prterror ( 'w肳ꂽbZ[W܂B' );
@@ -566,11 +566,11 @@
     $message = $this->getmessage($result[0]);
 
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
     print <<<__HDML__
-<display name="message" title="{$this->c['bbstitle']}">
+<display name="message" title="{$this->c['BBSTITLE']}">
 <action type="soft1" label="߂" task="prev">
-<action type="accept" label="į" task="go" dest="?m=h{$this->s['tv']}">
+<action type="accept" label="į" task="go" dest="?m=h{$this->s['TV']}">
 __HDML__;
     print $this->prtmessage($message, 0, 0, FALSE);
     print '</display>';
@@ -599,11 +599,11 @@
     }
 
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
     print <<<__HDML__
-<display name="search" title="{$this->c['bbstitle']}">
+<display name="search" title="{$this->c['BBSTITLE']}">
 <action type="soft1" label="߂" task="prev">
-<action type="accept" label="į" task="go" dest="?m=h{$this->s['tv']}">
+<action type="accept" label="į" task="go" dest="?m=h{$this->s['TV']}">
 __HDML__;
 
     $result = $this->msgsearchlist($mode);
@@ -625,7 +625,7 @@
       $msgrange = 0;
       for ($i = 0; $i < count($result); $i++) {
         $testbuffer .= $this->prtmessage($result[$i], $mode);
-        if (strlen($testbuffer) > $this->c['ctrl_maxpagesize'] - 1000) {
+        if (strlen($testbuffer) > $this->c['CTRL_MAXPAGESIZE'] - 1000) {
           $eindex = $bindex + $i;
           $abbreviated = TRUE;
           break;
@@ -641,7 +641,7 @@
     $success = count($result);
 
     if ($abbreviated) {
-      print '<a accesskey="5" label="" task="go" dest="?m=h&hm=t&s='.$this->f['s']."&b={$eindex}{$this->s['tv']}\"></a>";
+      print '<a accesskey="5" label="" task="go" dest="?m=h&hm=t&s='.$this->f['s']."&b={$eindex}{$this->s['TV']}\"></a>";
     }
 
     print '</display>';
@@ -661,11 +661,11 @@
   function prthelp() {
 
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
     print <<<__HDML__
-<display name="help" title="{$this->c['bbstitle']}">
+<display name="help" title="{$this->c['BBSTITLE']}">
 <action type="soft1" label="߂" task="prev">
-<action type="accept" label="į" task="go" dest="?m=h{$this->s['tv']}">
+<action type="accept" label="į" task="go" dest="?m=h{$this->s['TV']}">
 ꗗ<br><br>[5] y[W<br>[7] [h<br>[9] e<br>
 </display>
 __HDML__;
diff --dos -uNr kuzuhaphp.orig/sub/bbsimode.php kuzuhaphp/sub/bbsimode.php
--- kuzuhaphp.orig/sub/bbsimode.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/bbsimode.php	Fri Apr 01 15:20:20 2005
@@ -28,51 +28,51 @@
 $GLOBALS['CONF_IMODE'] = array(
 
   # f̖O
-  'bbstitle' => 'i@PHP',
+  'BBSTITLE' => 'i@PHP',
 
   # Pʂɕ\郁bZ[W̕\
-  'msgdisp' => 10,
+  'MSGDISP' => 10,
 
   # y[WTCY
   # Py[W̗eʂw肵oCg(ڈ)𒴂Ȃ悤ɕ\bZ[W܂
-  'ctrl_maxpagesize' => 4000,
+  'CTRL_MAXPAGESIZE' => 4000,
 
   # bZ[WTCYP
   # bZ[Ww肵oCg𒴂ꍇ͈ꕔȗ܂isPʁj
-  'ctrl_maxmsgsize' => 800,
+  'CTRL_MAXMSGSIZE' => 800,
 
   # bZ[WTCYQ
   # bZ[Ww肵oCg𒴂ꍇ͊Sɕ\܂
-  'ctrl_limitmsgsize' => 3000,
+  'CTRL_LIMITMSGSIZE' => 3000,
 
   # bZ[Ws
   # bZ[Wws𒴂ꍇ͈ꕔȗ܂
-  'ctrl_maxmsgline' => 10,
+  'CTRL_MAXMSGLINE' => 10,
 
   # wiF
-  'c_background' => '004040',
+  'C_BACKGROUND' => '004040',
 
   # eLXgF
-  'c_text' => 'ffffff',
+  'C_TEXT' => 'ffffff',
 
   # NF
-  'c_a_color' => 'cccccc',
+  'C_A_COLOR' => 'cccccc',
 
   # pbZ[W̐F
   # iFςȂꍇ͋ɂĂj
-  'c_qmsg' => 'cccccc',
+  'C_QMSG' => 'cccccc',
 
   # G[bZ[W̐F
-  'c_error' => 'ffffff',
+  'C_ERROR' => 'ffffff',
 
   # tH[eʃ{^ɕ\镶
-  'txtfollow' => '',
+  'TXTFOLLOW' => '',
 
   # Xbh\{^ɕ\镶
-  'txtthread' => '',
+  'TXTTHREAD' => '',
 
   # bZ[Wev[g
-  'tmpl_msg' => "{val title}{val btn}{val wdate} {val user}\r{val msg}\r\r",
+  'TMPL_MSG' => "{val TITLE}{val BTN}{val WDATE} {val USER}\r{val MSG}\r\r",
 
 );
 
@@ -122,7 +122,7 @@
       $this->setuserenv();
 
       # [
-      if (@$this->c['restrict_mobileip']) {
+      if (@$this->c['RESTRICT_MOBILEIP']) {
         $uatype = Func::get_uatype(TRUE);
         if ($uatype != 'i') {
           $this->prterror ('gђ[ȊOIPAhX̓e͋֎~Ă܂B');
@@ -200,7 +200,7 @@
    */
   function prterror($err_message) {
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
     print "G[:$err_message";
     print $this->prthtmlfoot ();
     $this->destroy();
@@ -222,7 +222,7 @@
    */
   function prthtmlhead($title = "", $customhead = "") {
     $htmlstr = "<html><head><title>$title</title></head>"
-     . "<body bgcolor=\"#{$this->c['c_background']}\" text=\"#{$this->c['c_text']}\" link=\"#{$this->c['c_a_color']}\">";
+     . "<body bgcolor=\"#{$this->c['C_BACKGROUND']}\" text=\"#{$this->c['C_TEXT']}\" link=\"#{$this->c['C_A_COLOR']}\">";
     return $htmlstr;
   }
 
@@ -239,8 +239,8 @@
   function prthtmlfoot() {
     $htmlstr = '';
 
-    if (@$this->c['show_prctime'] and @$this->s['start_time']) {
-      $duration = Func::microtime_diff($this->s['start_time'], microtime());
+    if (@$this->c['SHOW_PRCTIME'] and @$this->s['START_TIME']) {
+      $duration = Func::microtime_diff($this->s['START_TIME'], microtime());
       $duration = sprintf("%0.3f", $duration);
       $htmlstr .= '('.$duration.'b)';
     }
@@ -265,35 +265,35 @@
 
     # JE^
     $counter = '';
-    if ($this->c['show_counter']) {
+    if ($this->c['SHOW_COUNTER']) {
       $counter = $this->counter();
     }
     $mbrcount = '';
-    if ($this->c['cntfilename']) {
+    if ($this->c['CNTFILENAME']) {
       $mbrcount = $this->mbrcount()."";
     }
 
     # HTMLwb_o
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
 
     # tH[
     print <<<__IMODE__
 <a name="t"><a href="#b" accesskey="2"></a></a>
-<form method="post" action="{$this->c['cgiurl']}">
+<form method="post" action="{$this->c['CGIURL']}">
 <input type="hidden" name="m" value="i" />
 <input type="hidden" name="im" value="p" />
-<input type="hidden" name="p" value="{$this->s['toppostid']}" />
+<input type="hidden" name="p" value="{$this->s['TOPPOSTID']}" />
 <input type="submit" name="read" value="R" accesskey="7" />
 __IMODE__;
-    if ($this->c['show_readnewbtn']) {
+    if ($this->c['SHOW_READNEWBTN']) {
       print '<input type="submit" name="readnew" value="" accesskey="0" />';
     }
-    if ($this->c['bbsmode_adminonly'] == 0) {
+    if ($this->c['BBSMODE_ADMINONLY'] == 0) {
       print '<input type="submit" name="write" value="" accesskey="9" />';
     }
     print <<<__IMODE__
- <input type="text" size="2" name="d" value="{$this->s['msgdisp']}" />
+ <input type="text" size="2" name="d" value="{$this->s['MSGDISP']}" />
  $mbrcount
 __IMODE__;
 
@@ -323,7 +323,7 @@
     print @$msgmore;
 
     # irQ[g{^
-    if (($eindex > 0 and $eindex < $lastindex) or $this->c['bbsmode_adminonly'] != 0) {
+    if (($eindex > 0 and $eindex < $lastindex) or $this->c['BBSMODE_ADMINONLY'] != 0) {
 
       $formc = @$this->f['c'];
       $formd = @$this->f['d'];
@@ -331,17 +331,17 @@
       $formi = @$this->f['i'];
 
       print <<<__IMODE__
-</pre><form method="post" action="{$this->c['cgiurl']}">
+</pre><form method="post" action="{$this->c['CGIURL']}">
 <input type="hidden" name="m" value="i" />
 <input type="hidden" name="im" value="p" />
-<input type="hidden" name="p" value="{$this->s['toppostid']}" />
-<input type="hidden" name="d" value="{$this->s['msgdisp']}" />
+<input type="hidden" name="p" value="{$this->s['TOPPOSTID']}" />
+<input type="hidden" name="d" value="{$this->s['MSGDISP']}" />
 <input type="hidden" name="b" value="$eindex" />
 <input type="submit" name="reload" value="" accesskey="5" />
 __IMODE__;
 
       # Ǘғe
-      if ($this->c['bbsmode_adminonly'] != 0) {
+      if ($this->c['BBSMODE_ADMINONLY'] != 0) {
         print '<br /><br /><input size="2" type="text" name="u" value="'.@$this->f['u'].'" />';
         print '<input type="submit" name="write" value="Ǘ" />';
       }
@@ -355,7 +355,7 @@
     }
 
     print ' <a href="#t" accesskey="2"></a><a name="b">&nbsp;</a><a href="'
-      . $this->c['cgiurl'] . '?m=i&amp;im=h">H</a>';
+      . $this->c['CGIURL'] . '?m=i&amp;im=h">H</a>';
     print $this->prthtmlfoot ();
 
   }
@@ -380,14 +380,14 @@
     # y[W̃oCglĕ\𒲐
 
     # ǃ[h̏ꍇALkďȗs
-    if (@$this->f['readnew'] or ($this->s['msgdisp'] == '0' and $bindex == 0)) {
+    if (@$this->f['readnew'] or ($this->s['MSGDISP'] == '0' and $bindex == 0)) {
       $testbuffer = '';
       $msgrange = 0;
       for ($i = count($logdatadisp) - 1; $i >= 0; $i--) {
         $testbuffer .= $this->prtmessage($this->getmessage($logdatadisp[$i], 0, 0));
-        if (strlen($testbuffer) > $this->c['ctrl_maxpagesize'] - 1000) {
+        if (strlen($testbuffer) > $this->c['CTRL_MAXPAGESIZE'] - 1000) {
           $message = $this->getmessage($logdatadisp[$i + 1]);
-          $this->s['toppostid'] = $message['postid'];
+          $this->s['TOPPOSTID'] = $message['POSTID'];
           $bindex = $eindex - $msgrange + 1;
           break;
         }
@@ -401,7 +401,7 @@
       $msgrange = 0;
       for ($i = 0; $i < count($logdatadisp); $i++) {
         $testbuffer .= $this->prtmessage($this->getmessage($logdatadisp[$i], 0, 0));
-        if (strlen($testbuffer) > $this->c['ctrl_maxpagesize'] - 1000) {
+        if (strlen($testbuffer) > $this->c['CTRL_MAXPAGESIZE'] - 1000) {
           $eindex = $bindex + $i - 1;
           break;
         }
@@ -440,91 +440,91 @@
       return;
     }
 
-    if (strlen($message['msg']) > $this->c['ctrl_limitmsgsize']) {
+    if (strlen($message['MSG']) > $this->c['CTRL_LIMITMSGSIZE']) {
       return;
     }
 
-    $message['wdate'] = date("H:i:s", $message['ndate']);
+    $message['WDATE'] = date("H:i:s", $message['NDATE']);
 
     # Ql̏
-    $message['msg'] = preg_replace("/<a href=[^>]+>QlF[^<]+<\/a>/i", "", $message['msg'], 1);
+    $message['MSG'] = preg_replace("/<a href=[^>]+>QlF[^<]+<\/a>/i", "", $message['MSG'], 1);
 
-    if ($mode == 0 or ($mode == 1 and $this->c['oldlogbtn'])) {
+    if ($mode == 0 or ($mode == 1 and $this->c['OLDLOGBTN'])) {
 
       # tH[e{^
-      $message['btnfollow'] = '';
-      if ($this->c['bbsmode_adminonly'] != 1) {
-        $message['btnfollow'] = "<a href=\"{$this->c['cgiurl']}"
-          ."?m=i&amp;im=f&amp;s={$message['postid']}&amp;p={$this->s['toppostid']}\">{$this->c['txtfollow']}</a>";
+      $message['BTNFOLLOW'] = '';
+      if ($this->c['BBSMODE_ADMINONLY'] != 1) {
+        $message['BTNFOLLOW'] = "<a href=\"{$this->c['CGIURL']}"
+          ."?m=i&amp;im=f&amp;s={$message['POSTID']}&amp;p={$this->s['TOPPOSTID']}\">{$this->c['TXTFOLLOW']}</a>";
       }
 
       # eҌ{^
-      $message['btnauthor'] = "";
-      if ($message['user'] != $this->c['anony_name'] and $this->c['bbsmode_adminonly'] != 1) {
-        $message['btnauthor'] = "<a href=\"{$this->c['cgiurl']}"
-          ."?m=i&amp;im=s&amp;s=". urlencode(preg_replace("/<[^>]*>/", '', $message['user'])) ."\">{$this->c['txtauthor']}</a>";
+      $message['BTNAUTHOR'] = "";
+      if ($message['USER'] != $this->c['ANONY_NAME'] and $this->c['BBSMODE_ADMINONLY'] != 1) {
+        $message['BTNAUTHOR'] = "<a href=\"{$this->c['CGIURL']}"
+          ."?m=i&amp;im=s&amp;s=". urlencode(preg_replace("/<[^>]*>/", '', $message['USER'])) ."\">{$this->c['TXTAUTHOR']}</a>";
       }
 
       # Xbh\{^
-      if (!$message['thread']) {
-        $message['thread'] = $message['postid'];
+      if (!$message['THREAD']) {
+        $message['THREAD'] = $message['POSTID'];
       }
-      $message['btnthread'] = '';
-      if ($this->c['bbsmode_adminonly'] != 1) {
-        $message['btnthread'] = "<a href=\"{$this->c['cgiurl']}?m=i&amp;im=t&amp;s={$message['thread']}\">{$this->c['txtthread']}</a>";
+      $message['BTNTHREAD'] = '';
+      if ($this->c['BBSMODE_ADMINONLY'] != 1) {
+        $message['BTNTHREAD'] = "<a href=\"{$this->c['CGIURL']}?m=i&amp;im=t&amp;s={$message['THREAD']}\">{$this->c['TXTTHREAD']}</a>";
       }
 
       # {^̓
-      $message['btn'] = "{$message['btnfollow']} {$message['btnthread']}";
+      $message['BTN'] = "{$message['BTNFOLLOW']} {$message['BTNTHREAD']}";
     }
 
     # [AhX
-    if (@$message['mail']) {
-      $message['user'] = "<a href=\"mailto:{$message['mail']}\">{$message['user']}</a>";
+    if (@$message['MAIL']) {
+      $message['USER'] = "<a href=\"mailto:{$message['MAIL']}\">{$message['USER']}</a>";
     }
 
     # ̓eҖ͔\
-    if ($message['user'] == $this->c['anony_name']) {
-      $message['user'] = '';
+    if ($message['USER'] == $this->c['ANONY_NAME']) {
+      $message['USER'] = '';
     }
 
     # 󔒂̑薼͔\
-    if ($message['title'] == " ") {
-      $message['title'] = '';
+    if ($message['TITLE'] == " ") {
+      $message['TITLE'] = '';
     }
 
     # tH[L̑薼͔\
-    if ($message['title'] == "{$this->c['anony_name']}{$this->c['fsubj']}") {
-      $message['title'] = '';
+    if ($message['TITLE'] == "{$this->c['ANONY_NAME']}{$this->c['FSUBJ']}") {
+      $message['TITLE'] = '';
     }
 
     # ÕX
-    #$message['msg'] = preg_replace("/(^|\r)&gt; &gt; [^\r]*\r/", "", $message['msg']);
+    #$message['MSG'] = preg_replace("/(^|\r)&gt; &gt; [^\r]*\r/", "", $message['MSG']);
 
     # pFύX
-    $message['msg'] = preg_replace("/(^|\r)(&gt;[^\r]*)/", "$1<font color=\"#{$this->c['c_qmsg']}\">$2</font>", $message['msg']);
-    $message['msg'] = str_replace("</font>\r<font color=\"#{$this->c['c_qmsg']}\">", "\r", $message['msg']);
+    $message['MSG'] = preg_replace("/(^|\r)(&gt;[^\r]*)/", "$1<font color=\"#{$this->c['C_QMSG']}\">$2</font>", $message['MSG']);
+    $message['MSG'] = str_replace("</font>\r<font color=\"#{$this->c['C_QMSG']}\">", "\r", $message['MSG']);
 
-    $message['msg'] = trim ($message['msg']);
+    $message['MSG'] = trim ($message['MSG']);
 
     # ȗisƃoCgŔBPsڂƌ̍scĒ`j
     if ($abbreviate) {
-      $messagelines = explode("\r", $message['msg']);
-      if (count($messagelines) > $this->c['ctrl_maxmsgline'] or strlen ($message['msg']) > $this->c['ctrl_maxmsgsize']) {
-        $message['msg'] = array_shift($messagelines);
-        $testbuffer = $message['msg'];
+      $messagelines = explode("\r", $message['MSG']);
+      if (count($messagelines) > $this->c['CTRL_MAXMSGLINE'] or strlen ($message['MSG']) > $this->c['CTRL_MAXMSGSIZE']) {
+        $message['MSG'] = array_shift($messagelines);
+        $testbuffer = $message['MSG'];
         $abbcount = 0;
 
         # s
-        if (count($messagelines) > $this->c['ctrl_maxmsgline']) {
-          $abbcount = count($messagelines) - $this->c['ctrl_maxmsgline'] + 1;
-          array_splice($messagelines, 0, count($messagelines) - $this->c['ctrl_maxmsgline'] + 1);
+        if (count($messagelines) > $this->c['CTRL_MAXMSGLINE']) {
+          $abbcount = count($messagelines) - $this->c['CTRL_MAXMSGLINE'] + 1;
+          array_splice($messagelines, 0, count($messagelines) - $this->c['CTRL_MAXMSGLINE'] + 1);
         }
 
         # oCg
         for ($i = count($messagelines)-1; $i > 0; $i--) {
           $testbuffer .= $messagelines[$i];
-          if (strlen($testbuffer) > $this->c['ctrl_maxmsgsize']) {
+          if (strlen($testbuffer) > $this->c['CTRL_MAXMSGSIZE']) {
             $abbcount += $i + 1;
             array_splice($messagelines, 0, $i + 1);
             break;
@@ -533,17 +533,17 @@
 
         # ȗN
         if ($abbcount > 0) {
-          $message['msg'] .= "\r<a href=\"{$this->c['cgiurl']}?m=i&amp;im=o&amp;s={$message['postid']}\">[".$abbcount."sȗ]</a>";
+          $message['MSG'] .= "\r<a href=\"{$this->c['CGIURL']}?m=i&amp;im=o&amp;s={$message['POSTID']}\">[".$abbcount."sȗ]</a>";
         }
-        $message['msg'] .= "\r" . implode("\r", $messagelines);
+        $message['MSG'] .= "\r" . implode("\r", $messagelines);
       }
     }
 
     # 摜BBS̉摜\
-    $message['msg'] = Func::conv_imgtag($message['msg']);
+    $message['MSG'] = Func::conv_imgtag($message['MSG']);
 
     # bZ[W\e`
-    $prtmessage = $this->c['tmpl_msg'];
+    $prtmessage = $this->c['TMPL_MSG'];
     while (preg_match('/\{val (\w+)\}/', $prtmessage, $match)) {
       $prtmessage = str_replace($match[0], @$message[$match[1]], $prtmessage);
     }
@@ -567,8 +567,8 @@
   function prtform($dtitle = "", $dmsg = "", $dlink = "", $dfid = "", $dsid = "") {
 
     # ǗlF
-    if (($this->c['bbsmode_adminonly'] == 1 or ($this->c['bbsmode_adminonly'] == 2 and !$dfid))
-      and crypt(@$this->f['u'], $this->c['adminpost']) != $this->c['adminpost']) {
+    if (($this->c['BBSMODE_ADMINONLY'] == 1 or ($this->c['BBSMODE_ADMINONLY'] == 2 and !$dfid))
+      and crypt(@$this->f['u'], $this->c['ADMINPOST']) != $this->c['ADMINPOST']) {
       $this->prterror('pX[hႢ܂B');
     }
 
@@ -580,15 +580,15 @@
 
     # HTMLwb_o
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
-    print "<a href=\"{$this->c['cgiurl']}?m=i\" accesskey=\"1\"></a>";
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
+    print "<a href=\"{$this->c['CGIURL']}?m=i\" accesskey=\"1\"></a>";
 
     print <<<__IMODE__
-<form method="post" action="{$this->c['cgiurl']}">
+<form method="post" action="{$this->c['CGIURL']}">
 <input type="hidden" name="m" value="i" />
 <input type="hidden" name="im" value="w" />
-<input type="hidden" name="p" value="{$this->s['toppostid']}" />
-<input type="hidden" name="d" value="{$this->s['msgdisp']}" />
+<input type="hidden" name="p" value="{$this->s['TOPPOSTID']}" />
+<input type="hidden" name="d" value="{$this->s['MSGDISP']}" />
 <input type="hidden" name="pc" value="$pcode" />
 <input type="submit" name="post" value="e" accesskey="9" />
 <input type="reset" name="reset" value="" accesskey="3" /><br />
@@ -627,7 +627,7 @@
       $this->prterror ( 'p[^܂B' );
     }
 
-    $result = $this->searchmessage('postid', @$this->f['s']);
+    $result = $this->searchmessage('POSTID', @$this->f['s']);
 
     if (!$result) {
       $this->prterror ( 'w肳ꂽbZ[W܂B' );
@@ -636,7 +636,7 @@
     $message = $this->getmessage($result[0]);
 
     if (!$retry) {
-      $formmsg = $message['msg'];
+      $formmsg = $message['MSG'];
       $formmsg = preg_replace ("/&gt; &gt;[^\r]+\r/", "", $formmsg);
       $formmsg = preg_replace ("/<a href=\"m=f\S+\"[^>]*>[^<]+<\/a>/i", "", $formmsg);
       $formmsg = preg_replace ("/<a href=\"[^>]+>([^<]+)<\/a>/i", "$1", $formmsg);
@@ -649,7 +649,7 @@
       $formmsg = preg_replace ("/<a href=\"m=f\S+\"[^>]*>[^<]+<\/a>/i", "", $formmsg);
     }
 
-    $this->prtform ( "".preg_replace("/<[^>]*>/", '', $message['user'])."{$this->c['fsubj']}", "$formmsg\r", '', $message['postid'], @$this->f['s']);
+    $this->prtform ( "".preg_replace("/<[^>]*>/", '', $message['USER'])."{$this->c['FSUBJ']}", "$formmsg\r", '', $message['POSTID'], @$this->f['s']);
 
   }
 
@@ -668,7 +668,7 @@
       $this->prterror ( 'p[^܂B' );
     }
 
-    $result = $this->searchmessage('postid', @$this->f['s']);
+    $result = $this->searchmessage('POSTID', @$this->f['s']);
 
     if (!$result) {
       $this->prterror ( 'w肳ꂽbZ[W܂B' );
@@ -677,8 +677,8 @@
     $message = $this->getmessage($result[0]);
 
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
-    print '<a href="#b"></a><a name="t">&nbsp;</a><a href="'.$this->c['cgiurl'].'?m=i" accesskey="1"></a><pre>';
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
+    print '<a href="#b"></a><a name="t">&nbsp;</a><a href="'.$this->c['CGIURL'].'?m=i" accesskey="1"></a><pre>';
 
     print $this->prtmessage($message, 0, 0, FALSE);
 
@@ -708,8 +708,8 @@
     }
 
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
-    print '<a href="#b"></a><a name="t">&nbsp;</a><a href="'.$this->c['cgiurl'].'?m=i" accesskey="1"></a><pre>';
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
+    print '<a href="#b"></a><a name="t">&nbsp;</a><a href="'.$this->c['CGIURL'].'?m=i" accesskey="1"></a><pre>';
 
     $result = $this->msgsearchlist($mode);
 
@@ -731,7 +731,7 @@
       $msgrange = 0;
       for ($i = 0; $i < count($result); $i++) {
         $testbuffer .= $this->prtmessage($result[$i], $mode);
-        if (strlen($testbuffer) > $this->c['ctrl_maxpagesize'] - 1000) {
+        if (strlen($testbuffer) > $this->c['CTRL_MAXPAGESIZE'] - 1000) {
           $eindex = $bindex + $i;
           $abbreviated = TRUE;
           break;
@@ -768,8 +768,8 @@
   function prthelp() {
 
     $this->sethttpheader();
-    print $this->prthtmlhead ($this->c['bbstitle']);
-    print '<a href="'.$this->c['cgiurl'].'?m=i" accesskey="1"></a> <br />';
+    print $this->prthtmlhead ($this->c['BBSTITLE']);
+    print '<a href="'.$this->c['CGIURL'].'?m=i" accesskey="1"></a> <br />';
     print 'ꗗ<br /><br />[1] ߂<br />[2] ʏ<br />[5] y[W<br />[7] [h<br />[8] ʉ<br />[9] e<br />';
     print $this->prthtmlfoot ();
 
diff --dos -uNr kuzuhaphp.orig/sub/bbslog.php kuzuhaphp/sub/bbslog.php
--- kuzuhaphp.orig/sub/bbslog.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/bbslog.php	Fri Apr 01 15:20:20 2005
@@ -207,7 +207,11 @@
     }
 
     $this->t->addVar('dateform', 'OLDLOGSAVESW', $this->c['OLDLOGSAVESW']);
-    if (!$this->conf['oldlogfmt'] or !$this->conf['oldlogbtn']) {
+    if ($this->c['BBSMODE_IMAGE'] == 1) {
+      if ($this->c['SHOWIMG']) $this->t->addVar('sicheck', 'CHK_SI', ' checked="checked"');
+      $this->t->setAttribute('sicheck', 'visibility', 'visible');
+    }
+    if (!$this->c['OLDLOGFMT'] or !$this->c['OLDLOGBTN']) {
       $this->t->setAttribute("check_bt", "visibility", "hidden");
     }
     if ($this->c['GZIPU']) $this->t->addVar('loglist', 'CHK_G', ' checked="checked"');
@@ -420,8 +424,7 @@
     if ($this->c['OLDLOGFMT']) {
       if (!@$conditions['showall']) {
         $result = 0;
-        while (!feof ($fh)) {
-          $logline = Func::fgetline(&$fh);
+        while (($logline = Func::fgetline($fh)) !== FALSE) {
           $message = $this->getmessage($logline);
           $result = $this->msgsearch($message, $conditions);
           # qbg
@@ -432,16 +435,18 @@
               $needle = "\Q{$conditions['q']}\E";
               $quoteq = preg_quote($conditions['q'], "/");
               if ($conditions['ci']) {
-                $prtmessage = preg_replace("/($quoteq)/i", "<span class=\"sq\">$1</span>", $prtmessage);
-                while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", $prtmessage)) {
-                  $prtmessage = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", "$1", $prtmessage, 1);
-                }
+                #$prtmessage = preg_replace("/($quoteq)/i", "<span class=\"sq\">$1</span>", $prtmessage);
+                #while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", $prtmessage)) {
+                #  $prtmessage = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", "$1", $prtmessage, 1);
+                #}
+                $prtmessage = preg_replace("/((?:\G|>)[^<]*?)($quoteq)/i", "$1<span class=\"sq\">$2</span>", $prtmessage);
               }
               else {
-                $prtmessage = str_replace($conditions['q'], "<span class=\"sq\">{$conditions['q']}</span>", $prtmessage);
-                while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", $prtmessage)) {
-                  $prtmessage = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", "$1", $prtmessage, 1);
-                }
+                #$prtmessage = str_replace($conditions['q'], "<span class=\"sq\">{$conditions['q']}</span>", $prtmessage);
+                #while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", $prtmessage)) {
+                #  $prtmessage = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", "$1", $prtmessage, 1);
+                #}
+                $prtmessage = preg_replace("/((?:\G|>)[^<]*?)($quoteq)/", "$1<span class=\"sq\">$2</span>", $prtmessage);
               }
             }
             print $prtmessage;
@@ -455,8 +460,7 @@
       }
       # S\
       else {
-        while (!feof ($fh)) {
-          $logline = Func::fgetline(&$fh);
+        while (($logline = Func::fgetline($fh)) !== FALSE) {
           $messagestr = $this->prtmessage($this->getmessage($logline), $msgmode, $filename);
           print $messagestr;
         }
@@ -469,8 +473,7 @@
         $buffer = "";
         $flgbuffer = FALSE;
         $result = 0;
-        while (!feof ($fh)) {
-          $htmlline = Func::fgetline(&$fh);
+        while (($htmlline = Func::fgetline($fh)) !== FALSE) {
           # bZ[W̊Jn
           if (!$flgbuffer and preg_match("/<div [^>]*id=\"m\d+\"[^>]*>/", $htmlline)) {
             $buffer = $htmlline;
@@ -487,16 +490,18 @@
                   $needle = "\Q{$conditions['q']}\E";
                   $quoteq = preg_quote($conditions['q'], "/");
                   if ($conditions['ci']) {
-                    $buffer = preg_replace("/($quoteq)/i", "<span class=\"sq\">$1</span>", $buffer);
-                    while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", $buffer)) {
-                      $buffer = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", "$1", $buffer, 1);
-                    }
+                    #$buffer = preg_replace("/($quoteq)/i", "<span class=\"sq\">$1</span>", $buffer);
+                    #while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", $buffer)) {
+                    #  $buffer = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/i", "$1", $buffer, 1);
+                    #}
+                    $buffer = preg_replace("/((?:\G|>)[^<]*?)($quoteq)/i", "$1<span class=\"sq\">$2</span>", $buffer);
                   }
                   else {
-                    $buffer = str_replace($conditions['q'], "<span class=\"sq\">{$conditions['q']}</span>", $buffer);
-                    while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", $buffer)) {
-                      $buffer = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", "$1", $buffer, 1);
-                    }
+                    #$buffer = str_replace($conditions['q'], "<span class=\"sq\">{$conditions['q']}</span>", $buffer);
+                    #while (preg_match("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", $buffer)) {
+                    #  $buffer = preg_replace("/(<[^<>]*)<span class=\"sq\">$quoteq<\/span>/", "$1", $buffer, 1);
+                    #}
+                    $buffer = preg_replace("/((?:\G|>)[^<]*?)($quoteq)/", "$1<span class=\"sq\">$2</span>", $buffer);
                   }
                 }
                 print $buffer;
@@ -519,8 +524,7 @@
         }
       }
       else {
-        while (!feof ($fh)) {
-          $htmlline = Func::fgetline(&$fh);
+        while (($htmlline = Func::fgetline($fh)) !== FALSE) {
           print $htmlline;
         }
       }
@@ -534,9 +538,10 @@
         #$resultmsg = "{$filename}F&nbsp;{$timerangestr}&nbsp;";
         if (@$conditions['q'] != '') {
           $value = $conditions['q'];
-          $value_euc = JcodeConvert($value, 2, 1);
-          $value_euc = htmlentities($value_euc, ENT_QUOTES, 'EUC-JP');
-          $value = JcodeConvert($value_euc, 1, 2);
+          #$value_euc = JcodeConvert($value, 2, 1);
+          #$value_euc = htmlentities($value_euc, ENT_QUOTES, 'EUC-JP');
+          #$value = JcodeConvert($value_euc, 1, 2);
+          $value = htmlspecialchars($value, ENT_QUOTES);
           $resultmsg .= 'u' . $value . 'v';
         }
         if ($resultcount > 0) {
@@ -545,10 +550,10 @@
         else {
           $resultmsg .= '܂łB';
         }
+        #print $resultmsg;
+        $this->t->addVar('oldlog_lower', 'RESULTMSG', $resultmsg);
+        $this->t->displayParsedTemplate('oldlog_lower');
       }
-      print $resultmsg;
-      $this->t->addVar('oldlog_lower', 'RESULTMSG', $resultmsg);
-      $this->t->displayParsedTemplate('oldlog_lower');
     }
 
   }
@@ -570,26 +575,26 @@
   function msgsearchhtml ($buffer, $conditions) {
     $message = array();
 
-    $message['user'] = '';
-    $message['title'] = '';
-    $message['msg'] = '';
-    $message['ndatestr'] = '';
+    $message['USER'] = '';
+    $message['TITLE'] = '';
+    $message['MSG'] = '';
+    $message['NDATESTR'] = '';
 
     if (preg_match("/<span class=\"mun\">([^<]+)<\/span>/", $buffer, $matches)) {
-      $message['user'] = $matches[1];
+      $message['USER'] = $matches[1];
     }
     if (preg_match("/<span class=\"ms\">([^<]+)<\/span>/", $buffer, $matches)) {
-      $message['title'] = $matches[1];
+      $message['TITLE'] = $matches[1];
     }
     if (preg_match("/<blockquote>[\r\n\s]*<pre>(.+?)<\/pre>/ms", $buffer, $matches)) {
-      $message['msg'] = $matches[1];
+      $message['MSG'] = $matches[1];
     }
     if (preg_match("/<span class=\"md\">[^<]*eF(\d+)\/(\d+)\/(\d+)[^\d]+(\d+)(\d+)(\d+)b/", $buffer, $matches)) {
       if (@$conditions['savesw']) {
-        $message['ndatestr'] = $matches[3] . $matches[4];
+        $message['NDATESTR'] = $matches[3] . $matches[4];
       }
       else {
-        $message['ndatestr'] = $matches[4] . $matches[5];
+        $message['NDATESTR'] = $matches[4] . $matches[5];
       }
     }
 
@@ -612,19 +617,19 @@
     if (@$conditions['savesw']) {
       $starttime = $conditions['sd'].$conditions['sh'];
       $endtime = $conditions['ed'].$conditions['eh'];
-      if (!@$message['ndatestr']) {
-        $message['ndatestr'] = date("dH", $message['ndate']);
+      if (!@$message['NDATESTR']) {
+        $message['NDATESTR'] = date("dH", $message['NDATE']);
       }
     }
     # 
     else {
       $starttime = $conditions['sh'].$conditions['si'];
       $endtime = $conditions['eh'].$conditions['ei'];
-      if (!@$message['ndatestr']) {
-        $message['ndatestr'] = date("Hi", $message['ndate']);
+      if (!@$message['NDATESTR']) {
+        $message['NDATESTR'] = date("Hi", $message['NDATE']);
       }
     }
-    if ($message['ndatestr'] < $starttime or $message['ndatestr'] > $endtime) {
+    if ($message['NDATESTR'] < $starttime or $message['NDATESTR'] > $endtime) {
       return 2;
     }
 
@@ -635,13 +640,13 @@
 
       $haystack = '';
       if ($conditions['t'] == 'u') {
-        $haystack = $message['user'];
+        $haystack = $message['USER'];
       }
       else if ($conditions['t'] == 't') {
-        $haystack = $message['title'];
+        $haystack = $message['TITLE'];
       }
       else {
-        $haystack = "{$message['user']}<>{$message['title']}<>{$message['msg']}";
+        $haystack = "{$message['USER']}<>{$message['TITLE']}<>{$message['MSG']}";
       }
 
       # OR
@@ -717,8 +722,7 @@
     $ttitle = array();
     $ttime = array();
     $tindex = 0;
-    while (!feof ($fh)) {
-      $logline = Func::fgetline(&$fh);
+    while (($logline = Func::fgetline($fh)) !== FALSE) {
       $message = $this->getmessage($logline);
       if (!$message['THREAD'] or $message['THREAD'] == $message['POSTID'] or !@$ttitle[$message['THREAD']]) {
         $tid[$tindex] = $message['POSTID'];
diff --dos -uNr kuzuhaphp.orig/sub/bbstree.php kuzuhaphp/sub/bbstree.php
--- kuzuhaphp.orig/sub/bbstree.php	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/bbstree.php	Fri Apr 01 15:20:20 2005
@@ -222,7 +222,7 @@
       if ($isreadnew) {
         $hit = FALSE;
         for ($i = 0; $i < count($thread); $i++) {
-          if ($thread[$i]['postid'] > $this->f['p']) {
+          if ($thread[$i]['POSTID'] > $this->f['p']) {
             $hit = TRUE;
             break;
           }
@@ -343,6 +343,7 @@
     $treeprint = '';
 
     # ebZ[W̏o
+    reset($treemsgs);
     while (list($pos, $treemsg) = each($treemsgs)) {
       if ($treemsg['POSTID'] == $parentid) {
 
@@ -380,6 +381,7 @@
 
     # qID
     $childids = array();
+    reset($treemsgs);
     while ($treemsg = each($treemsgs)) {
       if ($treemsg[1]['REFID'] == $parentid) {
         $childids[] = $treemsg[1]['POSTID'];
diff --dos -uNr kuzuhaphp.orig/sub/template.html kuzuhaphp/sub/template.html
--- kuzuhaphp.orig/sub/template.html	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/template.html	Fri Apr 01 15:20:20 2005
@@ -91,7 +91,8 @@
   <blockquote>
     <pre>{MSG}</pre>
   </blockquote>
-{ENVLIST}</div>
+<patTemplate:link src="envlist" />
+</div>
 <patTemplate:link src="hr" />
 <!--  -->
 
@@ -99,7 +100,7 @@
 
 
 <!-- L̊ϐ\ -->
-<patTemplate:tmpl name="envlist">
+<patTemplate:tmpl name="envlist" visibility="hidden">
 <div class="env">{ENVADDR}{ENVBR}{ENVUA}</div>
 </patTemplate:tmpl>
 
@@ -115,7 +116,7 @@
  <a href="{INFOPAGE}">L</a>
  <a href="mailto:{ADMINMAIL}">A</a>
  <a href="{CGIURL}?{QUERY}&amp;m=tree">c[\</a>
- <a href="{URL_IMODE}">i[h</a>
+ <a href="{CGIURL}?m=i">i[h</a>
  </span>
 
 <patTemplate:link src="form" />
@@ -135,7 +136,6 @@
 <patTemplate:tmpl name="nextpage">
     <td>
       <form method="post" action="{CGIURL}">
-        <input type="hidden" name="m" value="tree" />
         <input type="hidden" name="u" value="{U}" />
         <input type="hidden" name="i" value="{I}" />
         <input type="hidden" name="d" value="{MSGDISP}" />
@@ -148,7 +148,6 @@
 </patTemplate:tmpl>
     <td>
       <form method="post" action="{CGIURL}">
-        <input type="hidden" name="m" value="tree" />
         <input type="hidden" name="u" value="{U}" />
         <input type="hidden" name="i" value="{I}" />
         <input type="hidden" name="d" value="{MSGDISP}" />
@@ -160,7 +159,6 @@
 <patTemplate:tmpl name="readnew">
     <td>
       <form method="post" action="{CGIURL}">
-        <input type="hidden" name="m" value="tree" />
         <input type="hidden" name="u" value="{U}" />
         <input type="hidden" name="i" value="{I}" />
         <input type="hidden" name="d" value="{MSGDISP}" />
@@ -183,7 +181,7 @@
   <input type="hidden" name="g" value="{GZIPU}" />
   <input type="hidden" name="hide" value="{HIDEFORM}" />
   <input type="hidden" name="loff" value="{LINKOFF}" />
-  <input type="hidden" name="si" value="{SHOWIMG}" />
+  <input type="hidden" name="sim" value="{SHOWIMG}" />
   <input size="8" type="password" name="u" maxlength="30" value="{U}" />
   <input type="submit" name="write" value="Ǘғe" />
 </form>
@@ -271,12 +269,12 @@
     \<input size="4" type="text" name="d" accesskey="6" value="{MSGDISP}" />&nbsp;
     <patTemplate:tmpl name="formconfig">
     URLN<input type="checkbox" name="a" accesskey="U" value="checked"{CHK_A} />&nbsp;
-    s<input type="checkbox" name="wrap" accesskey="A" value="checked"{CHK_WRAP} />&nbsp;
+<!--    s<input type="checkbox" name="wrap" accesskey="A" value="checked"{CHK_WRAP} />&nbsp; -->
     tH[OFF<input type="checkbox" name="hide" accesskey="I" value="checked"{CHK_HIDE} />&nbsp;
     </patTemplate:tmpl>
     NsOFF<input type="checkbox" name="loff" accesskey="L" value="checked"{CHK_LOFF} />&nbsp;
     <patTemplate:tmpl name="sicheck" visibility="hidden">
-    摜ON<input type="checkbox" name="si" accesskey="S" value="checked"{CHK_SI} />&nbsp;
+    摜ON<input type="checkbox" name="sim" accesskey="S" value="checked"{CHK_SI} />&nbsp;
     </patTemplate:tmpl>
     <input type="submit" name="setup" accesskey="C" value="ݒ" />
   </div>
@@ -386,7 +384,7 @@
   <input type="hidden" name="d" value="{MSGDISP}" />
   <input type="hidden" name="hide" value="{HIDEFORM}" />
   <input type="hidden" name="loff" value="{LINKOFF}" />
-  <input type="hidden" name="si" value="{SHOWIMG}" />
+  <input type="hidden" name="sim" value="{SHOWIMG}" />
   <patTemplate:link src="hr" />
 </div>
 </form>
@@ -492,7 +490,7 @@
 
     <input type="checkbox" name="cookie" value="checked"{CHK_COOKIE} /> eCookieɓeҖƃ[AhXL^<br />
     <input type="checkbox" name="loff" value="checked"{CHK_LOFF} /> NsOFF ietH[̃Nꗗs\Ȃj<br />
-    <input type="checkbox" name="si" value="checked"{CHK_SI} /> 摜ON i摜BBS[hœeꂽ摜\j<br />
+    <input type="checkbox" name="sim" value="checked"{CHK_SI} /> 摜ON i摜BBS[hœeꂽ摜\j<br />
     </li>
   </ul>
   <ul>
diff --dos -uNr kuzuhaphp.orig/sub/tmpladmin.html kuzuhaphp/sub/tmpladmin.html
--- kuzuhaphp.orig/sub/tmpladmin.html	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/tmpladmin.html	Fri Apr 01 15:20:20 2005
@@ -131,7 +131,7 @@
 
 <!-- ÍpX[h\ -->
 <patTemplate:tmpl name="pass">
-<span class="pagetitle">{$this->c['BBSTITLE']} pX[hݒ</span>
+<span class="pagetitle">{BBSTITLE} pX[hݒ</span>
 
 <form method="post" action="{CGIURL}">
 
diff --dos -uNr kuzuhaphp.orig/sub/tmpllog.html kuzuhaphp/sub/tmpllog.html
--- kuzuhaphp.orig/sub/tmpllog.html	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/tmpllog.html	Fri Apr 01 15:20:20 2005
@@ -284,9 +284,11 @@
   <tr>
     <td><span class="small">
       <input type="checkbox" name="ci" value="checked" checked="checked" />啶ꎋ<br />
-      <input type="checkbox" name="si" value="checked" />摜ON<br />
+      <patTemplate:tmpl name="sicheck" visibility="hidden">
+      <input type="checkbox" name="sim" value="checked"{CHK_SI} />摜ON<br />
+      </patTemplate:tmpl>
       <patTemplate:tmpl name="check_bt">
-      <input type="checkbox" name="bt" value="checked" />p@\gp<br />
+      <input type="checkbox" name="bt" value="checked" checked="checked" />p@\gp<br />
       </patTemplate:tmpl>
       <input type="checkbox" name="g" value="checked"{CHK_G} />gzipk]<br />
     </span></td>
diff --dos -uNr kuzuhaphp.orig/sub/tmpltree.html kuzuhaphp/sub/tmpltree.html
--- kuzuhaphp.orig/sub/tmpltree.html	Sat Jun 21 10:16:54 2003
+++ kuzuhaphp/sub/tmpltree.html	Fri Apr 01 15:20:20 2005
@@ -35,6 +35,7 @@
 <patTemplate:tmpl name="nextpage">
     <td>
       <form method="post" action="{CGIURL}">
+        <input type="hidden" name="m" value="tree" />
         <input type="hidden" name="u" value="{U}" />
         <input type="hidden" name="i" value="{I}" />
         <input type="hidden" name="d" value="{MSGDISP}" />
@@ -47,6 +48,7 @@
 </patTemplate:tmpl>
     <td>
       <form method="post" action="{CGIURL}">
+        <input type="hidden" name="m" value="tree" />
         <input type="hidden" name="u" value="{U}" />
         <input type="hidden" name="i" value="{I}" />
         <input type="hidden" name="d" value="{MSGDISP}" />
@@ -58,6 +60,7 @@
 <patTemplate:tmpl name="readnew">
     <td>
       <form method="post" action="{CGIURL}">
+        <input type="hidden" name="m" value="tree" />
         <input type="hidden" name="u" value="{U}" />
         <input type="hidden" name="i" value="{I}" />
         <input type="hidden" name="d" value="{MSGDISP}" />
@@ -80,7 +83,7 @@
   <input type="hidden" name="g" value="{GZIPU}" />
   <input type="hidden" name="hide" value="{HIDEFORM}" />
   <input type="hidden" name="loff" value="{LINKOFF}" />
-  <input type="hidden" name="si" value="{SHOWIMG}" />
+  <input type="hidden" name="sim" value="{SHOWIMG}" />
   <input size="8" type="password" name="u" maxlength="30" value="{U}" />
   <input type="submit" name="write" value="Ǘғe" />
 </form>
