\n"; echo($insertstr); } function postpermit($fpostpermit,$Boardmem,$fid,$level,$Category,$picfolder,$modforum){ if ($fpostpermit==1 && $Boardmem !=1 ){ $repermit=1; } elseif ($fpostpermit==2 && $modforum!=$fid){ $repermit=2; } elseif ($fpostpermit==3){ $repermit=3; } else { $repermit=0; } return $repermit; } /*~~~ sarat :: 17/3/2550 ~~~*/ if ($_GET['sortby'] == 'asc' || $_GET['sortby'] == 'desc') { $_SESSION['answer_show_sortby'] = $_GET['sortby']; } /*~~~ sarat :: 17/3/2550 ~~~*/ /*~~~ sarat :: 21/3/2550 ~~~*/ if ($Boardmem == 1) { if ($page != "") $redirect == 'force'; $this_mode = 1; if ($display_mode != 1 || $display_mode != 2) $display = ""; $link = "show_lite.php?Category=trekking&forum=$forum&No=$No&redirect=force"; if (($display_mode != $this_mode && $redirect == 'force') || ($display_mode == $this_mode) || ($display_mode == "")) {} else header("Location:$link"); } /*~~~ sarat :: 21/3/2550 ~~~*/ mysql_connect($host,$user,$passwd); if ($level==1 && $Boardmem==1 && $_GET["vote_status"] != "") { $sql = "update webboard_data set vote_status = " . $_GET["vote_status"] . " where No = " . $_GET["No"]; mysql_db_query($dbname, $sql); } $sql="SELECT f.folder,m.fid,m.fname as forumname,m.fpermit as forumperm,m.fanspermit as fanspermit,m.ftemp as ftemp FROM webboard_cat f,webboard_forum m where f.name='$Category' and f.name=m.Category and m.forum='$forum'"; $result= mysql_db_query($dbname, $sql); $row = mysql_fetch_array($result); $picfolder=$row["folder"]; $fid=$row["fid"]; $fname=$row["forumname"]; $fpermit=$row["forumperm"]; $fanspermit = $row["fanspermit"]; $ftheme=$row["ftemp"]; mysql_close(); if ($fanspermit >0){ if ($level ==1 || $level ==3 ) { $repermit=0; } else { $sql = "select * from member_vip_forum where fid = $forum and name = '$uid';"; mysql_connect($host,$user,$passwd); mysql_db_query($dbname, $sql); $rs = mysql_query($sql); if (mysql_num_rows($rs) > 0) { $fs = mysql_fetch_array($rs); $mreplypermit = $fs["replypermit"]; } else $mreplypermit = "n"; mysql_close(); if ($mreplypermit == "n") $repermit=postpermit($fanspermit,$Boardmem,$fid,$level,$Category,$picfolder,$modforum); else $repermit=0; } } else{ $repermit=0; } include("include/config.inc.php"); include("config/detail_$picfolder.php"); include("config/css_$picfolder.php"); include ("lang/th.inc"); if ($boardcase==3 && $fpermit==2) { onlypermit($Boardmem,$level,$Category,$picfolder); } if ($boardcase<3 && $fpermit==2) {forumpermit($Boardmem,$Category,$picfolder); } $browser = SniffBrowser(); $brows=$browser['type']; $version=$browser['version']; if ($brows=="Explorer" && $version >5.4){$boardver=6;} else if ($brows=="Netscape" && $version >7){$boardver=6;} else if ($brows=="Firefox"){$boardver=6;} else{$boardver=5;} $mode="html"; // fixed by sarat if ($mode==""){ $bver=5; } else if ($mode=="html" && $boardver==6) { $bver=6; } else { $bver=5; } switch ($bver) { case "5"; $button="boption/rebutton.php"; $replysmile="boption/replysm5.html"; break; case "6"; $replysmile="boption/replysm6.html"; break; } mysql_connect($host,$user,$passwd); $sql = "select f.*,m.id as meid ,m.ICQ as ICQ,m.WebName as WebName,m.URL as URL,m.icons as icons,m.msn as msn,m.skype as skype,m.camfrog as camfrog,m.blog as blog,m.level as level,m.post as post,m.photo as photo,m.sig as sig,m.levelname as levelname from webboard_data f,webboard_member m where f.Category='trekking' and f.No='$No' and f.topmid = m.id"; $result = mysql_db_query($dbname,$sql); $NRow = mysql_num_rows($result); if($NRow==0) { error_close("".$error[0]."","".$error[1].""); } else { $row = mysql_fetch_array($result); $Question = $row["Question"]; $Note = $row["Note"]; $mid = $row["meid"]; $Name = $row["Name"]; $Member = $row["Member"]; $Email = $row["Email"]; $nphoto = $row["nphoto"]; $Reply = $row["Reply"]; $tphoto = $row["tphoto"]; $picture="photo/$picfolder/$nphoto"; $point = $row["point"]; $tdate = $row["tdate"]; $nupdate = $row["nupdate"]; $qupdate = $row["qupdate"]; $vote = $row["vote"]; $id = $row["id"]; $pin = $row["pin"]; $closed = $row["close"]; $banip=$row["IP"]; $IP = "[".substr($row["IP"],0,strrpos($row["IP"],".")).".*]"; $pollid=$row["pollid"]; $memid= $row["meid"]; $ICQ = $row["ICQ"]; $WebName = $row["WebName"]; $URL = $row["URL"]; $icons = $row["icons"]; $msn = $row["msn"]; $Skype = $row["skype"]; $Camfrog = $row["camfrog"]; $Blog = $row["blog"]; $levels = $row["level"]; $numpost= $row["post"]; $memphoto=$row["photo"]; $signature=$row["sig"]; $newsid=$row["news"]; $picname = substr ($nphoto, -4); $levelname=$row["levelname"]; $postmusic=$row["postmusic"]; $postmedia=$row["postmedia"]; $thumbpic=$row["thumbpic"]; $borderpic=$row["borderpic"]; $palign=$row["alignpic"]; $oldpphoto=$row["oldnopost"]; $vote_hit=$row["vote_hit"]; $vote_status=$row["vote_status"]; $options = $row["options"]; $real_name = $row["real_name"]; $idcard = $row["idcard"]; $pinfo = ""; if ($real_name != "") $pinfo .= " [ ชื่อ-สกุล : $real_name ]"; if ($idcard != "") $pinfo .= " [ หมายเลขบัตร : $idcard ]"; $private_info = $pinfo; if($borderpic==1){ $borderhead="
"; $borderfoot="
"; } else { $borderhead=""; $borderfoot=""; } if ($postmusic!=""){ $topicmusic=" - > คลิ้กปุ่ม play เพื่อฟังเพลงของกระทู้นี้

