diff -urN soojung-0.4.6/TODO soojung/TODO
--- soojung-0.4.6/TODO	2005-03-11 22:03:46.000000000 +0900
+++ soojung/TODO	2005-03-17 12:00:03.000000000 +0900
@@ -1,4 +1,3 @@
-보낸 트랙백 보여주는 기능
 문서화
 xmlrpc 지원 (metaWeblog - newMediaObject 빼고 구현, mt)
 그림 묶은 zip파일 올리기 기능
@@ -8,3 +7,5 @@
 plugin 환경 구축
 설치 할 때 인코딩 설정 할 수 있게 만들기(기본은 utf-8)
 모니위키와 연동 기능, 혹은 키워드 설정기능
+post할때 bbcode, smiley 입력하는 버튼 제공
+코멘트 스팸 방지 (베이시안 필터, 그림문자 입력기능 등등등)
diff -urN soojung-0.4.6/classes/AdminTemplate.class.php soojung/classes/AdminTemplate.class.php
--- soojung-0.4.6/classes/AdminTemplate.class.php	2005-02-19 14:52:46.000000000 +0900
+++ soojung/classes/AdminTemplate.class.php	2005-03-31 20:35:48.000000000 +0900
@@ -1,4 +1,4 @@
-<?
+<?php
 include_once("settings.php");
 
 class AdminTemplate extends Template {
@@ -11,7 +11,6 @@
     $this->template_dir = "templates/admin/";
   }
 }
-?>
-<?
+
 # vim: ts=8 sw=2 sts=2 noet
 ?>
