'".getDay(date("Y")."-".date("m")."-".date("d"),-7)."' "; } //■SQL実行 $result1=mysql_query($sql1, $db); if(!$result1) failerr("エラー","データベースにアクセスできません(2)"); $item1 = mysql_fetch_assoc($result1); $cnt = $item1['cnt']; /*****掲示板データをを取得*****/ $sql2 =""; $sql2 .= "SELECT A.bbsid, A.bbs_name, B.filepath, B.filepath_thum, B.filename, B.filesize, B.extension, B.message "; $sql2 .= "FROM t_bbs_midasi A "; $sql2 .= "INNER JOIN t_bbs_meisai B ON A.company_cd = B.company_cd "; $sql2 .= "AND A.userid = B.userid "; $sql2 .= "AND A.bbsid = B.bbsid "; $sql2 .= "WHERE A.company_cd = '".mysql_real_escape_string(COMPANY_CD)."' "; if($_POST['searchtype']=="画像"){ $sql2 .= "AND B.extension in('jpg','jpeg','gif','png','bmp','ifm') "; }else if($_POST['searchtype']=="動画"){ $sql2 .= "AND B.extension in('3gp','3gpp','3g2','amc') "; }else if($_POST['searchtype']=="音楽"){ $sql2 .= "AND B.extension in('mp3','mmf','mid','mld','midi','mp4','qcp') "; }else{ $sql2 .= "AND B.extension !='' "; } $sql2 .= fncNgramQuery("B.nickname_full, B.message_full, B.title_full ",$_POST['word']); $sql2 .= "AND A.kagi_type!='2' and A.status!='9' and A.category!='a22' and A.category!='a33' "; if(strlen($_POST['word'])<=2){ //検索ワードが入力されていない場合は、7日間の動画像を検索 $sql2 .= "AND B.touroku_date>'".getDay(date("Y")."-".date("m")."-".date("d"),-7)."' "; } $sql2 .= "order by B.touroku_date desc "; if(!$_GET['s']){ $_GET['s']=0; } $sql2 .="limit ".mysql_real_escape_string($_GET['s']).",".$limit; //■SQL実行 $result2=mysql_query($sql2,$db); if(!$result2) failerr("エラー","データベースにアクセスできません(4)"); //◆◆◆smarty_assing $buffer_img_list = ""; if($cnt>0){ $buffer_img_list.=$cnt."件中".($_GET['s']+1)."件目から表示。
\n"; }else{ $buffer_img_list.="0件です。
\n"; } $total_page=ceil($cnt/$limit); $now_page=round($_GET['s']/$limit); if($now_page%$limit_jump==0){ $start_page=$now_page; }else{ $start_page=$now_page-($now_page%$limit_jump); } $buffer_img_list .= "\n"; while($item2=mysql_fetch_assoc($result2)){ $buffer_img_list .= "\n"; $buffer_img_list .= "\n"; # $buffer_img_list .= "".$item2['bbs_name']."
\n"; } $buffer_img_list .= "
".fncImageLink(COMPANY_CD,$item2['filepath'],$item2['filepath_thum'],$item2['filename'],$item2['extension'],cuttenten($item2['message'],30),$item2['filesize'])."".cuttenten(strip_tags($item2['message']),"20")."
【".$item2['extension']."】".number_format($item2['filesize']/1024)."Kbyte
\n"; //*****ページ表示 if($start_page!=0){ $buffer_img_list.="\n"; } for($i = $start_page; $i < $start_page+$limit_jump && $i < $total_page; $i++) { if($i==$now_page){ $buffer_img_list.="[".($i+1)."]\n"; }else{ $buffer_img_list.="[".($i+1)."]\n"; } } if($start_page+$limit_jump<$total_page){ $buffer_img_list.="\n"; } //*****ページ表示 $smarty->assign("img_list",$buffer_img_list); $smarty->assign("list_searchtype",rend_searchtype($_POST['searchtype'])); //◆◆◆書き出し $smarty->display(mb_strcut($_SERVER['SCRIPT_NAME'],1)); ?>