"; } else { $topicmusic=""; } if ($postmedia!=""){ $filemedia=eregi_replace("$urlss/media/","",$postmedia); $sqlmedia = "select mediaid from webboard_media where mediafile='$filemedia'"; $resultmedia = mysql_db_query($dbname,$sqlmedia); $rowmedia = mysql_fetch_array($resultmedia); $mediaid = $rowmedia["mediaid"]; $topicmedia="

[ เปิดดูไฟล์แทรก Media : $mediaid : สำหรับ High Speed Connection ]
[ เปิดดูไฟล์แทรก Media : $mediaid : สำหรับ Low Speed Connection ]"; } else { $topicmedia=""; } $a11= ""; $a12 = ""; if ($Member=="0" || $icons=="") { $a_icon1 = $a11; } else { $a_icon1 = $a12; } if ($nupdate=="") { $topup = ""; } else { $topup = "

•••แก้ไขล่าสุด : เมื่อ $qupdate โดย $nupdate

"; } } @mysql_close(); $rankfile="rank/$picfolder.php"; if (file_exists($rankfile)==1){ include("rank/$picfolder.php");} $indextemp=$ftheme; if ($indextemp==""){ switch ($showstyle) { case ""; $oldpost="template/show/oldpost.php"; $oldreply="template/show/oldreply.php"; $csstemp=" \n"; break; case "1"; $oldpost="template/show/oldpost.php"; $oldreply="template/show/oldreply.php"; $csstemp=" \n"; break; case "2"; $oldpost="template/fshow/oldpost.php"; $oldreply="template/fshow/oldreply.php"; $csstemp=" \n"; break; } } else { $oldpost="templates/$indextemp/oldpost.php"; $oldreply="templates/$indextemp/oldreply.php"; $csstemp=" \n"; $extrastyle="forum/$indextemp/style.php"; } mysql_connect($host,$user,$passwd); $sql1="UPDATE webboard_data SET pageview=pageview+1 WHERE id='$id'"; $result1 = mysql_db_query($dbname,$sql1); mysql_close(); ?> <? echo $Question; ?> : <? echo $fname; ?> : <? echo $Question; ?> : <? echo $Question; ?> "; }else{ echo ""; }?> >


