Index: temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/class/SC_DbConn.php
===================================================================
--- temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/class/SC_DbConn.php	(revision 989)
+++ temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/class/SC_DbConn.php	(revision 989)
@@ -0,0 +1,198 @@
+<?php
+/*
+ * Copyright(c) 2000-2006 LOCKON CO.,LTD. All Rights Reserved.
+ *
+ * http://www.lockon.co.jp/
+ */
+
+$current_dir = realpath(dirname(__FILE__));
+require_once($current_dir . "/../module/DB.php");
+
+$objDbConn = "";
+
+class SC_DbConn{
+
+	var $conn;
+	var $result; 
+	var $includePath;
+	var $error_mail_to;
+	var $error_mail_title;
+	var $dsn;
+	var $err_disp = true;
+	
+	// ¥³¥ó¥¹¥È¥é¥¯¥¿
+	function SC_DbConn($dsn = "", $err_disp = true, $new = false){
+		global $objDbConn;
+		
+		// Debug¥â¡¼¥É»ØÄê
+		$options['debug'] = PEAR_DB_DEBUG;
+		// ´û¤ËÀÜÂ³¤µ¤ì¤Æ¤¤¤Ê¤¤¤«¡¢¿·µ¬ÀÜÂ³Í×Ë¾¤Î¾ì¹ç¤ÏÀÜÂ³¤¹¤ë¡£
+		if(!isset($objDbConn->connection) || $new) {
+			if($dsn != "") {
+				$objDbConn = DB::connect($dsn, $options);
+				$this->dsn = $dsn;
+			} else {
+				if(defined('DEFAULT_DSN')) {
+					$objDbConn = DB::connect(DEFAULT_DSN, $options);
+					$this->dsn = DEFAULT_DSN;
+				} else {
+					return;
+				}
+			}
+		}
+		$this->conn = $objDbConn;
+		$this->error_mail_to = DB_ERROR_MAIL_TO;
+		$this->error_mail_title = DB_ERROR_MAIL_SUBJECT;
+		$this->err_disp = $err_disp;
+	}
+	
+	// ¥¯¥¨¥ê¤Î¼Â¹Ô
+	function query($n ,$arr = "", $ignore_err = false){
+		if ( $arr ) {
+			$result = $this->conn->query($n, $arr);	
+		} else {
+			$result = $this->conn->query($n);
+		}
+	
+		if ($this->conn->isError($result) && !$ignore_err){
+			$this->send_err_mail ($result, $n);
+		}
+		
+		$this->result = $result;
+		return $this->result;
+	}
+
+	// °ì·ï¤Î¤ß¼èÆÀ
+	function getOne($n, $arr = ""){
+		
+		// mysql¤Î¾ì¹ç¤Ë¤Ï¥Ó¥å¡¼É½¤òÊÑ´¹¤¹¤ë
+		if (DB_TYPE == "mysql") $n = sfChangeMySQL($n);
+		
+		if ( $arr ) {
+			$result = $this->conn->getOne($n, $arr);
+		} else {
+			$result = $this->conn->getOne($n);
+		}		
+		if ($this->conn->isError($result)){
+			$this->send_err_mail ($result ,$n);
+		}
+		$this->result = $result;
+		
+		return $this->result;
+	}
+	
+	function getRow($n, $arr = ""){
+
+		// mysql¤Î¾ì¹ç¤Ë¤Ï¥Ó¥å¡¼É½¤òÊÑ´¹¤¹¤ë
+		if (DB_TYPE == "mysql") $n = sfChangeMySQL($n);
+
+		if ( $arr ) {
+			$result = $this->conn->getRow($n, $arr);
+		} else {
+			$result = $this->conn->getRow($n);
+		}		
+		if ($this->conn->isError($result)){
+			$this->send_err_mail ($result ,$n);
+		}
+		$this->result = $result;
+		return $this->result;
+	}
+
+	// SELECTÊ¸¤Î¼Â¹Ô·ë²Ì¤òÁ´¤Æ¼èÆÀ
+	function getAll($n, $arr = ""){
+
+		// mysql¤Î¾ì¹ç¤Ë¤Ï¥Ó¥å¡¼É½¤òÊÑ´¹¤¹¤ë
+		if (DB_TYPE == "mysql") $n = sfChangeMySQL($n);
+		
+		if(PEAR::isError($this->conn)) {
+			sfErrorHeader("DB¤Ø¤ÎÀÜÂ³¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡£:" . $this->dsn);
+			return 0;
+		}
+
+		if ( $arr ){
+			$result = $this->conn->getAll($n, $arr, DB_FETCHMODE_ASSOC);
+		} else {
+			$result = $this->conn->getAll($n, DB_FETCHMODE_ASSOC);
+		}
+		
+		if ($this->conn->isError($result)){
+			$this->send_err_mail ($result, $n);
+		}
+		$this->result = $result;
+		
+		return $this->result;
+	}	
+	
+	function autoExecute($table_name, $fields_values, $sql_where = null){
+	
+		if ( $sql_where ) {
+			$result = $this->conn->autoExecute( $table_name, $fields_values, DB_AUTOQUERY_UPDATE, $sql_where);
+		} else {
+			$result = $this->conn->autoExecute( $table_name, $fields_values, DB_AUTOQUERY_INSERT);
+		}
+		
+		if ($this->conn->isError($result)){
+			$this->send_err_mail ($result, $n);
+		}
+		$this->result = $result;
+		return $this->result;
+	}
+	
+	
+	function prepare($n){
+		global $sql;
+		$sql = $n;		
+		$result = $this->conn->prepare($n);
+		$this->result = $result;
+		return $this->result;
+	}
+	
+	function execute($n, $obj){
+		global $sql;
+		$sql = $n;
+		$result = $this->conn->execute($n, $obj);
+		$this->result = $result;
+		return $this->result;
+	}	
+	
+	function reset(){
+		$this->conn->disconnect();
+	}
+
+	function send_err_mail( $result, $sql ){
+		
+		if ($this->err_disp) {
+			if ($_SERVER['HTTPS'] == "on") {
+				$url = "https://";
+			} else {
+				$url = "http://";
+			}
+			$url.= $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
+			
+			$errmsg = $url."\n\n";
+			$errmsg.= "REMOTE_ADDR:" . $_SERVER['REMOTE_ADDR'] . "\n";
+			$errmsg.= "USER_AGENT:" . $_SERVER['HTTP_USER_AGENT'] . "\n\n";		
+			$errmsg.= $sql . "\n";
+			$errmsg.= $result->message . "\n\n";
+			$errmsg.= $result->userinfo . "\n\n";
+			
+			$arrRbacktrace = array_reverse($result->backtrace);
+						
+			foreach($arrRbacktrace as $backtrace) {
+				if($backtrace['class'] != "") {
+					$func = $backtrace['class'] . "->" . $backtrace['function'];
+				} else {
+					$func = $backtrace['function'];					
+				}
+				
+				$errmsg.= $backtrace['file'] . " " . $backtrace['line'] . ":" . $func . "\n";
+			}			
+						
+			mb_send_mail(DB_ERROR_MAIL_TO, DB_ERROR_MAIL_SUBJECT, $errmsg);
+			
+			exit;
+		}
+	}
+}
+
+?>
Index: temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/templates/topic_list.html
===================================================================
--- temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/templates/topic_list.html	(revision 987)
+++ temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/templates/topic_list.html	(revision 987)
@@ -0,0 +1,110 @@
+<!-- ¥â¥¸¥å¡¼¥ë¤³¤³¤«¤é -->
+<div style="padding: 15px 0;">
+<table border="0" width="100%" cellpadding="5" align="center">
+	<tr>
+		<td align="left"><a href="<{$xoops_url}>/modules/newbb/index.php?cat=<{$arrCat.cat_id}>"><{$arrCat.cat_title}></a>&nbsp;>&nbsp;<b><{$forum_name}></b></td>
+		<td align="right"></td>
+	</tr>
+	<tr><td height="10"></td></tr>
+</table>
+<table border="0" cellspacing="0" cellpadding="0">
+	<tr bgcolor="#2b8200">
+		<td><img src="<{$xoops_url}>/themes/default/img/top/title_left_top.gif" width="10" height="7" alt="" border="0"></td>
+		<td style="width:100%;"></td>
+		<td align="left"><img src="<{$xoops_url}>/themes/default/img/top/title_right_top.gif" width="10" height="7" alt="" border="0"></td>
+	</tr>
+	<tr>
+		<td bgcolor="#2b8200" colspan="3">
+		<table border="0" cellspacing="0" cellpadding="0">
+			<tr>
+				<td class="blockIcon"><div class="blockTitle"><{$forum_name}></div></td>
+			</tr>
+		</table>
+		</td>
+	</tr>
+	<tr bgcolor="#2b8200">
+		<td><img src="<{$xoops_url}>/themes/default/img/top/title_left_bottom.gif" width="10" height="7" alt="" border="0"></td>
+		<td></td>
+		<td align="left"><img src="<{$xoops_url}>/themes/default/img/top/title_right_bottom.gif" width="10" height="7" alt="" border="0"></td>
+	</tr>
+	<tr><td height="10"></td></tr>
+</table>
+<table border="0" width="100%" class="btnarea">
+	<tr>
+		<td align="center"><a href="<{$forum_post_or_register}>"><img src="/themes/default/img/main/thread_btn.jpg" width="190" height="36" alt="¿·µ¬¥¹¥ì¥Ã¥É¤òÄÉ²Ã¤¹¤ë"></a></td>
+	</tr>
+</table>
+<table align="center" border="0" width="100%">
+	<tr><td height="10"></td></tr>
+	<tr>
+		<td align="center"><{$forum_pagenav}></td>
+	</tr>
+	<tr><td height="10"></td></tr>
+</table>
+
+<!-- start forum main table -->
+<form action="viewforum.php" method="get">
+<input type="hidden" name="mode" value="">
+<input type="hidden" name="topic_id" value="">
+<input type="hidden" name="start" value="<{$smarty.get.start}>">
+
+<table class="outer" cellspacing="1">
+	<tr class="head" align="center">
+		<td width="2%">&nbsp;</td>
+		<td>&nbsp;<b><a href="<{$h_topic_link}>"><{$lang_topic}></a></b></td>
+		<td width="7%" align="center" nowrap="nowrap"><b><a href="<{$h_reply_response}>"><{$lang_response}></a></b></td>
+		<td width="5%" align="center" nowrap="nowrap"><b><a href="<{$h_reply_link}>"><{$lang_replies}></a></b></td>
+		<td width="15%" align="center" nowrap="nowrap"><b><a href="<{$h_poster_link}>"><{$lang_poster}></a></b></td>
+		<td width="8%" align="center" nowrap="nowrap"><b><a href="<{$h_views_link}>"><{$lang_views}></a></b></td>
+		<td width="15%" align="center" nowrap="nowrap"><b><a href="<{$h_date_link}>"><{$lang_date}></a></b></td>
+	</tr>
+  <!-- start forum topic -->
+	<{foreach item=topic from=$topics}>
+	<tr class="<{cycle values="even,odd"}>">
+		<td align="center"><{$topic.topic_icon}></td>
+		<td>&nbsp;[<{$topic.fix}>:<{$topic.topic_number}>]<a href="<{$topic.topic_link}>"><{$topic.topic_title}></a><{$topic.topic_page_jump}></td>
+		<td align="center" valign="middle">
+		<{ $arrResponse[$topic.topic_response]|default:'???' }>
+		<{if $arrResponse[$topic.topic_response] != ""}> (<{$topic.topic_response_user|default:'¥²¥¹¥È'}>) <{/if}>
+    <{*
+		<select name="response_<{$topic.topic_id}>" size="1">
+		<{ foreach from=$arrResponse key=key item=item }>
+		<option value="<{$key}>" <{if $topic.topic_response == $key}>selected="selected"<{/if}>><{$item}></option>
+		<{ /foreach }>
+		<input type="submit" value="11?¡¦" onClick="mode.value='response'; topic_id.value=<{$topic.topic_id}>;">
+		</select><br/>
+		
+	*}>
+	
+		</td>
+		<td align="center" valign="middle"><{$topic.topic_replies}></td>
+		<td align="center" valign="middle"><{$topic.topic_poster}></td>
+		<td align="center" valign="middle"><{$topic.topic_views}></td>
+		<td align="right" valign="middle"><{$topic.topic_last_posttime}><br /><{$lang_by}> <{$topic.topic_last_poster}></td>
+	</tr>
+	<{/foreach}>
+	<!-- end forum topic -->
+	<tr class="foot">
+		<td colspan="8" align="center"><b><{$lang_sortby}></b> <{$forum_selection_sort}> <{$forum_selection_order}> <{$forum_selection_since}> <input type="hidden" name="forum" value="<{$forum_id}>" /><input type="submit" name="refresh" value="<{$lang_go}>" /></td>
+	</tr>
+</table>
+</form>
+<!-- end forum main table -->
+
+<table align="center" border="0" width="100%">
+	<tr><td height="10"></td></tr>
+	<tr>
+		<td align="center"><{$forum_pagenav}></td>
+	</tr>
+	<tr><td height="10"></td></tr>
+</table>
+
+<table align="center" border="0" width="100%" class="btnarea">
+	<tr>
+		<td align="center"><{$forum_jumpbox}></td>
+	</tr>
+</table>
+
+<br/>
+<!-- end module contents -->
+</div>
Index: temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/topic_list.php
===================================================================
--- temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/topic_list.php	(revision 993)
+++ temp/test-xoops.ec-cube.net/html/modules/newbb/test/kakinaka/topic_list.php	(revision 993)
@@ -0,0 +1,23 @@
+<?php
+
+include '../../../mainfile.php';
+$xoopsOption['template_main'] = 'topic_list.html';
+include XOOPS_ROOT_PATH."/header.php";
+
+$sql = 'SELECT * FROM ' . $xoopsDB->prefix('bb_topics');
+if ( !$result = $xoopsDB->query($sql) ) {
+    redirect_header(XOOPS_URL.'/',1,_MD_ERROROCCURED);
+    exit();
+}
+
+while ( $myrow = $xoopsDB->fetchArray($result) ) {
+	//echo mb_detect_encoding($myrow) . "<br>";
+	$myrow = mb_convert_encoding($myrow["topic_title"], "euc-jp");
+	print($myrow);
+	print("<BR>");
+}
+
+// ÂÐ±þ¾õ¶·
+$xoopsTpl->assign('arrResponse', $arrResponse);
+
+?>