diff -urN soojung-0.4.6/classes/Comment.class.php soojung/classes/Comment.class.php
--- soojung-0.4.6/classes/Comment.class.php	2005-02-12 22:53:01.000000000 +0900
+++ soojung/classes/Comment.class.php	2005-03-27 21:46:40.000000000 +0900
@@ -32,7 +32,7 @@
   function getHref() {
     $id = Soojung::filenameToEntryId($this->filename);
     $e = Entry::getEntry($id);
-    return $e->getHref() . "#" . $this->date;
+    return $e->getHref() . "#CO" . $this->date;
   }
 
   function getBody() {
diff -urN soojung-0.4.6/classes/Counter.class.php soojung/classes/Counter.class.php
--- soojung-0.4.6/classes/Counter.class.php	1970-01-01 09:00:00.000000000 +0900
+++ soojung/classes/Counter.class.php	2005-03-30 11:29:04.000000000 +0900
@@ -0,0 +1,82 @@
+<?php
+
+class Counter {
+  
+  function Counter($cookiename = "soojungcountercookie", $ipcount = 10) {
+    $this->cookiename = $cookiename;
+    $this->ipcount = $ipcount;
+    $this->read();
+  }
+
+  function read() {
+    if ($fd = @fopen("contents/.count", "r")) {
+      flock($fd, LOCK_SH);
+      $lastdate = trim(fgets($fd, 256));
+      $today = intval(fgets($fd, 256));
+      $total = intval(fgets($fd, 256));
+      $recent = array();
+      while (!feof($fd)) {
+	$recent[] = trim(fgets($fd, 256));
+      }
+      flock($fd, LOCK_UN);
+      fclose($fd);
+    } else {
+      $lastdate = date("Y-m-d");
+      $today = $total = 0;
+      $recent = array();
+    }
+
+    $this->today = $today;
+    $this->total = $total;
+    $this->recent = $recent;
+    $this->lastdate = $lastdate;
+
+    return array($today, $total, $recent, $lastdate);
+  }
+
+  function write($today, $total, $recent, $lastdate=null) {
+    if (is_null($lastdate)) {
+      $lastdate = date("Y-m-d");
+    }
+
+    if ($fd = @fopen("contents/.count", "w")) {
+      flock($fd, LOCK_EX);
+      fwrite($fd, "$lastdate\n$today\n$total\n");
+      foreach ($recent as $recentitem) {
+	fwrite($fd, "$recentitem\n");
+      }
+      flock($fd, LOCK_UN);
+      fclose($fd);
+    }
+
+    $this->today = $today;
+    $this->total = $total;
+    $this->recent = $recent;
+    $this->lastdate = $lastdate;
+  }
+
+  function isbot() {
+    return stristr($_SERVER['HTTP_USER_AGENT'], "googlebot");
+  }
+
+  function update() {
+    setcookie($this->cookiename, "on", 0);
+    if ($_COOKIE[$this->cookiename] != "on" && !$this->isbot()) {
+      list($today, $total, $recent, $lastdate) = $this->read();
+      if (!in_array($_SERVER['REMOTE_ADDR'], $recent)) {
+	$todaydate = date("Y-m-d");
+	if ($lastdate < $todaydate) {
+	  $lastdate = $todaydate;
+	  $today = 0;
+	}
+	array_unshift($recent, $_SERVER['REMOTE_ADDR']);
+	array_splice($recent, $this->ipcount);
+	$this->write($today+1, $total+1, $recent, $lastdate);
+      }
+    }
+  }
+
+}
+
+# vim: ts=8 sw=2 sts=2 noet
+?>
diff -urN soojung-0.4.6/classes/Entry.class.php soojung/classes/Entry.class.php
--- soojung-0.4.6/classes/Entry.class.php	2005-03-11 22:09:36.000000000 +0900
+++ soojung/classes/Entry.class.php	2005-03-21 01:46:13.000000000 +0900
@@ -248,6 +248,9 @@
    */
   function search($keyword) {
     $founds = array();
+    if ($keyword == "") {
+      return $founds;
+    }
     $filenames = Soojung::queryFilenameMatch("^[0-9].+[.]entry$");
     rsort($filenames);
     foreach($filenames as $f) {
diff -urN soojung-0.4.6/classes/Formatter.class.php soojung/classes/Formatter.class.php
--- soojung-0.4.6/classes/Formatter.class.php	2005-02-24 23:15:59.000000000 +0900
+++ soojung/classes/Formatter.class.php	2005-03-23 09:23:46.000000000 +0900
@@ -121,22 +121,20 @@
 class PlainFormatter extends Formatter {
 
   function toHtml($str) {
-    $pos = strpos($str, "<pre");
-    if ($pos === false) {
-      return nl2br($str);
-    }
- 
+    $trans = array("\\\r\n"=>"", "\\\r"=>"", "\\\n"=>"");
     $text = "";
-    while (($pos = @strpos($str, "<pre")) !== FALSE) {
-      $text .= nl2br(trim(substr($str, 0, $pos)));
- 
-      $str = substr($str, $pos);
-      $endpos = strpos($str, "</pre>") + strlen("</pre>");
- 
-      $text .= substr($str, 0, $endpos);
-      $str = substr($str, $endpos);
+    $spos = 0;
+    while (($pos = @strpos($str, "<pre", $spos)) !== FALSE) {
+      $text .= nl2br(strtr(trim(substr($str, $spos, $pos-$spos)), $trans));
+      $spos = strpos($str, "</pre>", $pos);
+      if ($spos === false) {
+	$str .= "</pre>";
+	$spos = strlen($str);
+      }
+      $spos += 6;
+      $text .= substr($str, $pos, $spos-$pos);
     }
-    $text .= nl2br(trim($str));
+    $text .= nl2br(strtr(trim(substr($str, $spos)), $trans));
     return $text;
   }
 
@@ -280,5 +278,472 @@
   }
 }
 
+class MoniwikiFormatter extends Formatter {
+  function toHtml($str) {
+    $str=rtrim($str); # delete last empty line
+    $lines=explode("\n",$str);
+
+    # have no contents
+    if (!$lines) return;
+
+    $text='';
+    $pre_line='';
+    $in_p='';
+    $in_div=0;
+    $in_li=0;
+    $in_pre=0;
+    $in_table=0;
+    $li_open=0;
+    $li_empty=0;
+    $indent_list[0]=0;
+    $indent_type[0]="";
+
+	$punct="<\'}\]\|;\.\!"; # , is omitted for the WikiPedia
+    $url="wiki|http|https|ftp|nntp|news|irc|telnet|mailto|file|attachment";
+    $urlrule="((?:$url):([^\s$punct]|(\.?[^\s$punct]))+)";
+    $baserule=array("/<([^\s<>])/","/`([^`' ]+)'/","/(?<!`)`([^`]*)`/",
+                     "/'''([^']*)'''/","/(?<!')'''(.*)'''(?!')/",
+                     "/''([^']*)''/","/(?<!')''(.*)''(?!')/",
+                     "/\^([^ \^]+)\^(?=\s|$)/","/\^\^([^\^]+)\^\^(?!^)/",
+                     "/(?<!,),,([^ ,]+),,(?!,)/",
+                     "/(?<!_)__([^_]+)__(?!_)/","/^(-{4,})/e",
+                     "/(?<!-)--[^\s]([^-]+)[^\s]--(?!-)/",
+		     "/\[\[BR\]\]/",
+		     "/\[\[HTML\(&lt;(.*)\)\]\]/",
+                     );
+    $baserepl=array("&lt;\\1","&#96;\\1'","<tt class='wiki'>\\1</tt>",
+                     "<b>\\1</b>","<b>\\1</b>",
+                     "<i>\\1</i>","<i>\\1</i>",
+                     "<sup>\\1</sup>","<sup>\\1</sup>",
+                     "<sub>\\1</sub>",
+                     "<u>\\1</u>",
+                     "<div class='separator'><hr class='wiki' /></div>\n",
+                     "<del>\\1</del>",
+		     "<br />",
+		     "<\\1",
+                     );
+
+    # NoSmoke's MultiLineCell hack
+    $extrarule=array("/{{\|/","/\|}}/");
+    #$extrarepl=array("</div><table class='closure'><tr class='closure'><td class='closure'><div>","</div></td></tr></table><div>");
+    $extrarepl=array("<blockquote><p>","</p></blockquote>");
+    $wordrule="({{{([^}]+)}}})|".
+              "\[\[([A-Za-z0-9]+(\(((?<!\]\]).)*\))?)\]\]|"; # macro
+	$wordrule.="\[\*[^\]]*\s[^\]]+\]|";
+    $wordrule.=
+    # single bracketed rule [http://blah.blah.com Blah Blah]
+    "(\[\^?($url):[^\s\]]+(\s[^\]]+)?\])|".
+    # WikiName rule: WikiName ILoveYou (imported from the rule of NoSmoke)
+    # protect WikiName rule !WikiName
+    "(?<![a-z])\!?(?:((\.{1,2})?\/)?[A-Z]([A-Z]+[0-9a-z]|[0-9a-z]+[A-Z])[0-9a-zA-Z]*)+\b|".
+    # single bracketed name [Hello World]
+    "(?<!\[)\!?\[([^\[:,<\s'][^\[:,>]{1,255})\](?!\])|".
+    # bracketed with double quotes ["Hello World"]
+    "(?<!\[)\!?\[\\\"([^\\\"]+)\\\"\](?!\])|".
+    # "(?<!\[)\[\\\"([^\[:,]+)\\\"\](?!\])|".
+    "($urlrule)|".
+    # single linkage rule ?hello ?abacus
+    #"(\?[A-Z]*[a-z0-9]+)";
+    "(\?[A-Za-z0-9]+)";
+
+    foreach ($lines as $line) {
+      # empty line
+      if (strlen($line) == 1) {
+        if ($in_pre) { $pre_line.="\n";continue;}
+        if ($in_li) { $text.="<br />\n";$li_empty=1; continue;}
+        if ($in_table) {
+          $text.="</table>"."<br />\n";$in_table=0; continue;
+        } else {
+          #if ($in_p) { $text.="</div><br />\n"; $in_p='';}
+          if ($in_p) { $text.=$this->_div(0,&$in_div)."<br />\n"; $in_p='';}
+          else if ($in_p=='') { $text.="<br />\n";}
+          continue;
+        }
+      }
+
+      $p_close='';
+      if (preg_match('/^-{4,}/',$line)) {
+        if ($in_p) { $p_close=$this->_div(0,&$in_div); $in_p='';}
+      } else if ($in_p == '') {
+        $p_close=$this->_div(1,&$in_div);
+        $in_p= $line;
+      }
+
+      if ($in_pre) {
+         if (strpos($line,"}}}")===false) {
+           $pre_line.=$line."\n";
+           continue;
+         } else {
+           #$p=strrpos($line,"}}}");
+           $p= strlen($line) - strpos(strrev($line),'}}}') - 1;
+           if ($p>2 and $line[$p-3]=='\\') {
+             $pre_line.=substr($line,0,$p-3).substr($line,$p-2)."\n";
+             continue;
+           }
+           $pre_line.=substr($line,0,$p-2);
+           $line=substr($line,$p+1);
+           $in_pre=-1;
+         }
+      } else if (!(strpos($line,"{{{")===false) and 
+                 preg_match("/{{{[^{}]*$/",$line)) {
+         $p= strlen($line) - strpos(strrev($line),'{{{') - 3;
+
+         $in_pre=1;
+         $np=0;
+
+         if ($line[$p+3] == ":") {
+            # new formatting rule for a quote block (pre block + wikilinks)
+            $line[$p+3]=" ";
+            $np=1;
+            if ($line[$p+4]=='#' or $line[$p+4]=='.') {
+              $pre_style=strtok(substr($line,$p+4),' ');
+              $np++;
+              if ($pre_style) $np+=strlen($pre_style);
+            } else
+              $pre_style='';
+            $in_quote=1;
+         }
+
+         $pre_line=substr($line,$p+$np+3);
+         if (trim($pre_line))
+           $pre_line.="\n";
+         $line=substr($line,0,$p);
+      }
+      $line=preg_replace($baserule,$baserepl,$line);
+      if ($in_pre != -1 && preg_match("/^(\s*)/",$line,$match)) {
+         $open="";
+         $close="";
+         $indtype="dd";
+         $indlen=strlen($match[0]);
+         if ($indlen > 0) {
+           $line=substr($line,$indlen);
+           if ($line[0]=='*') {
+             $limatch[1]='*';
+             $line=preg_replace("/^(\*\s?)/","<li>",$line);
+             if ($indent_list[$in_li] == $indlen && $indent_type[$in_li]!='dd') $line="</li>\n".$line;
+             $numtype="";
+             $indtype="ul";
+           } elseif (preg_match("/^((\d+|[aAiI])\.)(#\d+)?\s/",$line,$limatch)){
+             $line=preg_replace("/^((\d+|[aAiI])\.(#\d+)?)/","<li>",$line);
+             if ($indent_list[$in_li] == $indlen) $line="</li>\n".$line;
+             $numtype=$limatch[2][0];
+             if ($limatch[3])
+               $numtype.=substr($limatch[3],1);
+             $indtype="ol";
+           } elseif (preg_match("/^([^:]+)::\s/",$line,$limatch)) {
+             $line=preg_replace("/^[^:]+::\s/",
+                     "<dt class='wiki'>".$limatch[1]."</dt><dd>",$line);
+             if ($indent_list[$in_li] == $indlen) $line="</dd>\n".$line;
+             $numtype="";
+             $indtype="dl";
+           }
+         }
+         if ($indent_list[$in_li] < $indlen) {
+            $in_li++;
+            $indent_list[$in_li]=$indlen; # add list depth
+            $indent_type[$in_li]=$indtype; # add list type
+            $open.=$this->_list(1,$indtype,$numtype);
+         } else if ($indent_list[$in_li] > $indlen) {
+            while($in_li >= 0 && $indent_list[$in_li] > $indlen) {
+               if ($indent_type[$in_li]!='dd' && $li_open == $in_li)
+                 $close.="</li>\n";
+               $close.=$this->_list(0,$indent_type[$in_li],"",$indent_type[$in_li-1]);
+               unset($indent_list[$in_li]);
+               unset($indent_type[$in_li]);
+               $in_li--;
+            }
+            $li_empty=0;
+         }
+         if ($indent_list[$in_li] <= $indlen || $limatch) $li_open=$in_li;
+         else $li_open=0;
+      }
+
+      if (!$in_pre && $line[0]=='|' && !$in_table && preg_match("/^((\|\|)+)(&lt;[^>]+>)?.*\|\|$/",$line,$match)) {
+		 $open.="<table class='wiki' cellpadding='3' cellspacing='2' substr($match[3],4,-1)>\n";
+         $line=preg_replace('/^((\|\|)+)(&lt;[^>]+>)?/','\\1',$line);
+         $in_table=1;
+      } elseif ($in_table && $line[0]!='|' && !preg_match("/^\|\|.*\|\|$/",$line)){
+         $close="</table>".$close;
+         $in_table=0;
+      }
+      if ($in_table) {
+         $line=preg_replace('/^((?:\|\|)+(&lt;[^>]+>)?)((\s?)(.*))\|\|$/e',"'<tr class=\"wiki\"><td class=\"wiki\" '.\_table_span('\\1','\\4').'>\\3</td></tr>'",$line);
+         $line=preg_replace('/((\|\|)+(&lt;[^>]+>)?)(\s?)/e',"'</td><td class=\"wiki\" '.\_table_span('\\1','\\4').'>\\4'",$line);
+         $line=str_replace('\"','"',$line); # revert \\" to \"
+      }
+
+      # InterWiki, WikiName, {{{ }}}, !WikiName, ?single, ["extended wiki name"]
+      # urls, [single bracket name], [urls text], [[macro]]
+      $line=preg_replace("/(".$wordrule.")/e","\$this->link_repl('\\1')",$line);
+
+      # Headings
+      $line=preg_replace("/(?<!=)(={1,5})\s+(.*)\s+\\1\s?$/e",
+                         "\$this->head_repl('\\1','\\2')",$line);
+      $line=preg_replace($extrarule,$extrarepl,$line);
+      $line=$close.$p_close.$open.$line;
+      $open="";$close="";
+
+      if ($in_pre==-1) {
+         $in_pre=0;
+         if ($in_quote) {
+            # htmlfy '<'
+            $pre=str_replace("<","&lt;",$pre_line);
+            $pre=preg_replace($baserule,$baserepl,$pre);
+            $pre=preg_replace("/(".$wordrule.")/e","\$this->link_repl('\\1')",$pre);
+            $attr='class="quote"';
+            if ($pre_style) {
+              $tag=$pre_style[0];
+              $style=substr($pre_style,1);
+              switch($tag) {
+              case '#':
+                $attr="id='$style'";
+                break;
+              case '.':
+                $attr="class='$style'";
+                break;
+              }
+            }
+            $line="<pre $attr>\n".$pre."</pre>\n".$line;
+            $in_quote=0;
+         } else {
+            # htmlfy '<'
+            $pre=str_replace("<","&lt;",$pre_line);
+            $line="<pre class='wiki'>\n".$pre."</pre>\n".$line;
+         }
+      }
+      $text.=$line."\n";
+    } # end rendering loop
+
+    # close all tags
+    $close="";
+    # close pre,table
+    if ($in_pre) $close.="</pre>\n";
+    if ($in_table) $close.="</table>\n";
+    # close indent
+    while($in_li >= 0 && $indent_list[$in_li] > 0) {
+      if ($indent_type[$in_li]!='dd' && $li_open == $in_li)
+        $close.="</li>\n";
+      $close.=$this->_list(0,$indent_type[$in_li],"",$indent_type[$in_li-1]);
+      unset($indent_list[$in_li]);
+      unset($indent_type[$in_li]);
+      $in_li--;
+    }
+    # close div
+    #if ($in_p) $close.="</div>\n"; # </para>
+    if ($in_p) $close.=$this->_div(0,&$in_div); # </para>
+
+    # activate <del></del> tag
+    #$text=preg_replace("/(&lt;)(\/?del>)/i","<\\2",$text);
+    $text.=$close;
+  
+    return $text;
+  }
+
+  function _list($on,$list_type,$numtype="",$closetype="") {
+    if ($list_type=="dd") {
+      if ($on)
+         #$list_type="dl><dd";
+         $list_type="div class='indent'";
+      else
+         #$list_type="dd></dl";
+         $list_type="div";
+      $numtype='';
+    } else if ($list_type=="dl") {
+      if ($on)
+         $list_type="dl";
+      else
+         $list_type="dd></dl";
+      $numtype='';
+    } if (!$on and $closetype and $closetype !='dd')
+      $list_type=$list_type.'></li';
+
+    if ($on) {
+      if ($numtype) {
+        $start=substr($numtype,1);
+        if ($start)
+          return "<$list_type type='$numtype[0]' start='$start'>";
+        return "<$list_type type='$numtype[0]'>";
+      }
+      return "$close$open<$list_type>\n";
+    } else {
+      return "</$list_type>\n$close$open";
+    }
+  }
+
+  function _table_span($str,$align='') {
+    $tok=strtok($str,'&');
+    $len=strlen($tok)/2;
+    $extra=strtok('');
+    $attr=array();
+    if ($extra) {
+      $para=substr($extra,3,-1);
+      # rowspan
+      if (preg_match("/^\|(\d+)$/",$para,$match))
+        $attr[]="rowspan='$match[1]'";
+      else if ($para[0]=='#')
+        $attr[]="bgcolor='$para'";
+      else
+        $attr[]=$para;
+    }
+    if ($align) $attr[]="align='center'";
+    if ($len > 1)
+      $attr[]="colspan='$len'"; #$attr[]="align='center' colspan='$len'";
+    return implode(' ',$attr);
+  }
+
+  function _div($on,$in_div) {
+    $tag=array("</div>\n","<div>\n");
+    if ($on) $in_div++;
+    else {
+      if (!$in_div) return '';
+      $in_div--;
+    }
+    return $purple.$tag[$on];
+  }
+
+  function head_repl($depth,$head) {
+    $dep=strlen($depth);
+    $head=str_replace('\"','"',$head); # revert \\" to \"
+	$head_num=1;
+	$head_dep=0;
+
+    if (!$depth_top) {
+      $depth_top=$dep; $depth=1;
+    } else {
+      $depth=$dep - $depth_top + 1;
+      if ($depth <= 0) $depth=1;
+    }
+
+    $num="".$head_num;
+    $odepth=$head_dep;
+
+    if ($head[0] == '#') {
+      # reset TOC numberings
+      if ($toc_prefix) $toc_prefix++;
+      else $toc_prefix=1;
+      $head[0]=' ';
+      $dum=explode(".",$num);
+      $i=sizeof($dum);
+      for ($j=0;$j<$i;$j++) $dum[$j]=1;
+      $dum[$i-1]=0;
+      $num=join($dum,".");
+    }
+    $open="";
+    $close="";
+
+    if ($odepth && ($depth > $odepth)) {
+      $num.=".1";
+    } else if ($odepth) {
+      $dum=explode(".",$num);
+      $i=sizeof($dum)-1;
+      while ($depth < $odepth && $i > 0) {
+         unset($dum[$i]);
+         $i--;
+         $odepth--;
+      }
+      $dum[$i]++;
+      $num=join($dum,".");
+    }
+
+    $head_dep=$depth; # save old
+    $head_num=$num;
+
+    $prefix=$toc_prefix;
+
+    return "$close$open<h$dep>$head</h$dep>";
+  }
+
+  function link_repl($url,$attr='') {
+    global $blog_baseurl;
+
+    $url=str_replace('\"','"',$url);
+    if ($url[0]=="[") {
+      $url=substr($url,1,-1);
+      $force=1;
+    }
+    switch ($url[0]) {
+    case '{':
+      $url=substr($url,3,-3);
+      if ($url[0]=='#' and ($p=strpos($url,' '))) {
+	$col=strtok($url,' '); $url=strtok(' ');
+	if (!preg_match('/^#[0-9a-f]{6}$/',$col)) $col=substr($col,1);
+	return "<font color='$col'>$url</font>";
+      }
+      return "<tt class='wiki'>$url</tt>";
+      break;
+    case '#': # Anchor syntax in the MoinMoin 1.1
+      $anchor=strtok($url,' ');
+      //return ($word=strtok('')) ? $this->link_to($anchor,$word):
+      //           "<a name='".($temp=substr($anchor,1))."' id='$temp'></a>";
+	  return ($word=strtok('')) ? $temp=substr($anchor,1):
+                 "<a name='".($temp=substr($anchor,1))."' id='$temp'></a>";
+      break;
+    case '!':
+      $url=substr($url,1);
+      return $url;
+      break;
+    default:
+      break;
+    }
+
+    if (strpos($url,":")) {
+      if ($url[0]=='a') # attachment:
+        //return $this->macro_repl('Attachment',substr($url,11));
+        if (preg_match("/.*\.(png|gif|jpeg|jpg)$/i",$url)) {
+	  $url = preg_replace("/attachment([a-zA-Z0-9:\/]*)\:/", "", $url);
+	  return "<img src='$blog_baseurl"."/contents/upload/"."$url' alt='$url' />";
+	} else {
+	  $url = preg_replace("/attachment([a-zA-Z0-9:\/]*)\:/", "", $url);
+	  return "<a href='$blog_baseurl"."/contents/upload/"."$url' />";
+	}
+
+      if ($url[0] == '^') {
+        $attr.=' target="_blank" ';
+        $url=substr($url,1);
+      }
+
+      if (preg_match("/^mailto:/",$url)) {
+        $url=str_replace("@","_at_",$url);
+        $link=str_replace('&','&amp;',$url);
+        $name=substr($url,7);
+        return "<a href='$link'>$name</a>";
+      }
+
+      if ($force or strpos($url," ")) { # have a space ?
+        list($url,$text)=explode(" ",$url,2);
+        $link=str_replace('&','&amp;',$url);
+        if (!$text) $text=$url;
+        else {
+          if (preg_match("/^(http|ftp).*\.(png|gif|jpeg|jpg)$/i",$text)) {
+            $text=str_replace('&','&amp;',$text);
+            return "<a href='$link' $attr title='$url'><img alt='$url' src='$text' /></a>";
+          }
+        }
+        $icon=strtok($url,':');
+        return "<a class='externalLink' $attr href='$link'>$text</a>";
+      } # have no space
+      $link=str_replace('&','&amp;',$url);
+      if (preg_match("/^(http|https|ftp)/",$url)) {
+        if (preg_match("/(^.*\.(png|gif|jpeg|jpg))(([\?&]([a-z]+=[0-9a-z]+))*)$/i",$url,$match)) {
+          $url=$match[1];
+          $attrs=explode('&',substr($match[3],1));
+          foreach ($attrs as $arg) {
+            $name=strtok($arg,'=');
+            $val=strtok(' ');
+            if ($name and $val) $attr.=$name.'="'.$val.'" ';
+            if ($name == 'align') $attr.='class="img'.ucfirst($val).'" ';
+          }
+          return "<img alt='$link' $attr src='$url' />";
+        }
+      }
+      return "<a class='externalLink' $attr href='$link'>$url</a>";
+    } else {
+      if ($url[0]=="?") $url=substr($url,1);
+      //return $this->word_repl($url,'',$attr);
+	  return $url;
+    }
+  }
+}
+
 # vim: ts=8 sw=2 sts=2 noet
 ?>
diff -urN soojung-0.4.6/classes/Import.class.php soojung/classes/Import.class.php
--- soojung-0.4.6/classes/Import.class.php	2005-02-15 10:56:55.000000000 +0900
+++ soojung/classes/Import.class.php	2005-03-23 10:10:04.000000000 +0900
@@ -445,5 +445,82 @@
 
 }
 
+function importMoniWiki($wikiPath, $encoding) {
+  if (strcasecmp($encoding, 'UTF-8') == 0 || strcasecmp($encoding, 'UTF8') == 0) {
+    $needtoconvert = FALSE;
+  } else {
+    $needtoconvert = TRUE;
+  }
+
+  $cachePath = $wikiPath."/data/cache/blog/";
+  $textPath = $wikiPath."/data/text/";
+  $blogs=array();
+  $entries=array();
+  $dir_handle = opendir($cachePath);
+
+  if (!$dir_handle) {
+    //error handling
+    exit;
+  }
+
+  while ($fileName = readdir($dir_handle)) {
+    if (!is_dir($fileName)) {
+      $blogs[] = $fileName;
+    }
+  }
+
+  foreach ($blogs as $blog) {
+    $blogPath = $textPath.$blog;
+    $fp = fopen($blogPath, "r");
+    if ($fp) {
+      $size = filesize($blogPath);
+      $raw = fread($fp,$size);
+      fclose($fp);
+    }
+
+    $lines = explode("\n", $raw);
+
+    foreach ($lines as $line) {
+      if (!$state) {
+	if (preg_match("/^({{{)?#!blog\s([^ ]+\s($date"."[^ ]+)\s.*)$/",$line,$match)) {
+	  $entry = explode(' ',$pageurl.' '.$match[2], 4);
+	  if ($match[1]) $endtag = '}}}';
+	  $state = 1;
+	}
+	continue;
+      }
+      if (preg_match("/^$endtag$/",$line)) {
+	$state = 0;
+	list($content,$comments) = explode("----\n", $summary, 2);
+	$entry[] = $content;
+	$entries[] = $entry;
+	$summary='';
+	continue;
+      }
+      $summary.=$line."\n";
+    }
+  }
+
+  foreach ($entries as $entry) {
+    $date = $entry[2];
+    $title = $entry[3];
+    $body = $entry[4];
+    $body = preg_replace("\\}}}", "}}}", $body);
+    $date = strtotime(str_replace("T", " ", $date));
+    $category = "moniwiki";
+
+    if ($needtoconvert) {
+      $t_title = iconv($encoding, "UTF-8", $title);
+      echo "en : ".$t_title."<br>";
+      $body = iconv($encoding, "UTF-8", $body);
+      $category = iconv($encoding, "UTF-8", $category);
+    }
+    $title = trim($title);
+    $body = trim($body);
+    $date = trim($date);
+    Entry::createEntry($title, $body, $date, $category, $options, "moniwiki");
+  }
+}
+
 # vim: ts=8 sw=2 sts=2 noet
 ?>
diff -urN soojung-0.4.6/classes/Soojung.class.php soojung/classes/Soojung.class.php
--- soojung-0.4.6/classes/Soojung.class.php	2005-03-11 22:09:36.000000000 +0900
+++ soojung/classes/Soojung.class.php	2005-03-23 09:23:46.000000000 +0900
@@ -139,6 +139,8 @@
       return new HtmlFormatter();
     case "bbcode":
       return new BBcodeFormatter();
+    case "moniwiki":
+      return new MoniwikiFormatter();
     default:
       return new Formatter();
     }
diff -urN soojung-0.4.6/classes/Template.class.php soojung/classes/Template.class.php
--- soojung-0.4.6/classes/Template.class.php	2005-02-27 11:46:15.000000000 +0900
+++ soojung/classes/Template.class.php	2005-03-31 20:35:48.000000000 +0900
@@ -1,4 +1,4 @@
-<?
+<?php
 include_once("settings.php");
 
 class Template extends Smarty {
diff -urN soojung-0.4.6/classes/Trackback.class.php soojung/classes/Trackback.class.php
--- soojung-0.4.6/classes/Trackback.class.php	2005-02-19 13:13:04.000000000 +0900
+++ soojung/classes/Trackback.class.php	2005-03-30 21:29:29.000000000 +0900
@@ -33,7 +33,7 @@
   function getHref() {
     $id = Soojung::filenameToEntryId($this->filename);
     $e = Entry::getEntry($id);
-    return $e->getHref() . "#" . $this->date;
+    return $e->getHref() . "#TB" . $this->date;
   }
 
   function getExcerpt() {
@@ -154,7 +154,12 @@
 
     $http_request  = "POST ".$tb_path." HTTP/1.1\r\n";
     $http_request .= "Host: ".$tb_url['host']."\r\n";
-    $http_request .= "Content-Type: application/x-www-form-urlencoded\r\n";
+    $http_request .= "Content-Type: application/x-www-form-urlencoded";
+    if (strtolower($encoding) == "cp949") {
+      $http_request .= "; charset=euc-kr\r\n";
+    } else {
+      $http_request .= "; charset=".strtolower($encoding)."\r\n";
+    }
     $http_request .= "Content-Length: ".strlen($query_string)."\r\n\r\n";
     $http_request .= $query_string."\r\n\r\n";
 
diff -urN soojung-0.4.6/classes/UserTemplate.class.php soojung/classes/UserTemplate.class.php
--- soojung-0.4.6/classes/UserTemplate.class.php	2005-02-19 18:02:46.000000000 +0900
+++ soojung/classes/UserTemplate.class.php	2005-03-31 20:35:48.000000000 +0900
@@ -1,11 +1,11 @@
-<?
+<?php
 include_once("settings.php");
 
 class UserTemplate extends Template {
   function UserTemplate($template, $cache_id)
   {
     global $blog_skin;
-    global $today_count, $total_count;
+    global $counter;
     global $entries_license;
 
     $this->Template();
@@ -18,7 +18,7 @@
     $this->assign('skin', $blog_skin);
 
     $this->compile_check = false;
-    $this->caching=true;
+    $this->caching = true;
     $this->force_compile = true; 
 
     if (!$this->is_cached($template, $cache_id)) {
@@ -53,8 +53,9 @@
       }
       $this->assign('license_link', $license_link);
     }
-    $this->assign('today_count', $today_count);
-    $this->assign('total_count', $total_count);
+    $this->assign('counter', $counter);
+    $this->assign('today_count', $counter->today);
+    $this->assign('total_count', $counter->total);
   }
 
   function clearCache() {
diff -urN soojung-0.4.6/libs/common.js soojung/libs/common.js
--- soojung-0.4.6/libs/common.js	2005-02-24 23:15:59.000000000 +0900
+++ soojung/libs/common.js	2005-03-14 01:43:50.000000000 +0900
@@ -1,6 +1,6 @@
 function fold_sidebar(objid) {
 	document.getElementById(objid).className =
-		(document.getElementById(objid).className ? '' : 'hide');
+		(document.getElementById(objid).className ? '' : 'div_hide');
 	return false;
 }
 
diff -urN soojung-0.4.6/rss2.php soojung/rss2.php
--- soojung-0.4.6/rss2.php	2005-03-01 02:01:20.000000000 +0900
+++ soojung/rss2.php	2005-03-31 20:35:48.000000000 +0900
@@ -23,7 +23,7 @@
 <pubDate><?=date('r')?></pubDate>
 <generator>soojung <?=$soojung_version?></generator>
 
-<?
+<?php
 if (isset($_GET['category'])) {
   $category = new Category($_GET['category']);
   $entries = $category->getEntries();
@@ -31,7 +31,6 @@
   $entries = Entry::getEntries(10, 1);
 }
 
-
 foreach ($entries as $e) {
   if ($e->isSetOption("NO_RSS") || $e->isSetOption("SECRET")) {
     continue;
diff -urN soojung-0.4.6/settings.php soojung/settings.php
--- soojung-0.4.6/settings.php	2005-03-11 22:03:46.000000000 +0900
+++ soojung/settings.php	2005-03-31 20:39:16.000000000 +0900
@@ -1,6 +1,6 @@
 <?php
 
-$soojung_version = '0.4.6';
+$soojung_version = '0.4.7';
 setlocale(LC_TIME, "C");
 
 header("Content-type: text/html; charset=utf-8");
@@ -23,6 +23,7 @@
 include_once("classes/Import.class.php");
 include_once("classes/Bookmark.class.php");
 include_once("classes/Calendar.class.php");
+include_once("classes/Counter.class.php");
 
 define('SMARTY_DIR', 'libs/smarty/');
 require(SMARTY_DIR . 'Smarty.class.php');
@@ -65,54 +66,9 @@
   }
 }
 
-setcookie("soojungcountercookie", "on", 0);
 
-//FIXME: move to Soojung.class.php
-function get_count() {
-  global $soojungcountercookie;
-  global $today_count;
-  global $total_count;
-  $today_count = 0;
-  $total_count = 0;
-  $last_date = date("Y-m-d");
-  $today = date("Y-m-d");
-  $modified = false;
-
-  if ($fd = @fopen("contents/.count", "r")) {
-  	flock($fd, LOCK_SH);
-    $last_date = trim(fgets($fd,256));
-    $today_count = trim(fgets($fd,256));
-    $total_count = trim(fgets($fd,256));
-    flock($fd, LOCK_UN);
-    fclose($fd);
-  }
-
-  if ($soojungcountercookie != "on" && !stristr($_SERVER['HTTP_USER_AGENT'], "googlebot")) {
-    $today_count += 1;
-    $total_count += 1;
-    $modified = true;
-  }
-  if ($today != $last_date) {
-    $modified = true;
-    $today_count = 0;
-  }
-
-  if ($modified) {
-    if ($fd = @fopen("contents/.count", "w")) {
-      flock($fd, LOCK_EX);
-      fwrite($fd, $today);
-      fwrite($fd, "\n");
-      fwrite($fd, $today_count);
-      fwrite($fd, "\n");
-      fwrite($fd, $total_count);
-      fwrite($fd, "\n");
-      flock($fd, LOCK_UN);
-      fclose($fd);
-    }
-  }
-}
-
-get_count();
+$counter = new Counter();
+$counter->update();
 Soojung::addReferer();
 
 # vim: ts=8 sw=2 sts=2 noet
diff -urN soojung-0.4.6/templates/acid/comments.tpl soojung/templates/acid/comments.tpl
--- soojung-0.4.6/templates/acid/comments.tpl	1970-01-01 09:00:00.000000000 +0900
+++ soojung/templates/acid/comments.tpl	2005-03-31 20:03:09.000000000 +0900
@@ -0,0 +1,34 @@
+{if $entry->isSetOption("NO_COMMENT") == false}
+<div class="comments" id="comment{$entry->entryId}">
+<p>{$entry->getCommentCount()} Comments</p>
+{foreach from=$comments item=comment}
+<div class="comment">
+	<a name="CO{$comment->date}"></a>
+    On {$comment->date|date_format:"%B %d, %Y %I:%M %p"},
+    {if $comment->homepage != ""}
+    <a href="{$comment->homepage|escape}">{$comment->name|escape}</a>
+    {elseif $comment->email != ""}
+    <a href="mailto:{$comment->email|escape}">{$comment->name|escape}</a>
+    {else}
+    {$comment->name|escape}
+    {/if}
+    said: <br />
+    {$comment->getBody()}
+</div>
+{/foreach}
+</div>
+<form action="entry.php?blogid={$entry->entryId}" method="post">
+<p>Post a comment</p>
+<p>Name:<br />
+<input type="text" name="name" value="{$w_name|escape}" /></p>
+<p>Email Address:<br />
+<input type="text" name="email" value="{$w_email|escape}" /></p>
+<p>URL:<br />
+<input type="text" name="url" value="{$w_url|default:"http://"|escape}" /></p>
+<p>Comments:<br />
+<textarea name="body" rows="5" cols="40"></textarea>
+<input type="hidden" name="blogid" value="{$entry->entryId}" /></p>
+<p><input type="submit" value="Post" /></p>
+</form>
+{/if}
+
diff -urN soojung-0.4.6/templates/acid/entry.tpl soojung/templates/acid/entry.tpl
--- soojung-0.4.6/templates/acid/entry.tpl	2005-03-01 02:01:20.000000000 +0900
+++ soojung/templates/acid/entry.tpl	2005-03-27 21:46:41.000000000 +0900
@@ -12,7 +12,7 @@
 <a name="trackback"></a>
 {foreach from=$trackbacks item=trackback}
 	<div class="trackback">
-	<a name="{$trackback->date}"></a>
+	<a name="TB{$trackback->date}"></a>
 	<a href="{$trackback->url|escape}">{$trackback->url|escape}</a><br />
 	{$trackback->title|escape}<br />
 	{$trackback->getExcerpt()|strip_tags|escape}
@@ -21,40 +21,6 @@
 </div>
 {/if}
 
-{if $entry->isSetOption("NO_COMMENT") == false}
-<div class="comments">
-{$entry->getCommentCount()} Comments<br />
-<a name="comment"></a>
-{foreach from=$comments item=comment}
-	<div class="comment">
-	<a name="{$comment->date}"></a>
-	On {$comment->date|date_format:"%B %d, %Y %I:%M %p"}, 
-	{if $comment->homepage != ""}
-		<a href="{$comment->homepage|escape}">{$comment->name|escape}</a>
-	{elseif $comment->email != ""}
-		<a href="mailto:{$comment->email|escape}">{$comment->name|escape}</a>
-	{else}
-		{$comment->name|escape}
-	{/if}
-	said: <br />
-	{$comment->getBody()}
-	</div>
-{/foreach}
-</div>
-
-<form action="" method="post">
-Post a comment<br />
-Name:<br />
-<input type="text" name="name" value="{$w_name|escape}"><br />
-Email Adress:<br />
-<input type="text" name="email" value="{$w_email|escape}"><br />
-URL:<br />
-<input type="text" name="url" value="{$w_url|default:"http://"|escape}"><br />
-Comments:<br />
-<textarea name="body" rows="5" cols="40"></textarea><br />
-<input type="hidden" name="blogid" value="{$entry->entryId}">
-<input type="submit" value="Post">
-</form>
-{/if}
+{include file="comments.tpl"}
 
 {include file="footer.tpl"}
diff -urN soojung-0.4.6/templates/acid/index.tpl soojung/templates/acid/index.tpl
--- soojung-0.4.6/templates/acid/index.tpl	2005-03-01 02:01:20.000000000 +0900
+++ soojung/templates/acid/index.tpl	2005-03-15 17:37:21.000000000 +0900
@@ -7,10 +7,13 @@
 		{$entry->getBody()}
 		<p class="posted">
 			<a class="plink" href="{$entry->getHref()|escape}">{$entry->date|date_format:"%B %d, %Y"}</a>
-			{if $entry->isSetOption("NO_COMMENT") == false}| <a class="plink" href="{$entry->getHref()|escape}#comment">Comments ({$entry->getCommentCount()})</a>{/if}
+			{if $entry->isSetOption("NO_COMMENT") == false}| <a class="plink" href="#none" onclick="fold_sidebar('cmt{$entry->entryId}')">Comments ({$entry->getCommentCount()})</a>{/if}
 			{if $entry->isSetOption("NO_TRACKBACK") == false}| <a class="plink" href="{$entry->getHref()|escape}#trackback">TrackBacks ({$entry->getTrackbackCount()})</a>{/if}
 
 		</p>
+        <div id="cmt{$entry->entryId}" class="div_hide">
+        {include file="comments.tpl" comments=$entry->getComments()}
+        </div>
 		</div>
 	{/foreach}
 	{if $prev_page_link != ""}
diff -urN soojung-0.4.6/templates/acid/styles.css soojung/templates/acid/styles.css
--- soojung-0.4.6/templates/acid/styles.css	2005-02-03 07:43:37.000000000 +0900
+++ soojung/templates/acid/styles.css	2005-03-27 21:36:48.000000000 +0900
@@ -1,7 +1,6 @@
 body
 {
-  margin: 0 auto;
-  padding: 0 16px;
+  margin: 0;
   font-family: georgia, "굴림", serif;
   text-align: left;
   line-height: 1.5em;
@@ -49,12 +48,6 @@
   padding-bottom: 12px;
 }
 
-#content img
-{
-  border: solid 1px #999;
-  padding: 6px;
-}
-
 h2
 {
   font-family: "lucida grande", verdana, sans-serif;
@@ -101,11 +94,12 @@
 {
   float: left;
   font-size: 90%;
-  line-height: 1.5em;
+  line-heighT: 1.5em;
   padding: 0;
   color: #999;
   width: 20%;
-  border: 1px solid #000;
+  border-right: 1px solid #000;
+  border-bottom: 1px solid #000;
 }
 
 #sidebar ul
@@ -158,7 +152,7 @@
   color: #000;
 }
 
-#sidebar .div_hide
+.div_hide
 {
   display: none;
 }
@@ -184,17 +178,21 @@
   color: #09c;
   font-size: 200%;
   font-weight: bold;
-  margin: 10px 0;
+  margin: 0;
   padding: 20px 20px;
-  width: 70%;
+  border-bottom: 1px solid #333;
 }
 
-#sidebar .calendar_days a {
-  color: #930;
+#calendar a {
+  font-weight: bold;
 }
 
 #calendar {
   text-align: center;
+  margin-bottom: 1em;
+}
+#calendar table {
+  margin: auto;
 }
 .calendar_days {
   text-align: left;
@@ -202,4 +200,4 @@
 
 #banners {
   margin: 0.5em;
-}
\ No newline at end of file
+}
diff -urN soojung-0.4.6/templates/admin/config.tpl soojung/templates/admin/config.tpl
--- soojung-0.4.6/templates/admin/config.tpl	2005-02-24 22:18:34.000000000 +0900
+++ soojung/templates/admin/config.tpl	2005-03-16 16:19:02.000000000 +0900
@@ -59,23 +59,23 @@
 
 <div class="row">
 <span class="label">Admin Password:</span>
