Warning: mysql_select_db(): Access denied for user 'web8'@'localhost' (using password: NO) in /var/www/clients/client0/web8/web/show.php on line 12
Warning: mysql_select_db(): A link to the server could not be established in /var/www/clients/client0/web8/web/show.php on line 12
Warning: mysql_query(): Access denied for user 'web8'@'localhost' (using password: NO) in /var/www/clients/client0/web8/web/show.php on line 13
Warning: mysql_query(): A link to the server could not be established in /var/www/clients/client0/web8/web/show.php on line 13
Warning: mysql_query(): Access denied for user 'web8'@'localhost' (using password: NO) in /var/www/clients/client0/web8/web/show.php on line 16
Warning: mysql_query(): A link to the server could not be established in /var/www/clients/client0/web8/web/show.php on line 16
Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in /var/www/clients/client0/web8/web/show.php on line 17 Short Charge Shock Rock Legend : เหล็ก-พันธุ์-เสือ 17 สิงหาคม 2556 อิมแพคอารีน่า เมืองทองธานี
กระดานสนทนา
ShortChargeShock.com
mysql_connect($host,$user,$passwd);
mysql_select_db($dbname);
// ติดต่อ database เพื่ออ่านข้อมูล
$sql = "select * from $smf_data where No='$No'";
$result = mysql_query($sql);
$NRow = mysql_num_rows($result);
if($NRow==0) { echo "Error"; exit(); }
$row = mysql_fetch_array($result);
// กำหนดค่าตัวแปร เพื่อนำไปแสดง
$No = $row["No"];
$mid = $row["mid"];
$Question = $row["Question"];
$Note = $row["Note"];
//$Note = htmlspecialchars($row["Note"]);
$Name = $row["Name"];
$Member = $row["Member"];
$Email = $row["Email"];
$Date = $row["Date"];
$imgpath = $row["imgpath"];
$read = $row["read"];
$imageType = $row["imageType"];
$youtubeQ = $row["youtube"];
$EditNameQ=$row["EditName"];
$EditDateQ=$row["EditDate"];
$EditIPQ=$row["EditIP"];
/*
// Youtube VDO embed
function autolink($string){
// force http: on www.
$string = str_ireplace( "www.", "http://www.", $string );
// eliminate duplicates after force
$string = str_ireplace( "http://http://www.", "http://www.", $string );
$string = str_ireplace( "https://http://www.", "https://www.", $string );
// The Regular Expression filter
$reg_exUrl = "/(http|https|ftp|ftps)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(\/\S*)?/";
// Check if there is a url in the text
$m = preg_match_all($reg_exUrl, $string, $match);
if ($m) {
$links=$match[0];
for ($j=0;$j<$m;$j++) {
if(substr($links[$j], 0, 18) == 'http://www.youtube'){
$string=' ';
//$string=str_replace($links[$j],''.$links[$j].'',$string).'
';
}else{
$string=str_replace($links[$j],''.$links[$j].'',$string);
}
}
}
return ($string);
}
*/
//$string="http://www.youtube.com/watch?v=1P6mhwb4OtU";
//$string=$youtubeQ;
//echo $youtube;
// YOU TUBE
//$url = 'http://www.youtube.com/watch?v=NMAYr709-9Y&feature=dir';
// we get the unique video id from the url by matching the pattern
preg_match("/v=([^&]+)/i", $youtubeQ, $matches);
$id = $matches[1];
// this is your template for generating embed codes
$code = '';
// we replace each {id} with the actual ID of the video to get embed code for this particular video
$codeQ = str_replace('{id}', $id, $code);
// ตรวจสอบรูปแบบการแสดง IP Address
switch ($showIP) {
case "ALL" : $IP = "(IP=".$row["IP"].")"; break;
case "BAN" : $IP = "(IP=".substr($row["IP"],0,strrpos($row["IP"],".")).".*)"; break;
case "NONE": $IP = ""; break;
default : $IP = $row["IP"];
}
if($Member) {
$sql = "select * from $smf_member where User='$Name' ";
$result = mysql_query($sql);
$NRow = mysql_num_rows($result);
//if($NRow==0) { echo "Error"; exit(); }
$row = mysql_fetch_array($result);
// กำหนดค่าตัวแปร เพื่อนำไปแสดง
$mid =$row["mid"];
$mid_show = "SMF".sprintf("%06d",$row["mid"]);
$Ustatus=$row["Ustatus"];
//echo $Ustatus;
if ($Ustatus==0) {
$Ustatus="Member";
}else if ($Ustatus==1) {
$Ustatus="Administrator";
}else if ($Ustatus==2) {
$Ustatus="Moderator";
}
$Facebook = $row["Facebook"];
/*
if ($Facebook) {
$Facebook=$Facebook;
} else {
$Facebook="-";
}
*/
$Date2=$row["Date"];
$Email = $row["Email"];
$Slogan= $row["Slogan"];
$Profilepic= $row["Profilepic"];
$Profile_dis=$row["Profile_dis"];
$email_dis=$row["email_dis"];
$tel_dis=$row["tel_dis"];
}
//Total post ของคนตั้งหัวข้อกระทู้
$sqlP = "select * from $smf_data where mid = '$mid' ";
$resultP= mysql_query($sqlP);
$NRowP = mysql_num_rows($resultP);
$cate=mysql_fetch_array($resultP);
//Total Comment
$sqlC = "select * from $smf_ans where mid = '$mid' ";
$resultC= mysql_query($sqlC);
$NRowC = mysql_num_rows($resultC);
$totalpost=$NRowP+$NRowC;
//Total post ของคนตั้งหัวข้อกระทู้
// กำหนด Level ของสมาชิก
if ($row["Ustatus"]==0) {
if ($totalpost <10) {
$exp="สาวกหน้าใหม่";
} else if ($totalpost >=10 && $totalpost <50 ) {
$exp="สาวกระดับหนึ่ง";
} else if ($totalpost >=50 && $totalpost <100 ) {
$exp="สาวกระดับสอง";
} else if ($totalpost >=100 && $totalpost <500) {
$exp="สาวกพันธุ์แท้";
} else if ($totalpost >=500 && $totalpost <1000) {
$exp="อาจารย์ระดับหนึ่ง";
} else if ($totalpost >=1000 && $totalpost <2000) {
$exp="อาจารย์ระดับสอง";
} else {
$exp="ปรมาจารย์หิน เหล็ก ไฟ";
}
}else{
if ($row["Ustatus"]==1) {
$exp="ผู้ดูแลระบบ";
} else {
$exp="ผู้ตรวจทาน";
}
}
// แสดงข้อมูลของคำถาม(กระทู้)
echo "
";
// ตรวจสอบว่ามีรูปหรือไม่
if($imgpath) {
if ($imageType=="1") {
//echo $imageType;
$image_new = "$imgpath"; //url of picture
//echo $image_new;
$image_new = str_replace(' ','%20',$image_new); //take url and replace spaces
$max_width= $imgzise; //maximum width allowed for pictures
$resize_width= $imgzise; //same as max width
$size = getimagesize("$image_new"); //get the actual size of the picture
$width= $size[0]; // get width of picture
//echo $width;
$height= $size[1]; // get height of picture
if ($width>$max_width){
$new_width=$resize_width; // Resize Image If over max width
$zoom_title=0;
}else {
$new_width=$width; // Keep original size from array because smaller than max
$zoom_title=1;
}
//echo "" //print image with new width
if ($zoom_title==0) {
echo "\t\t
\n";
// ตรวจสอบว่ามีรูปหรือไม่
if($imgpath2) {
//echo $imgpath2;
if ($imageType2=="1") {
//echo $imageType2;
$image_new = "$imgpath2"; //url of picture
$image_new = str_replace(' ','%20',$image_new); //take url and replace spaces
$max_width= $imgzise; //maximum width allowed for pictures
$resize_width= $imgzise; //same as max width
//echo "image new = ".$image_new;
$size = getimagesize("$image_new"); //get the actual size of the picture
$width= $size[0]; // get width of picture
//echo $width;
$height= $size[1]; // get height of picture
if ($width>$max_width){
$new_width=$resize_width; // Resize Image If over max width
$zoom_title=0;
}else {
$new_width=$width; // Keep original size from array because smaller than max
$zoom_title=1;
}
if ($zoom_title==0) {
echo "\t\t
// Readcout +1 for viewpage
$sql11 = "update $smf_data set readcount=readcount+1 where No='$No' ";
$result11 = mysql_query($sql11);
if(!$result11) { echo "Error : Can not update to database"; exit(); }
?>