#program
include ('../../include/conf/conf.php');
$dbobj = new dbobj();
/*//////////////////////////////////////////////////////*/
#pagequide
# $pageguide 生成
$phpself = $base_url."m/qa/";
$sql_from = "qa";
$sql_where = "th_num is not null";
$as = "cnt";
//$data_word = "スレッド";
$data_none = "まだスレッドがありません。";
$data_found = "スレッドが登録されています。 ";
require_once(CLASS_DIR.'pager.class.php');
/*//////////////////////////////////////////////////////*/
#list
if($c > 0){
$sql = "SELECT * FROM qa
WHERE th_num is not null
ORDER BY th_update DESC
LIMIT ".$pagesize * ($page -1).", $pagesize";
$db_data = $dbobj->db_connect($DB,$sql);
foreach($db_data as $list){
$thread_url = "./thread/".$list[th_num];
//$thread_title = mb_convert_encoding($list[th_title],$encode,'auto');
$thread_title = $list[th_title];
$thread_comment = mb_convert_encoding($list[th_comment],$encode,'auto');
$thread_comment = mb_substr($thread_comment,0,$max_comment_view,$encode);
$thread_comment = htmlspecialchars($thread_comment);
$thread_comment = str_replace('<br />','
',$thread_comment);
list($th_date,$dust) = explode(' ',$list[th_date]);
#コメントデータ・カウント
unset($com_cnt);
$as = "com_cnt";
$sql_com = "SELECT count(*) as ".$as." FROM `qa_comment` WHERE com_th_num = ".$list[th_num];
if(!$com_cnt = $dbobj->db_count($DB,$sql_com,$as)){
$com_cnt = "0";
}else{
$wcc = floor($com_cnt / $bord_pagesize);
$acc = $com_cnt % $bord_pagesize;
unset($new_com_page);
if($wcc > 0 ){
if($acc > 0){
$wcc = $wcc + 1;
}
$new_com_page = "_".$wcc."_".$com_cnt;
}
}
$contents .='