-<span class="formw"><input type="password" name="password" {if !$config_writable}disabled{/if}> <i>If you want change the password, input new password.</i></span>
+<span class="formw"><input type="password" name="password" {if !$config_writable}disabled{/if}> <i>If you want to change the password, input new password.</i></span>
 </div>
 
 <div class="row">
-<span class="label">entries per page:</span>
+<span class="label">Entries per page:</span>
 <span class="formw"><input type="text" name="perpage" value="{$blog_entries_per_page}" {if !$config_writable}disabled{/if}></span>
 </div>
 
 <div class="row">
-<span class="label">fancy URL:</span>
+<span class="label">Fancy URL:</span>
 <span class="formw">
 <input type="checkbox" name="fancyurl" {if $blog_fancyurl}checked{/if} {if !$config_writable}disabled{/if}>
 </span>
 </div>
 
 <div class="row">
-<span class="label">notify email:</span>
+<span class="label">Notify email:</span>
 <span class="formw">
 <input type="checkbox" name="notify" {if $blog_notify}checked{/if} {if !$config_writable}disabled{/if}>
 </span>
diff -urN soojung-0.4.6/templates/admin/header.tpl soojung/templates/admin/header.tpl
--- soojung-0.4.6/templates/admin/header.tpl	2005-01-25 22:14:36.000000000 +0900
+++ soojung/templates/admin/header.tpl	2005-03-28 10:45:58.000000000 +0900
@@ -5,6 +5,7 @@
 <link rel="stylesheet" type="text/css" href="{$baseurl}/templates/admin/styles.css"/>
 <script type="text/javascript" src="{$baseurl}/templates/admin/javascript.js"></script>
 <script type="text/javascript" src="{$baseurl}/libs/fckeditor/fckeditor.js"></script>