0) { $totalpage++; } /* edit by Sarat if($rt > 1) { $totalpage = floor($nr/$pageshow)+1; } else { $totalpage = floor($nr/$pageshow); } */ $goto = ($page-1)*$pageshow; ?> 0) $vote_text = "[ จำนวนโหวด $vote_hit ครั้ง ] "; $vote_text .= " คลิกโหวดกระทู้นี้ "; $sort_text = $vote_text; /*~~~ sarat :: 26/4/2550 ~~~*/ /*~~~ sarat :: 17/3/2550 ~~~*/ if ($_SESSION['answer_show_sortby'] == "" || $_SESSION['answer_show_sortby'] == 'asc') { $sort_text .= " จัดเรียงจากคำตอบล่าสุดไป"; } else { $sort_text .= " จัดเรียงจากแรกสุดไป"; } /*~~~ sarat :: 17/3/2550 ~~~*/ ?>
0) { $totalpage++; } /* edit by Sarat if($rt > 1) { $totalpage = floor($nr/$pageshow)+1; } else { $totalpage = floor($nr/$pageshow); } */ $goto = ($page-1)*$pageshow; if($Reply>0){ mysql_connect($host,$user,$passwd); $sql = "select * from webboard_member where User = '$uid';"; $rs = mysql_db_query($dbname, $sql); if (mysql_num_rows($rs) > 0) { $fs = mysql_fetch_array($rs); $ignore_list = $fs["ignore_list"]; $ignore_list = explode(",", $ignore_list); array_pop($ignore_list); } unset($param); if (count($ignore_list) > 0) { foreach ($ignore_list as $val) { $param .= "'" . trim($val) . "',"; } $param = substr($param, 0, strlen($param) - 1); $ign_sql = "and f.Name not in ($param)"; //echo $ign_sql; } $s1 = "select f.*,m.id as meid ,m.ICQ as ICQ,m.WebName as WebName,m.URL as URL,m.icons as icons,m.msn as msn,m.skype as skype,m.camfrog as camfrog,m.blog as blog,m.level as level,m.post as post,m.photo as photo,m.sig as sig,m.levelname as levelname from webboard_ans f,webboard_member m where f.QuestionNo='$id' and f.commid = m.id $ign_sql order by f.No $order limit $goto,$pageshow"; /*~~~ sarat :: 17/3/2550 ~~~*/ if ($_SESSION['answer_show_sortby'] == 'asc' || $_SESSION['answer_show_sortby'] == 'desc') { $s1 = "select f.*,m.id as meid ,m.ICQ as ICQ,m.WebName as WebName,m.URL as URL,m.icons as icons,m.msn as msn,m.skype as skype,m.camfrog as camfrog,m.blog as blog,m.level as level,m.post as post,m.photo as photo,m.sig as sig,m.levelname as levelname from webboard_ans f,webboard_member m where f.QuestionNo='$id' and f.commid = m.id $ign_sql order by f.posttime " . $_SESSION['answer_show_sortby'] . " limit $goto,$pageshow"; } /*~~~ sarat :: 17/3/2550 ~~~*/ $r1 = mysql_db_query($dbname,$s1) or die ("ไม่สามารถสั่งให้ database ทำงานได้ในขณะนี้"); $i=1; while ($rows = mysql_fetch_array($r1)) { $QuestionNo = $rows["No"]; $Name1 = $rows["Name"]; $Member1 = $rows["Member"]; $Msg = $rows["Msg"]; $nphoto1 = $rows["nphoto"]; $tphoto1 = $rows["tphoto"]; $picture1="photo/$picfolder/$nphoto1"; $No_com = $rows["No_com"]; $tdate1 = $rows["tdate"]; $replyQuote = $rows["Quote"]; $id1 = $rows["id"]; $banip1=$rows["IP"]; $IP1 = "[".substr($rows["IP"],0,strrpos($rows["IP"],".")).".*]"; $ICQ1 = $rows["ICQ"]; $WebName1 = $rows["WebName"]; $URL1 = $rows["URL"]; $User1 = $rows["User"]; $Email1 = $rows["Email"]; $icons1 = $rows["icons"]; $msn1 = $rows["msn"]; $Skype1 = $rows["skype"]; $Camfrog1 = $rows["camfrog"]; $Blog1 = $rows["blog"]; $photo1 = $rows["photo"]; $level1 = $rows["level"]; $numpost1= $rows["post"]; $real_name1 = $rows["real_name"]; $idcard1 = $rows["idcard"]; $pinfo = ""; if ($real_name1 != "") $pinfo .= " [ ชื่อ-สกุล : $real_name1 ]"; if ($idcard1 != "") $pinfo .= " [ หมายเลขบัตร : $idcard1 ]"; $private_info_ans = $pinfo; $memid1= $rows["meid"]; $aupname=$rows["aupname"]; $aupdate=$rows["aupdate"]; $ansthumb=$rows["ansthumb"]; $ansmedia=$rows["ansmedia"]; $signature1=$rows["sig"]; $levelname1=$rows["levelname"]; $picname1 = substr ($nphoto1, -4); $borderpic1=$rows["ansborder"]; $palign1=$rows["ansalign"]; $oldaphoto=$rows["oldnumans"]; if($borderpic1==1){ $borderhead1="
"; $borderfoot1="
"; } else { $borderhead1=""; $borderfoot1=""; } if ($ansmedia!=""){ $fileamedia=eregi_replace("$urlss/media/","",$ansmedia); $sqlmedia = "select mediaid from webboard_media where mediafile='$fileamedia'"; $resultmedia = mysql_db_query($dbname,$sqlmedia); $rowmedia = mysql_fetch_array($resultmedia); $mediaid = $rowmedia["mediaid"]; $topicamedia="

[ เปิดดูไฟล์แทรก Media : $mediaid : สำหรับ High Speed Connection ]
[ เปิดดูไฟล์แทรก Media : $mediaid : สำหรับ Low Speed Connection ]"; } else { $topicamedia=""; } $a1= ""; $a2 = ""; if ($Member1=="0" || $icons1=="") { $a_icon = $a1; } else { $a_icon = $a2; } $c1 = "$Name1"; $c2 = "$Name1"; if ($Member1 =="0") { $a_member = $c1; } else { $a_member = $c2; } if ($indextemp=="") { $d1 = ""; $d2 = "Mail to $Name1"; if ($Email1 =="") { $a_email = $d1; } else { $a_email = $d2; } $e1 = ""; $e2 = "$ICQ1"; if ($ICQ1 =="") { $a_icq = $e1; } else { $a_icq = $e2; } $f1 = ""; $f2 = "เบอร์ msn $msn1"; if ($msn1 =="") { $a_msn = $f1; } else { $a_msn = $f2; } if ($Skype1 =="") { $a_skype = ""; } else { $a_skype = "เบอร์ skype $Skype1"; } if ($Camfrog1 =="") { $a_camfrog = ""; } else { $a_camfrog = "เบอร์ camfrog $Camfrog1"; } if ($Blog1 =="") { $a_blog = ""; } else { $a_blog = "ลิงค์ไปยัง $Blog1"; } $g1 = ""; $g2 = "$WebName1"; if ($URL1 =="") { $a_url = $g1; } else { $a_url = $g2; } $h1= ""; $h2 = "ส่งข้อความส่วนตัวถึง $Name1"; $h3 = "ส่งข้อความส่วนตัวถึงผู้ดูแลบอร์ด"; } else { $d1 = ""; $d2 = "Mail to $Name1"; if ($Email1 =="") { $a_email = $d1; } else { $a_email = $d2; } $e1 = ""; $e2 = "$ICQ1"; if ($ICQ1 =="") { $a_icq = $e1; } else { $a_icq = $e2; } $f1 = ""; $f2 = "เบอร์ msn $msn1"; if ($msn1 =="") { $a_msn = $f1; } else { $a_msn = $f2; } if ($Skype1 =="") { $a_skype = ""; } else { $a_skype = "เบอร์ skype $Skype1"; } if ($Camfrog1 =="") { $a_camfrog = ""; } else { $a_camfrog = "เบอร์ camfrog $Camfrog1"; } if ($Blog1 =="") { $a_blog = ""; } else { $a_blog = "ลิงค์ไปยัง $Blog1"; } $g1 = ""; $g2 = "$WebName1"; if ($URL1 =="") { $a_url = $g1; } else { $a_url = $g2; } $h1= ""; $h2 = "ส่งข้อความส่วนตัวถึง $Name1"; $h3 = "ส่งข้อความส่วนตัวถึงผู้ดูแลบอร์ด"; } if ($Member1==1 && $level1>1 && $Boardmem==1 && $mbrid != $memid1) { $a_pm = $h2; } else if ($Member1==1 && $level1==1 && $level !=1) { $a_pm = $h3; } else { $a_pm = $h1; } if ($aupdate=="") { $ansup = ""; } else { $ansup = "

•••แก้ไขล่าสุด : เมื่อ $aupdate โดย $aupname

"; } if ($browser=="MSIE"){ if ($version < 6){include ("toolcom2.php");}else{include ("toolcom1.php");} }else{include ("toolcom2.php");} include("$oldreply"); $i++; } mysql_close(); if($nr=="0") { echo ""; } else { ?> \n"; print "
ความเห็นทั้งหมด :
1) { if($page>1 && $page<=$totalpage) { $prevpage = $page-1; print "\t[หน้าก่อน = $prevpage]\n"; } print "\t กำลังแสดงหน้าที่ $page/$totalpage \n"; if($page!=$totalpage) { $nextpage = $page+1; print "\t[หน้าถัดไป = $nextpage]\n"; } print "
\n"; for($i=1 ; $i<$page ; $i++) { print "\t[ $i ]\n"; } print "\t[ $page ] \n"; for($i=$page+1 ; $i<=$totalpage ; $i++) { print "\t[ $i ]\n"; } } ?>
[ Forum นี้สามารถตอบกระทู้ได้โดยสมาชิกเท่านั้น ]

"; }else if( $repermit==2){ echo "

[ Forum นี้สามารถตอบกระทู้ได้โดยผู้ช่วยดูแลบอร์ดนี้เท่านั้น ]

"; }else if( $repermit==3){ echo "

[ Forum นี้สามารถตอบกระทู้ได้โดยผู้ดูแลบอร์ดเท่านั้น ]

"; } ?>
[ ]