+<script type="text/javascript" src="{$baseurl}/libs/common.js"></script>
 <title>Admin</title>
 </head>
-<body>
\ No newline at end of file
+<body>
diff -urN soojung-0.4.6/templates/admin/list.tpl soojung/templates/admin/list.tpl
--- soojung-0.4.6/templates/admin/list.tpl	2005-02-19 18:07:16.000000000 +0900
+++ soojung/templates/admin/list.tpl	2005-03-28 10:45:58.000000000 +0900
@@ -15,34 +15,65 @@
 {/if}
 </p>
 
-<span class="subject"><b>Subject</b></span>
-<span class="trackback_ping"><b>Trackback</b></span>
-<span class="delete"><b>Delete</b></span>
-
-{foreach from=$entries item=entry}
-<div class="entry">
-	<span class="subject"><a href="{$baseurl}/post.php?blogid={$entry->entryId}">{$entry->title}</a></span>
-	<span class="trackback_ping"><a href="{$baseurl}/sendping.php?blogid={$entry->entryId}">Ping</a></span>
-	<span class="delete"><a href="{$baseurl}/admin.php?mode=delete_entry&blogid={$entry->entryId}" onclick="return confirm('Are you sure want to delete this entry?\nTitle: {$entry->title}');">X</a></span>
-</div>
-
-	{foreach from=$entry->getComments() item=comment}
-	<div class="comment">
-		<span class="subject">{$comment->getBody()|strip_tags|substring:70}</span>
-		<span class="trackback_ping">&nbsp;</span>
-		<span class="delete"><a href="{$baseurl}/admin.php?mode=delete&file={$comment->filename}" onclick="return confirm('Are you sure want to delete this comment?\nAuthor: {$comment->name}');">X</a></span>
-	</div>
-	{/foreach}
-
-	{foreach from=$entry->getTrackbacks() item=trackback}
-	<div class="trackback">
-		<span class="subject">{$trackback->url|strip_tags|substring:70}</span>
-		<span class="trackback_ping">&nbsp;</span>
-		<span class="delete"><a href="{$baseurl}/admin.php?mode=delete&file={$trackback->filename}" onclick="return confirm('Are you sure want to delete this trackback?\nURL: {$trackback->url}');">X</a></span>
-	</div>
-	{/foreach}
-
-{/foreach}
+<table class="entries">
+    <tr>
+        <td class="subject"><b>Subject</b></td>
+        <td class="comments"><b>Comment</b></td>
+        <td class="trackbacks"><b>Trackback</b></td>
+        <td class="trackback_ping"><b>Ping</b></td>
+        <td class="delete"><b>Delete</b></td>
+    </tr>
+    
+    {foreach from=$entries item=entry}
+    <tr class="entry">
+        <td><div class="subject"><a href="{$baseurl}/post.php?blogid={$entry->entryId}">{$entry->title}</a></div></td>
+        <td class="comments">
+            {if $entry->isSetOption("NO_COMMENT") == false && $entry->getCommentCount() != 0}
+            <a href="#none" onclick="return fold_sidebar('CO_{$entry->entryId}');">({$entry->getCommentCount()})</a>
+            {else}
+            (0)
+            {/if}
+        </td>
+        <td class="trackbacks">
+            {if $entry->isSetOption("NO_TRACKBACK") == false && $entry->getTrackbackCount() != 0}
+            <a href="#none" onclick="return fold_sidebar('TB_{$entry->entryId}');">({$entry->getTrackbackCount()})</a>
+            {else}
+            (0)
+            {/if}
+        </td>
+        <td class="trackback_ping"><a href="{$baseurl}/sendping.php?blogid={$entry->entryId}">Ping</a></td>
+        <td class="delete"><a href="{$baseurl}/admin.php?mode=delete_entry&amp;blogid={$entry->entryId}" onclick="return confirm('Are you sure want to delete this entry?\nTitle: {$entry->title}');">X</a></td>
+    </tr>
+    
+    {if $entry->isSetOption("NO_COMMENT") == false && $entry->getCommentCount() != 0}
+    <tr><td colspan="5" id="CO_{$entry->entryId}" class="div_hide">
+        {foreach from=$entry->getComments() item=comment}
+        <table class="comment"><tr>
+            <td><div class="subject">{$comment->getBody()|strip_tags|substring:70}</div></td>
+            <td class="comments">&nbsp;</td>
+            <td class="trackbacks">&nbsp;</td>
+    	    <td class="trackback_ping">&nbsp;</td>
+        	<td class="delete"><a href="{$baseurl}/admin.php?mode=delete&amp;file={$comment->filename}" onclick="return confirm('Are you sure want to delete this comment?\nAuthor: {$comment->name}');">X</a></td>
+        </tr></table>
+        {/foreach}
+    </td></tr>
+    {/if}
+
+    {if $entry->isSetOption("NO_TRACKBACK") == false && $entry->getTrackbackCount() != 0}
+    <tr><td colspan="5" id="TB_{$entry->entryId}" class="div_hide">
+        {foreach from=$entry->getTrackbacks() item=trackback}
+        <table class="trackback"><tr>
+            <td><div class="subject">{$trackback->getExcerpt()|strip_tags|substring:70}</div></td>
+            <td class="comments">&nbsp;</td>
+            <td class="trackbacks">&nbsp;</td>
+    	    <td class="trackback_ping">&nbsp;</td>
+            <td class="delete"><a href="{$baseurl}/admin.php?mode=delete&amp;file={$trackback->filename}" onclick="return confirm('Are you sure want to delete this trackback?\nURL: {$trackback->url}');">X</a></td>
+        </tr></table>
+        {/foreach}
+    </td></tr>
+    {/if}
+    {/foreach}
+</table>
 
 </div>
 
diff -urN soojung-0.4.6/templates/admin/post.tpl soojung/templates/admin/post.tpl
--- soojung-0.4.6/templates/admin/post.tpl	2005-03-11 22:03:47.000000000 +0900
+++ soojung/templates/admin/post.tpl	2005-03-23 09:23:46.000000000 +0900
@@ -1,98 +1,98 @@
-{include file="header.tpl"}
-{include file="menu.tpl"}
-
-
-<div id="post">
-<form action="{$baseurl}/post.php" method="post" name="postForm">
-<div class="row">
-<span class="label">Title:</span>
-<span class="formw"><input type="text" name="title" value="{$title}"></span>
-</div>
-
-<div class="row">
-<span class="label">Date:</span>
-<span class="formw"><input type="text" name="date" value="{$date}">
-</div>
-
-<div class="row">
-<span class="label">Category:</span>
-<span class="formw">
-<input type="text" name="category_input" value="{$category}"> or 
-{foreach name=categories from=$categories item=cate}
-{if $smarty.foreach.categories.first}
-<select name="category">
-{/if}
-	<option value="{$cate->name}" {if $category == $cate->name}selected{/if}>{$cate->name}
-{foreachelse}
-<select name="category" disabled>
-{/foreach}
-</select>
-</span>
-</div>
-
-<div class="row">
-<span class="label">Options:</span>
-<span class="formw">
-<input type="checkbox" name="SECRET" {if $secret}checked{/if}>SECRET
-<input type="checkbox" name="NO_COMMENT" {if $no_comment}checked{/if}>NO_COMMENT
-<input type="checkbox" name="NO_TRACKBACK" {if $no_trackback}checked{/if}>NO_TRACKBACK
-<input type="checkbox" name="STATIC" {if $static}checked{/if}>STATIC
-<input type="checkbox" name="NO_RSS" {if $no_rss}checked{/if}>NO_RSS
-</span>
-</div>
-
-<div class="row">
-<span class="label">Format:</span>
-<span class="formw">
-<input type="radio" name="format" value="plain" {if $format == "plain" || $format == ""}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=plain')">plain
-<input type="radio" name="format" value="html" {if $format == "html"}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=html')">html
-<input type="radio" name="format" value="bbcode" {if $format == "bbcode"}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=bbcode')">bbcode
-</span>
-</div>
-
-<div class="row">
-<span class="label">Body:</span>
-<span class="formw">
-<textarea id="body" name="body" rows="10" cols="65">{$body|escape}</textarea>
-{if $format == "html"}
-<script type="text/javascript">
-	var oFCKeditor = new FCKeditor('body');
-	oFCKeditor.BasePath = "libs/fckeditor/";
-	oFCKeditor.Width = "80%";
-	oFCKeditor.Height = "300";
-	oFCKeditor.ReplaceTextarea();
-</script>
-{/if}
-</span>
-</div>
-
-<div class="row">
-<span class="label">Upload:</span>
-<span class="formw">
-<a href="#" onClick="window.open('{$baseurl}/upload.php','blah','width=500,height=300')">Upload Files</a>
-</span>
-</div>
-
-{if $id != null}
-<input type="hidden" name="id" value="{$id}">
-{/if}
-
-<div class="row">
-<span class="formw">
-<input type="submit" name="mode" value="Preview">
-<input type="submit" name="mode" value="Post">
-</span>
-</div>
-
-</form>
-
-{if $mode == "preview"}
-<h1>Preview</h1>
-<h2>{$title}</h2>
-{$body}
-<br />
-{$category}, {$date}
-{/if}
-
-</div>
-{include file="footer.tpl"}
+{include file="header.tpl"}
+{include file="menu.tpl"}
+
+{if $mode == "preview"}
+<h1>preview</h1>
+<h2>{$title}</h2>
+{$body}
+<br />
+{$category}, {$date}
+<hr />
+{/if}
+
+<div id="post">
+<form action="{$baseurl}/post.php" method="post" name="postForm">
+<div class="row">
+<span class="label">Title:</span>
+<span class="formw"><input type="text" name="title" value="{$title}"></span>
+</div>
+
+<div class="row">
+<span class="label">Date:</span>
+<span class="formw"><input type="text" name="date" value="{$date}">
+</div>
+
+<div class="row">
+<span class="label">Category:</span>
+<span class="formw">
+<input type="text" name="category_input" value="{$category}"> or 
+{foreach name=categories from=$categories item=cate}
+{if $smarty.foreach.categories.first}
+<select name="category">
+{/if}
+	<option value="{$cate->name}" {if $category == $cate->name}selected{/if}>{$cate->name}
+{foreachelse}
+<select name="category" disabled>
+{/foreach}
+</select>
+</span>
+</div>
+
+<div class="row">
+<span class="label">Options:</span>
+<span class="formw">
+<input type="checkbox" name="SECRET" {if $secret}checked{/if}>SECRET
+<input type="checkbox" name="NO_COMMENT" {if $no_comment}checked{/if}>NO_COMMENT
+<input type="checkbox" name="NO_TRACKBACK" {if $no_trackback}checked{/if}>NO_TRACKBACK
+<input type="checkbox" name="STATIC" {if $static}checked{/if}>STATIC
+<input type="checkbox" name="NO_RSS" {if $no_rss}checked{/if}>NO_RSS
+</span>
+</div>
+
+<div class="row">
+<span class="label">Format:</span>
+<span class="formw">
+<input type="radio" name="format" value="plain" {if $format == "plain" || $format == ""}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=plain')">plain
+<input type="radio" name="format" value="html" {if $format == "html"}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=html')">html
+<input type="radio" name="format" value="bbcode" {if $format == "bbcode"}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=bbcode')">bbcode
+<input type="radio" name="format" value="moniwiki" {if $format == "moniwiki"}checked{/if} onClick="go('{$baseurl}/post.php?blogid={$id}&format=moniwiki')">moniwiki
+</span>
+</div>
+
+<div class="row">
+<span class="label">Body:</span>
+<span class="formw">
+<textarea id="body" name="body" rows="10" cols="65">{$body|escape}</textarea>
+{if $format == "html"}
+<script type="text/javascript">
+	var oFCKeditor = new FCKeditor('body');
+	oFCKeditor.BasePath = "libs/fckeditor/";
+	oFCKeditor.Width = "80%";
+	oFCKeditor.Height = "300";
+	oFCKeditor.ReplaceTextarea();
+</script>
+{/if}
+</span>
+</div>
+
+<div class="row">
+<span class="label">Upload:</span>
+<span class="formw">
+<a href="#" onClick="window.open('{$baseurl}/upload.php','blah','width=500,height=300')">Upload Files</a>
+</span>
+</div>
+
+{if $id != null}
+<input type="hidden" name="id" value="{$id}">
+{/if}
+
+<div class="row">
+<span class="formw">
+<input type="submit" name="mode" value="Preview">
+<input type="submit" name="mode" value="Post">
+</span>
+</div>
+
+</form>
+</div>
+{include file="footer.tpl"}
diff -urN soojung-0.4.6/templates/admin/styles.css soojung/templates/admin/styles.css
--- soojung-0.4.6/templates/admin/styles.css	2005-03-11 22:03:47.000000000 +0900
+++ soojung/templates/admin/styles.css	2005-03-28 10:45:58.000000000 +0900
@@ -99,41 +99,46 @@
 }
 
 /* list */
-.entry
+#list table
 {
-  padding-top: 25px;
+  border-spacing: 0;
+  border-collapse: collapse;  
+  text-align: center;
 }
 
-.comment, .trackback
-{ 
-  padding-top: 20px;
+.entries
+{
+  margin-left: 10px;
 }
 
 .subject
 {
   white-space:nowrap;
   overflow:hidden;
-  position:absolute;
-  left: 200px;
   width: 400px;
+  text-align: left;         
+}
+
+.comments,  .trackbacks
+{
+  font-size: 12px;
+  width: 65px;
 }
 
 .comment .subject, .trackback .subject
 { 
-  left: 220px;
+  margin-left: 20px;
   width: 380px;
 }
 
 .trackback_ping
 {
-  position:absolute;
-  left: 610px;
+  width: 40px;
 }
 
 .delete
 {
-  position:absolute;
-  left: 700px;
+  width: 52px;
 }
 
 .navbar
@@ -142,7 +147,7 @@
   padding: 5px 10px 20px 10px;
 }
 
-.hide
+.div_hide, .hide
 {
   display:none;
 }
diff -urN soojung-0.4.6/templates/asual/entry.tpl soojung/templates/asual/entry.tpl
--- soojung-0.4.6/templates/asual/entry.tpl	2005-03-01 02:01:20.000000000 +0900
+++ soojung/templates/asual/entry.tpl	2005-03-27 21:46:41.000000000 +0900
@@ -28,7 +28,7 @@
 	</p>
 {foreach from=$trackbacks item=trackback}
 	<div class="trackback">
-		<a name="{$trackback->date}"></a>
+		<a name="TB{$trackback->date}"></a>
 		<p class="blue">
 			Trackback from <a href="{$trackback->url|escape}">{$trackback->url|escape}</a>
 		</p>
@@ -47,7 +47,7 @@
 	<h3>Comments on this entry:</h3>
 {foreach from=$comments item=comment}
 	<div class="comment">
-		<a name="{$comment->date}"></a>
+		<a name="CO{$comment->date}"></a>
 		<p class="blue">
 			Left on {$comment->date|date_format:"%B %d, %Y %I:%M %p"} by
 			{if $comment->homepage != ""}
diff -urN soojung-0.4.6/templates/box/config.conf soojung/templates/box/config.conf
--- soojung-0.4.6/templates/box/config.conf	1970-01-01 09:00:00.000000000 +0900
+++ soojung/templates/box/config.conf	2005-03-27 21:01:48.000000000 +0900
@@ -0,0 +1,19 @@
+targetBlank=0
+ImageMaxWidth=510
+
+# sidebar configure
+# -1 : not appeared
+#  0 : appeared & folded
+#  1 : appeared & not folded
+showCategory = 1
+showCalendar = 1
+showStaticEntries = -1
+showRecentEntries = -1 
+showRecentComments = 0 
+showRecentTrackbacks = 0
+showArchives = 1
+showRecentReferers = 0 
+showBookmarks = 0 
+showSearch = 1
+
+# thx tokigun
diff -urN soojung-0.4.6/templates/box/entry.tpl soojung/templates/box/entry.tpl
--- soojung-0.4.6/templates/box/entry.tpl	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/entry.tpl	2005-03-27 21:46:41.000000000 +0900
@@ -1,72 +1,74 @@
 {include file="header.tpl"}
-			<div id="entries">
-				<div class="entry">
-					<div class="entrytitle" style="color: #777777;">{$entry->title|escape}</div>
-					<div class="entrybody">{$entry->getBody()}</div>
-					<div class="entrydate">
-						posted at {$entry->date|date_format:"%y/%m/%d %H:%M"}
-						| <a class="plink" href="{$entry->category->getHref()|escape}">{$entry->category->name|escape}</a>
-						{if $entry->isSetOption("NO_COMMENT") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_CO_{$entry->entryId}');">Comments ({$entry->getCommentCount()})</a>{/if}
-{if $entry->isSetOption("NO_TRACKBACK") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_TB_{$entry->entryId}');">TrackBacks ({$entry->getTrackbackCount()})</a>{/if}
+<div id="entries">
+	<div class="entry">
+		<div class="entrytitle" style="color: #777777;">{$entry->title|escape}</div>
+		<div class="entrybody">{$entry->getBody()}</div>
+		<div class="entrydate">
+			posted at {$entry->date|date_format:"%y/%m/%d %H:%M"}
+			| <a class="plink" href="{$entry->category->getHref()|escape}">{$entry->category->name|escape}</a>
+			{if $entry->isSetOption("NO_COMMENT") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_CO_{$entry->entryId}');">Comments ({$entry->getCommentCount()})</a>{/if}
+            {if $entry->isSetOption("NO_TRACKBACK") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_TB_{$entry->entryId}');">TrackBacks ({$entry->getTrackbackCount()})</a>{/if}
+		</div>
+        
+		{if $entry->isSetOption("NO_TRACKBACK") == false}
+		<div id="div_TB_{$entry->entryId}" style="text-align:left;">
+			<div class="graybox">
+				<div class="gray8" style="text-align:right; padding: 5px;">
+					&nbsp;Track this back : <span class="trackbackurl" onclick="copy_clip(this.innerHTML);">{$baseurl}/trackback.php?blogid={$entry->entryId}</span>
+				</div>
+				{foreach from=$trackbacks item=trackback}
+				<div id="TB{$trackback->date}" class="blue8" style="width: 100%; margin: 5px 5px 0 0; color: #999999;">
+					<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Tracked from <a href="{$trackback->url|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}><b>{$trackback->name|escape}</b></a>
+					at {$trackback->date|date_format:"%y/%m/%d %H:%M"}
+				</div>
+				<div class="blue8" style="margin: 0 0 5px 15px;  color: #555555;">
+					<a href="{$trackback->url|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>{$trackback->title|escape}</a><br />
+					{$trackback->getExcerpt()|strip_tags}
+				</div>
+				{/foreach}
+			</div>
+		</div>
+		{/if}
+        
+		{if $entry->isSetOption("NO_COMMENT") == false}
+		<div id="div_CO_{$entry->entryId}" style="text-align: left;">
+			<div class="graybox">
+		    	{foreach from=$comments item=comment}
+				<div id="CO{$comment->date}" class="blue8" style="margin: 5px 5px 0 0; color: #999999;">
+					<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Commented by<b>
+					{if $comment->homepage != ""}
+					<a href="{$comment->homepage|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>{$comment->name|escape}</a>
+					{elseif $comment->email != ""}
+					<a href="mailto:{$comment->email|escape}">{$comment->name|escape}</a>
+					{else}
+					{$comment->name|escape}
+					{/if}
+                    </b>
+					at {$comment->date|date_format:"%y/%m/%d %H:%M"}
+				</div>
+				<div class="blue8" style="margin: 0 0 5px 15px; color:#555555;">{$comment->getBody()}</div>
+				{/foreach}
+				<br />
+				<form action="{$baseurl}/entry.php" method="post">
+					<div class="blue8" style="text-align:right; padding:0 0 3px 0;">
+						Name <input class="comment_text" type="text" name="name" value="{$w_name|escape}" style="width: 50px;" /> &nbsp;
+						Email <input class="comment_text" type="text" name="email" value="{$w_email|escape}" style="width: 50px;" /> &nbsp;
+						Homepage <input class="comment_text" type="text" name="url" value="{$w_url|default:"http://"|escape}" style="width: 200px;" />
 					</div>
-					{if $entry->isSetOption("NO_TRACKBACK") == false}
-					<div id="div_TB_{$entry->entryId}" style="text-align:left;">
-						<div class="graybox">
-							<div class="gray8" style="text-align:right; padding: 5px;">
-								&nbsp;Track this back : <span style="font-size:7pt;" onclick="copy_clip(this.innerHTML);" onMouseOver="this.style.cursor='pointer';">{$baseurl}/trackback.php?blogid={$entry->entryId}</span>
-							</div>
-							{foreach from=$trackbacks item=trackback}
-							<div class="blue8" style="width: 100%; margin: 5px 5px 0 0; color: #999999;">
-								<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Tracked from <a href="{$trackback->url|escape}" onclick="seturltarget(this,'_blank');"><b>{$trackback->name|escape}</b></a>
-								at {$trackback->date|date_format:"%y/%m/%d %H:%M"}
-							</div>
-							<div class="blue8" style="margin: 0 0 5px 15px;  color: #555555;">
-								<a href="{$trackback->url|escape}" onclick="seturltarget(this,'_blank');">{$trackback->title|escape}</a><br />
-								{$trackback->getExcerpt()|strip_tags}
-							</div>
-							{/foreach}
-						</div>
+					<div style="text-align:right;">
+						<textarea class="comment_text" name="body" rows="3" cols="" style="width: 90%; overflow-y: auto; overflow-x: hidden;"></textarea>
 					</div>
-					{/if}
-					{if $entry->isSetOption("NO_COMMENT") == false}
-					<div id="div_CO_{$entry->entryId}" style="text-align: left;">
-						<div class="graybox">
-							{foreach from=$comments item=comment}
-							<div class="blue8" style="margin: 5px 5px 0 0; color: #999999;">
-								<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Commented by<b>
-									{if $comment->homepage != ""}
-									<a href="{$comment->homepage|escape}" onclick="seturltarget(this,'_blank');">{$comment->name|escape}</a>
-									{elseif $comment->email != ""}
-									<a href="mailto:{$comment->email|escape}">{$comment->name|escape}</a>
-									{else}
-									{$comment->name|escape}
-									{/if}
-								</b>
-								at {$comment->date|date_format:"%y/%m/%d %H:%M"}
-							</div>
-							<div class="blue8" style="margin: 0 0 5px 15px; color:#555555;">{$comment->getBody()}</div>
-							{/foreach}
-							<br />
-							<form action="entry.php" method="post">
-								<div class="blue8" style="text-align:right; padding:0 0 3px 0;">
-									Name <input class="comment_text" type="text" name="name" value="{$w_name|escape}" style="width: 50px;" /> &nbsp;
-									Email <input class="comment_text" type="text" name="email" value="{$w_email|escape}" style="width: 50px;" /> &nbsp;
-									Homepage <input class="comment_text" type="text" name="url" value="{$w_url|default:"http://"|escape}" style="width: 200px;" />
-								</div>
-								<div style="text-align:right;">
-									<textarea class="comment_text" name="body" rows="3" cols="" style="width: 90%; overflow-y: auto; overflow-x: hidden;"></textarea>
-								</div>
-								<div style="text-align:right; padding: 3px 0 0 0;" class="gray7">
-									<input type="hidden" name="blogid" value="{$entry->entryId}" />
-									<input type="submit" value="save" style="color:#999999; background-color:#F7F7F7; border: 1px #CCCCCC solid; width: 50px; height: 17px; overflow: auto; font-size: 8pt;" />
-								</div>
-							</form>
-						</div>
+					<div style="text-align:right; padding: 3px 0 0 0;" class="gray7">
+						<input type="hidden" name="blogid" value="{$entry->entryId}" />
+						<input type="submit" value="save" style="color:#999999; background-color:#F7F7F7; border: 1px #CCCCCC solid; width: 50px; height: 17px; overflow: auto; font-size: 8pt;" />
 					</div>
-					{/if}
-				</div>
+				</form>
 			</div>
 		</div>
+		{/if}
+
 	</div>
+</div>
+
 {include file="sidebar.tpl"}
 {include file="footer.tpl"}
diff -urN soojung-0.4.6/templates/box/footer.tpl soojung/templates/box/footer.tpl
--- soojung-0.4.6/templates/box/footer.tpl	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/footer.tpl	2005-03-27 21:01:48.000000000 +0900
@@ -1,7 +1,9 @@
-	<div id="footer">
+    </div>
+
+    <div id="footer">
 		<p>
 			{$license_link}<br />
-			Powered by <a href="http://soojung.kldp.net">soojung {$soojung_version}</a>
+			Powered by <a href="http://soojung.kldp.net" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>soojung {$soojung_version}</a>
 		</p>
 	</div>
 </body>
diff -urN soojung-0.4.6/templates/box/header.tpl soojung/templates/box/header.tpl
--- soojung-0.4.6/templates/box/header.tpl	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/header.tpl	2005-03-27 21:01:48.000000000 +0900
@@ -1,3 +1,4 @@
+{config_load file="config.conf"}
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
 <html>
 <head>
@@ -10,7 +11,7 @@
 <script type="text/javascript" src="{$baseurl}/templates/{$skin}/javascript.js"></script>
 
 </head>
-<body onload="on_load();">
+<body onload="on_load({#ImageMaxWidth#});">
 <div id="bg">
 	<div id="leftbox" class="blackbox">
 		<div id="main">
@@ -19,7 +20,7 @@
 					<a href="{$baseurl}/admin.php" class="silver7">admin</a>
 				</div>
 				<div class="blogtitle" style="font-size: 18pt;">
-					<a href="{$baseurl}" title="{$description}">{$title}</a> &nbsp; <a href="{$baseurl}/rss2.php" onclick="seturltarget(this,'_blank');"><img src="{$baseurl}/templates/{$skin}/imgs/xml.gif" alt=""/></a>
+					<a href="{$baseurl}" title="{$description}">{$title}</a> &nbsp; <a href="{$baseurl}/rss2.php" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}><img src="{$baseurl}/templates/{$skin}/imgs/xml.gif" alt="rss 2.0 feed"/></a>
 				</div>
 				<div class="blogdesc">{$description}</div>
 			</div>
diff -urN soojung-0.4.6/templates/box/index.tpl soojung/templates/box/index.tpl
--- soojung-0.4.6/templates/box/index.tpl	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/index.tpl	2005-03-27 21:46:41.000000000 +0900
@@ -1,119 +1,123 @@
 {include file="header.tpl"}
-			<div id="entries">
-				{if $view == "index"}
-				{foreach from=$entries item=entry}
-				<div class="entry">
-					<div class="entrytitle"><a href="{$entry->getHref()|escape}">{$entry->title|escape}</a></div>
-					<div class="entrybody">{$entry->getBody()}</div>
-					<div class="entrydate">
-						<a class="plink" href="{$entry->getHref()|escape}">posted at {$entry->date|date_format:"%y/%m/%d %H:%M"}</a>
-						| <a class="plink" href="{$entry->category->getHref()|escape}">{$entry->category->name|escape}</a>
-						{if $entry->isSetOption("NO_COMMENT") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_CO_{$entry->entryId}');">Comments ({$entry->getCommentCount()})</a>{/if}
-						{if $entry->isSetOption("NO_TRACKBACK") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_TB_{$entry->entryId}');">TrackBacks ({$entry->getTrackbackCount()})</a>{/if}
-					</div>
-					{if $entry->isSetOption("NO_TRACKBACK") == false}
-					<div id="div_TB_{$entry->entryId}" style="text-align:left;" class="div_hide">
-						<div class="graybox">
-							<div class="gray8" style="text-align:right; padding: 5px;">
-								&nbsp;Track this back : <span style="font-size:7pt;" onclick="copy_clip(this.innerHTML);" onMouseOver="this.style.cursor='pointer';">{$baseurl}/trackback.php?blogid={$entry->entryId}</span>
-							</div>
-							{foreach from=$entry->getTrackbacks() item=trackback}
-							<div class="blue8" style="width: 100%; margin: 5px 5px 0 0; color: #999999;">
-								<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Tracked from <a href="{$trackback->url|escape}" onclick="seturltarget(this,'_blank');"><b>{$trackback->name|escape}</b></a>
-								at {$trackback->date|date_format:"%y/%m/%d %H:%M"}
-							</div>
-							<div class="blue8" style="margin: 0 0 5px 15px;  color: #555555;">
-								<a href="{$trackback->url|escape}" onclick="seturltarget(this,'_blank');">{$trackback->title|escape}</a><br />
-								{$trackback->getExcerpt()|strip_tags|escape}
-							</div>
-							{/foreach}
-						</div>
-					</div>
-					{/if}
-					{if $entry->isSetOption("NO_COMMENT") == false}
-					<div id="div_CO_{$entry->entryId}" style="text-align: left;" class="div_hide">
-						<div class="graybox">
-							{foreach from=$entry->getComments() item=comment}
-							<div class="blue8" style="margin: 5px 5px 0 0; color: #999999;">
-								<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Commented by<b>
-									{if $comment->homepage != ""}
-									<a href="{$comment->homepage|escape}" onclick="seturltarget(this,'_blank');">{$comment->name|escape}</a>
-									{elseif $comment->email != ""}
-									<a href="mailto:{$comment->email|escape}">{$comment->name|escape}</a>
-									{else}
-									{$comment->name|escape}
-									{/if}
-								</b>
-								at {$comment->date|date_format:"%y/%m/%d %H:%M"}
-							</div>
-							<div class="blue8" style="margin: 0 0 5px 15px; color:#555555;">{$comment->getBody()}</div>
-							{/foreach}
-							<br />
-							<form action="entry.php" method="post">
-								<div class="blue8" style="text-align:right; padding:0 0 3px 0;">
-									Name <input class="comment_text" type="text" name="name" value="{$w_name|escape}" style="width: 50px;" /> &nbsp;
-									Email <input class="comment_text" type="text" name="email" value="{$w_email|escape}" style="width: 50px;" /> &nbsp;
-									Homepage <input class="comment_text" type="text" name="url" value="{$w_url|default:"http://"|escape}" style="width: 200px;" />
-								</div>
-								<div style="text-align:right;">
-									<textarea class="comment_text" name="body" rows="3" cols="" style="width: 90%; overflow-y: auto; overflow-x: hidden;"></textarea>
-								</div>
-								<div style="text-align: right; padding: 3px 0 0 0;" class="gray7">
-									<input type="hidden" name="blogid" value="{$entry->entryId}" />
-									<input type="submit" value="save" style="color:#999999; background-color:#F7F7F7; border: 1px #CCCCCC solid; width: 50px; height: 17px; overflow: auto; font-size: 8pt;" />
-								</div>
-							</form>
-						</div>
-					</div>
+<div id="entries">
+    {if $view == "index"}
+    {foreach from=$entries item=entry}
+	<div class="entry">
+		<div class="entrytitle"><a href="{$entry->getHref()|escape}">{$entry->title|escape}</a></div>
+		<div class="entrybody">{$entry->getBody()}</div>
+		<div class="entrydate">
+			<a class="plink" href="{$entry->getHref()|escape}">posted at {$entry->date|date_format:"%y/%m/%d %H:%M"}</a>
+			| <a class="plink" href="{$entry->category->getHref()|escape}">{$entry->category->name|escape}</a>
+			{if $entry->isSetOption("NO_COMMENT") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_CO_{$entry->entryId}');">Comments ({$entry->getCommentCount()})</a>{/if}
+			{if $entry->isSetOption("NO_TRACKBACK") == false}| <a class="plink" href="#none" onclick="return fold_sidebar('div_TB_{$entry->entryId}');">TrackBacks ({$entry->getTrackbackCount()})</a>{/if}
+		</div>
+        
+		{if $entry->isSetOption("NO_TRACKBACK") == false}
+		<div id="div_TB_{$entry->entryId}" style="text-align:left;" class="div_hide">
+			<div class="graybox">
+				<div class="gray8" style="text-align:right; padding: 5px;">
+					&nbsp;Track this back : <span class="trackbackurl" onclick="copy_clip(this.innerHTML);">{$baseurl}/trackback.php?blogid={$entry->entryId}</span>
+				</div>
+				{foreach from=$entry->getTrackbacks() item=trackback}
+				<div id="TB{$trackback->date}" class="blue8" style="width: 100%; margin: 5px 5px 0 0; color: #999999;">
+					<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Tracked from <a href="{$trackback->url|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}><b>{$trackback->name|escape}</b></a>
+					at {$trackback->date|date_format:"%y/%m/%d %H:%M"}
+				</div>
+				<div class="blue8" style="margin: 0 0 5px 15px;  color: #555555;">
+					<a href="{$trackback->url|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>{$trackback->title|escape}</a><br />
+					{$trackback->getExcerpt()|strip_tags|escape}
+				</div>
+				{/foreach}
+			</div>
+		</div>
+		{/if}
+        
+		{if $entry->isSetOption("NO_COMMENT") == false}
+		<div id="div_CO_{$entry->entryId}" style="text-align: left;" class="div_hide">
+			<div class="graybox">
+			    {foreach from=$entry->getComments() item=comment}
+		    	<div id="CO{$comment->date}" class="blue8" style="margin: 5px 5px 0 0; color: #999999;">
+					<img src="{$baseurl}/templates/{$skin}/imgs/comment.gif" alt="" /> Commented by<b>
+					{if $comment->homepage != ""}
+					<a href="{$comment->homepage|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>{$comment->name|escape}</a>
+					{elseif $comment->email != ""}
+					<a href="mailto:{$comment->email|escape}">{$comment->name|escape}</a>
+					{else}
+					{$comment->name|escape}
 					{/if}
+					</b>
+					at {$comment->date|date_format:"%y/%m/%d %H:%M"}
 				</div>
+				<div class="blue8" style="margin: 0 0 5px 15px; color:#555555;">{$comment->getBody()}</div>
 				{/foreach}
-				<div class="page">
-					<div class="link" style="clear:both;position:relative;float:left;text-align:left">
-						{if $prev_page_link != ""}
-						<a href="{$prev_page_link|escape}" class="link">&lt;&lt; prev</a>
-						{else}&lt;&lt; prev
-						{/if}
+				<br />
+				<form action="{$baseurl}/entry.php" method="post">
+					<div class="blue8" style="text-align:right; padding:0 0 3px 0;">
+    					Name <input class="comment_text" type="text" name="name" value="{$w_name|escape}" style="width: 50px;" /> &nbsp;
+						Email <input class="comment_text" type="text" name="email" value="{$w_email|escape}" style="width: 50px;" /> &nbsp;
+						Homepage <input class="comment_text" type="text" name="url" value="{$w_url|default:"http://"|escape}" style="width: 200px;" />
 					</div>
-				
-					<div class="link" style="position:relative;float:right;text-align:right">
-						{if $next_page_link != ""}
-						<a href="{$next_page_link|escape}" class="link">next &gt;&gt;</a>
-						{else}
-						next &gt;&gt; 
-						{/if}
+					<div style="text-align:right;">
+						<textarea class="comment_text" name="body" rows="3" cols="" style="width: 90%; overflow-y: auto; overflow-x: hidden;"></textarea>
 					</div>
-				</div>
-
-				{elseif $view == "archive"}
-				<div class="graybox">
-					{foreach from=$entries item=entry}
-					<font style="font-size: 8pt;">{$entry->date|date_format:"%y/%m/%d"}</font>
-					&nbsp;<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
-					<br />
-					{/foreach}
-				</div>
-				
-				{elseif $view == "category"}
-				<div class="graybox">
-					{foreach from=$entries item=entry}
-					<font style="font-size: 8pt;">{$entry->date|date_format:"%y/%m/%d"}</font>
-					&nbsp;<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
-					<br />
-					{/foreach}
-				</div>
-				{elseif $view == "search"}
-				<div class="graybox">
-					{foreach from=$entries item=entry}
-					<font style="font-size: 8pt;">{$entry->date|date_format:"%y/%m/%d"}</font>
-					&nbsp;<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
-					<br />
-					{/foreach}
-				</div>
-				{/if}
+	    			<div style="text-align: right; padding: 3px 0 0 0;" class="gray7">
+						<input type="hidden" name="blogid" value="{$entry->entryId}" />
+						<input type="submit" value="save" style="color:#999999; background-color:#F7F7F7; border: 1px #CCCCCC solid; width: 50px; height: 17px; overflow: auto; font-size: 8pt;" />
+					</div>
+				</form>
 			</div>
 		</div>
+		{/if}
+        
+	</div>
+	{/foreach}
+    
+	<div class="page">
+		<div class="link" style="clear:both;position:relative;float:left;text-align:left">
+	    	{if $prev_page_link != ""}
+			<a href="{$prev_page_link|escape}" class="link">&lt;&lt; prev</a>
+			{else}&lt;&lt; prev
+			{/if}
+		</div>
+				
+		<div class="link" style="position:relative;float:right;text-align:right">
+			{if $next_page_link != ""}
+			<a href="{$next_page_link|escape}" class="link">next &gt;&gt;</a>
+			{else}
+			next &gt;&gt; 
+			{/if}
+		</div>
+	</div>
+
+    {elseif $view == "archive"}
+	<div class="graybox">
+		{foreach from=$entries item=entry}
+		<font style="font-size: 8pt;">{$entry->date|date_format:"%y/%m/%d"}</font>
+    	&nbsp;<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
+		<br />
+		{/foreach}
 	</div>
+				
+	{elseif $view == "category"}
+	<div class="graybox">
+		{foreach from=$entries item=entry}
+		<font style="font-size: 8pt;">{$entry->date|date_format:"%y/%m/%d"}</font>
+		&nbsp;<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
+		<br />
+		{/foreach}
+	</div>
+    
+	{elseif $view == "search"}
+	<div class="graybox">
+		{foreach from=$entries item=entry}
+		<font style="font-size: 8pt;">{$entry->date|date_format:"%y/%m/%d"}</font>
+		&nbsp;<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
+		<br />
+    	{/foreach}
+	</div>
+	{/if}
+</div>
+
 {include file="sidebar.tpl"}
 {include file="footer.tpl"}
 
diff -urN soojung-0.4.6/templates/box/javascript.js soojung/templates/box/javascript.js
--- soojung-0.4.6/templates/box/javascript.js	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/javascript.js	2005-03-27 21:01:48.000000000 +0900
@@ -1,9 +1,8 @@
-function on_load() {
+function on_load(max_x) {
 	objs = document.getElementsByTagName('IMG');
-	max_x=510;
 	for(i=0; i<objs.length; i++) {
 		obj = objs[i];
-		if(obj.className != 'bbcodeimg') continue;
+		if(obj.className != 'bbcode') continue;
 		img = new Image();
 		img.src = obj.src;
 		if(max_x<img.width){
diff -urN soojung-0.4.6/templates/box/sidebar.tpl soojung/templates/box/sidebar.tpl
--- soojung-0.4.6/templates/box/sidebar.tpl	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/sidebar.tpl	2005-03-28 08:45:03.000000000 +0900
@@ -1,122 +1,137 @@
-	<div id="sidebar" class="blackbox">
-		<div style="text-align: center;">
-			<i>your message goes here.</i>
-		</div>
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_category');"> &nbsp;CATEGORY</a></div>
-		<ul id="div_category">
-			{foreach from=$categories item=category}
-			<li>
-				<a href="{$category->getHref()|escape}">{$category->name|substring:25|escape}</a>
-				({$category->getEntryCount()})
-			</li>
-			{foreachelse}
-			<li></li>
-			{/foreach}
-		</ul>
-
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_calendar');"> &nbsp;CALENDAR</a></div>
-		<div id="div_calendar" style="text-align:center;">
-			{$calendar->getCalendar()}
-		</div>
-<!--
-		{if count($static_entries) != 0}
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_static');"> &nbsp;static POST</a></div>
-		<ul id="div_static">
-			{foreach from=$static_entries item=static}
-			<li>
-				<a href="{$static->getHref()|escape}">{$static->title|escape}</a>
-			</li>
-			{foreachelse}
-			<li></li>
-			{/foreach}
-		</ul>
-		{/if}
--->
-<!--
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_entry');"> &nbsp;recent POST</a></div>
-		<ul id="div_entry" class="hide">
-			{foreach from=$recent_entries item=entry}
-			<li>
-				<a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
-			</li>
-			{foreachelse}
-			<li></li>
-			{/foreach}
-		</ul>
--->
-		{if count($recent_comments) != 0}
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_recent_comment');"> &nbsp;recent COMMENTs</a></div>
-		<ul id="div_recent_comment" class="hide">
-			{foreach from=$recent_comments item=comment}
-			<li>
-				<a href="{$comment->getHref()|escape}">{$comment->getBody()|strip_tags:false|substring:35|escape}</a>
-			</li>
-			{/foreach}
-		</ul>
-		{/if}
-				
-		{if count($recent_trackbacks) != 0}
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_recent_trackback');"> &nbsp;recent TRACKBACKs</a></div>
-		<ul id="div_recent_trackback" class="hide">
-			{foreach from=$recent_trackbacks item=trackback}
-			<li>
-				<a href="{$trackback->getHref()|escape}">{$trackback->url|substring:27|escape}</a>
-			</li>
-			{/foreach}
-		</ul>
-		{/if}
-
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_archive');"> &nbsp;ARCHIVEs</a></div>
-		<ul id="div_archive">
-			{foreach from=$archvies item=archive}
-			<li>
-				<a href="{$archive->getHref()|escape}">{$archive->getDate()|date_format:"%B %Y"|substring:25}</a> ({$archive->getEntryCount()})
-			</li>
-			{foreachelse}
-			<li></li>
-			{/foreach}
-		</ul>
-
-		{if count($recent_referers) != 0}
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_recent_referer');"> &nbsp;recent REFERERs</a></div>
-		<ul id="div_recent_referer" class="hide">
-			{foreach from=$recent_referers item=referer}
-			<li>
-				<a href="{$referer|escape}" onclick="seturltarget(this,'_blank');">{$referer|substring:25|escape}</a>
-			</li>
-			{/foreach}
-		</ul>
-		{/if}
-
-		{if count($bookmarks) != 0}
-		<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_bookmark');"> &nbsp;BOOKMARKs</a></div>
-		<ul id="div_bookmark" class="hide">
-			{foreach from=$bookmarks item=bookmark}
-			<li>
-				<a href="{$bookmark->url|escape}" onclick="seturltarget(this,'_blank');">{$bookmark->desc|substring:35|escape}</a>
-			</li>
-			{/foreach}
-		</ul>
-		{/if}
-
-		<div class="menutitle" style="color: #777777;"> &nbsp;SEARCH</div>
-		<form action="index.php" method="get">
-			<p style="margin-left:10px;">
-				<input type="text" name="search" title="input search text" size="16"/>
-				<input type="submit" value="Search" />
-			</p>
-		</form>
-		<br />
-		<p style="margin-left: 10px;">
-			Today : {$today_count}<br />
-			Total : {$total_count}<br />
-			<br />
-			<a href="{$baseurl}/rss2.php" onclick="seturltarget(this,'_blank');"><img src="{$baseurl}/templates/{$skin}/imgs/rss20_logo.gif" alt="rss 2.0 feed" style="border:0px;"/></a><br />
-			
-			<a href="http://validator.w3.org/check?uri=referer" onclick="seturltarget(this,'_blank');"><img src="{$baseurl}/templates/{$skin}/imgs/xhtml11.png" alt="Valid XHTML 1.0!" style="border:0px;"/></a><br />
+    </div>
+</div>
 
-			<a class="nodecoration" title="Explanation of Level A Conformance" href="http://www.w3.org/WAI/WCAG1A-Conformance" onclick="seturltarget(this,'_blank');"><img src="{$baseurl}/templates/{$skin}/imgs/wai_a.png" alt="Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" style="border:0px;"/></a>
-		</p>
+<div id="sidebar" class="blackbox">
+	<div style="text-align: center;">
+		<i>your message goes here.</i>
 	</div>
+
+    {if #showCategory# != -1}
+	<div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_category');"> &nbsp;CATEGORY</a></div>
+	<ul id="div_category" {if #showCategory# == 0}class="hide"{/if}>
+		{foreach from=$categories item=category}
+		<li>
+			<a href="{$category->getHref()|escape}">{$category->name|substring:25|escape}</a>
+			({$category->getEntryCount()})
+		</li>
+		{foreachelse}
+		<li></li>
+		{/foreach}
+	</ul>
+    {/if}
+
+    {if #showCalendar# != -1}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_calendar');"> &nbsp;CALENDAR</a></div>
+    <div id="div_calendar" style="text-align:center;" {if #showCalendar# == 0}class="hide"{/if}>
+        {$calendar->getCalendar()}
+    </div>
+    {/if}
+
+    {if #showStaticEntries# != -1 && count($static_entries) != 0}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_static');"> &nbsp;static POST</a></div>
+    <ul id="div_static" {if #showStaticEntries# == 0}class="hide"{/if}>
+        {foreach from=$static_entries item=static}
+        <li>
+            <a href="{$static->getHref()|escape}">{$static->title|escape}</a>
+        </li>
+        {foreachelse}
+        <li></li>
+        {/foreach}
+    </ul>
+    {/if}
+
+    {if #showRecentEntries# != -1}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_entry');"> &nbsp;recent POST</a></div>
+    <ul id="div_entry" {if #showRecentEntries# == 0}class="hide"{/if}>
+        {foreach from=$recent_entries item=entry}
+        <li>
+            <a href="{$entry->getHref()|escape}">{$entry->title|escape}</a>
+        </li>
+        {foreachelse}
+        <li></li>
+        {/foreach}
+    </ul>
+    {/if}
+
+    {if #showRecentComments# != -1 && count($recent_comments) != 0}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_recent_comment');"> &nbsp;recent COMMENTs</a></div>
+    <ul id="div_recent_comment" {if #showRecentComments# == 0}class="hide"{/if}>
+        {foreach from=$recent_comments item=comment}
+        <li>
+            <a href="{$comment->getHref()|escape}">{$comment->getBody()|strip_tags:false|substring:35|escape}</a>
+        </li>
+        {/foreach}
+    </ul>
+    {/if}
+            
+    {if #showRecentTrackbacks# != -1 && count($recent_trackbacks) != 0}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_recent_trackback');"> &nbsp;recent TRACKBACKs</a></div>
+    <ul id="div_recent_trackback" {if #showRecentTrackbacks# == 0}class="hide"{/if}>
+        {foreach from=$recent_trackbacks item=trackback}
+        <li>
+            <a href="{$trackback->getHref()|escape}">{$trackback->getExcerpt()|strip_tags|substring:27|escape}</a>
+        </li>
+        {/foreach}
+    </ul>
+    {/if}
+
+    {if #showArchives# != -1}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_archive');"> &nbsp;ARCHIVEs</a></div>
+    <ul id="div_archive" {if #showArchives# == 0}class="hide"{/if}>
+        {foreach from=$archvies item=archive}
+        <li>
+            <a href="{$archive->getHref()|escape}">{$archive->getDate()|date_format:"%B %Y"|substring:25}</a> ({$archive->getEntryCount()})
+        </li>
+        {foreachelse}
+        <li></li>
+        {/foreach}
+    </ul>
+    {/if}
+
+    {if #showRecentReferers# != -1 && count($recent_referers) != 0}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_recent_referer');"> &nbsp;recent REFERERs</a></div>
+    <ul id="div_recent_referer" {if #showRecentReferers# == 0}class="hide"{/if}>
+        {foreach from=$recent_referers item=referer}
+        <li>
+            <a href="{$referer|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>{$referer|substring:25|escape}</a>
+        </li>
+        {/foreach}
+    </ul>
+    {/if}
+
+    {if #showBookmarks# != -1 && count($bookmarks) != 0}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_bookmark');"> &nbsp;BOOKMARKs</a></div>
+    <ul id="div_bookmark" {if #showBookmarks# == 0}class="hide"{/if}>
+        {foreach from=$bookmarks item=bookmark}
+        <li>
+            <a href="{$bookmark->url|escape}" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}>{$bookmark->desc|substring:35|escape}</a>
+        </li>
+        {/foreach}
+    </ul>
+    {/if}
+    
+    {if #showSearch# != -1}
+    <div class="menutitle"><a href="#none" onclick="return fold_sidebar('div_search');"> &nbsp;SEARCH</a></div>
+    <div id="div_search" {if #showSearch# == 0}class="hide"{/if}>
+    <form action="index.php" method="get">
+        <p style="margin-left:10px;">
+            <input type="text" name="search" title="input search text" size="16"/>
+            <input type="submit" value="Search" />
+        </p>
+    </form>
+    </div>
+    {/if}
+    
+    <br />
+    <p style="margin-left: 10px;">
+        Today : {$today_count}<br />
+        Total : {$total_count}<br />
+        <br />
+        <a href="{$baseurl}/rss2.php" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}><img src="{$baseurl}/templates/{$skin}/imgs/rss20_logo.gif" alt="rss 2.0 feed" style="border:0px;"/></a><br />
+        
+        <a href="http://validator.w3.org/check?uri=referer" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}><img src="{$baseurl}/templates/{$skin}/imgs/xhtml11.png" alt="Valid XHTML 1.0!" style="border:0px;"/></a><br />
+
+        <a class="nodecoration" title="Explanation of Level A Conformance" href="http://www.w3.org/WAI/WCAG1A-Conformance" {if #targetBlank# == 1}onclick="seturltarget(this,'_blank');"{/if}><img src="{$baseurl}/templates/{$skin}/imgs/wai_a.png" alt="Level A conformance icon, W3C-WAI Web Content Accessibility Guidelines 1.0" style="border:0px;"/></a>
+    </p>
 </div>
 
diff -urN soojung-0.4.6/templates/box/styles.css soojung/templates/box/styles.css
--- soojung-0.4.6/templates/box/styles.css	2005-03-11 23:16:42.000000000 +0900
+++ soojung/templates/box/styles.css	2005-03-27 21:01:48.000000000 +0900
@@ -172,12 +172,15 @@
 	height: auto;
 }
 
-.div_hide
+.div_hide, .hide
 {
   display: none;
 }
 
-.hide { display: none; }
+.trackbackurl {
+    font-size: 7pt;
+    cursor: pointer;
+}
 
 A:link { color:#777777; text-decoration:none; }
 A:visited { color:#777777; text-decoration:none; }
diff -urN soojung-0.4.6/templates/bruise2/entry.tpl soojung/templates/bruise2/entry.tpl
--- soojung-0.4.6/templates/bruise2/entry.tpl	2005-03-01 02:01:21.000000000 +0900
+++ soojung/templates/bruise2/entry.tpl	2005-03-31 20:03:09.000000000 +0900
@@ -12,7 +12,7 @@
 <a name="trackback"></a>
 {foreach from=$trackbacks item=trackback}
 	<div class="trackback">
-	<a name="{$trackback->date}"></a>
+	<a name="TB{$trackback->date}"></a>
 	<a href="{$trackback->url|escape}">{$trackback->url|escape}</a><br />
 	{$trackback->title|escape}<br />
 	{$trackback->getExcerpt()|strip_tags|escape}
@@ -27,7 +27,7 @@
 <a name="comment"></a>
 {foreach from=$comments item=comment}
 	<div class="comment">
-	<a name="{$comment->date}"></a>
+	<a name="CO{$comment->date}"></a>
 	On {$comment->date|date_format:"%B %d, %Y %I:%M %p"}, 
 	{if $comment->homepage != ""}
 		<a href="{$comment->homepage|escape}">{$comment->name|escape}</a>
@@ -46,7 +46,7 @@
 Post a comment<br />
 Name:<br />
 <input type="text" name="name" value="{$w_name|escape}"><br />
-Email Adress:<br />
+Email Address:<br />
 <input type="text" name="email" value="{$w_email|escape}"><br />
 URL:<br />
 <input type="text" name="url" value="{$w_url|default:"http://"|escape}"><br />
diff -urN soojung-0.4.6/templates/ocean/entry.tpl soojung/templates/ocean/entry.tpl
--- soojung-0.4.6/templates/ocean/entry.tpl	2005-03-01 02:01:21.000000000 +0900
+++ soojung/templates/ocean/entry.tpl	2005-03-27 21:46:41.000000000 +0900
@@ -29,7 +29,7 @@
 		</p>
 	{foreach from=$trackbacks item=trackback}
 		<div class="trackback">
-			<a name="{$trackback->date}"></a>
+			<a name="TB{$trackback->date}"></a>
 			<p>Trackback from <a href="{$trackback->url|escape}">{$trackback->url|escape}</a></p>
 			<p>{$trackback->title|escape}:</p>
 			<p>
@@ -46,7 +46,7 @@
 		<h3>Comments on this entry:</h3>
 	{foreach from=$comments item=comment}
 		<div class="comment">
-			<a name="{$comment->date}"></a>
+			<a name="CO{$comment->date}"></a>
 			<div class="info">
 				Left by <span class="author">
 				{if $comment->homepage != ""}
diff -urN soojung-0.4.6/templates/rubric/entry.tpl soojung/templates/rubric/entry.tpl
--- soojung-0.4.6/templates/rubric/entry.tpl	2005-03-01 02:01:21.000000000 +0900
+++ soojung/templates/rubric/entry.tpl	2005-03-27 21:46:42.000000000 +0900
@@ -29,7 +29,7 @@
 <ol id="trackbacklist">
 {foreach from=$trackbacks item=trackback}
 	<li>
-		<a name="{$trackback->date}"></a>
+		<a name="TB{$trackback->date}"></a>
 		<p>
 			Trackback from <a href="{$trackback->url|escape}">{$trackback->url|escape}</a>
 		</p>
@@ -49,7 +49,7 @@
 <ol id="commentlist">
 {foreach from=$comments item=comment}
 	<li>
-		<a name="{$comment->date}"></a>
+		<a name="CO{$comment->date}"></a>
 			
 		<p>
 			{$comment->getBody()}
diff -urN soojung-0.4.6/templates/seaside/entry.tpl soojung/templates/seaside/entry.tpl
--- soojung-0.4.6/templates/seaside/entry.tpl	2005-03-01 02:01:21.000000000 +0900
+++ soojung/templates/seaside/entry.tpl	2005-03-27 21:46:42.000000000 +0900
@@ -11,7 +11,7 @@
 <p class="trackback_url">TrackBack URL: {$baseurl}/trackback.php?blogid={$entry->entryId}</p>
 {foreach from=$trackbacks item=trackback}
 	<div class="trackback">
-	<a name="{$trackback->date}"></a>
+	<a name="TB{$trackback->date}"></a>
 	<a href="{$trackback->url|escape}">{$trackback->url|escape}</a><br />
 	{$trackback->title|escape}<br />
 	{$trackback->getExcerpt()|strip_tags|escape}
@@ -23,7 +23,7 @@
 {if $entry->isSetOption("NO_COMMENT") == false}
 <ul id="comment">
 {foreach from=$comments item=comment}
-	<li id="{$comment->date}"> 
+	<li id="CB{$comment->date}"> 
 		<p class="cmtinfo">
 		{if $comment->homepage != ""}
 			<a href="{$comment->homepage|escape}">{$comment->name|escape}</a>
diff -urN soojung-0.4.6/templates/simple/entry.tpl soojung/templates/simple/entry.tpl
--- soojung-0.4.6/templates/simple/entry.tpl	2005-03-01 02:01:21.000000000 +0900
+++ soojung/templates/simple/entry.tpl	2005-03-31 20:03:09.000000000 +0900
@@ -12,7 +12,7 @@
 <a name="trackback"></a>
 {foreach from=$trackbacks item=trackback}
 	<div class="trackback">
-	<a name="{$trackback->date}"></a>
+	<a name="TB{$trackback->date}"></a>
 	<a href="{$trackback->url|escape}">{$trackback->url|escape}</a><br />
 	{$trackback->title|escape}<br />
 	{$trackback->getExcerpt()|strip_tags|escape}
@@ -27,7 +27,7 @@
 <a name="comment"></a>
 {foreach from=$comments item=comment}
 	<div class="comment">
-	<a name="{$comment->date}"></a>
+	<a name="CO{$comment->date}"></a>
 	On {$comment->date|date_format:"%B %d, %Y %I:%M %p"}, 
 	{if $comment->homepage != ""}
 		<a href="{$comment->homepage|escape}">{$comment->name|escape}</a>
@@ -46,7 +46,7 @@
 Post a comment<br />
 Name:<br />
 <input type="text" name="name" value="{$w_name|escape}"><br />
-Email Adress:<br />
+Email Address:<br />
 <input type="text" name="email" value="{$w_email|escape}"><br />
 URL:<br />
 <input type="text" name="url" value="{$w_url|default:"http://"|escape}"><br />
diff -urN soojung-0.4.6/templates/simplebalance/entry.tpl soojung/templates/simplebalance/entry.tpl
--- soojung-0.4.6/templates/simplebalance/entry.tpl	2005-03-01 02:01:22.000000000 +0900
+++ soojung/templates/simplebalance/entry.tpl	2005-03-27 21:46:42.000000000 +0900
@@ -14,7 +14,7 @@
 <div id="trackbacks">
 	<p class="trackback_url"><b>TrackBack URL:</b> {$baseurl}/trackback.php?blogid={$entry->entryId}</p>
 {foreach from=$trackbacks item=trackback}
-	<div class="trackback" id="{$trackback->date}">
+	<div class="trackback" id="TB{$trackback->date}">
 		<h3>
 			<a href="{$trackback->url|escape}" class="box_title">Trackback: {$trackback->url|escape}</a> <span class="hide">| trackbacked on</span>
 			<span class="box_header">{$trackback->date|date_format:"%Y/%m/%d %p %I:%M"}</span>
@@ -30,7 +30,7 @@
 {if $entry->isSetOption("NO_COMMENT") == false}
 <div id="comments">
 {foreach from=$comments item=comment}
-	<div class="comment" id="{$comment->date}">
+	<div class="comment" id="CO{$comment->date}">
 		<h3>
 		{if $comment->homepage != ""}
 			<span class="box_title">Comment by <a href="{$comment->homepage|escape}">{$comment->name|escape}</a></span>
