<?
// ฟังก์ชั่นตรวจสอบ Category
    
function CheckCategory($Category) { 
        include(
"config.inc.php");    //ตั้งค่าต่างๆของเว็บบอร์ด
        
        
$CategoryOK 0;

        for ( 
$i=$i<sizeof($CategoryArray) ; $i++ ){
            if(
$Category==$CategoryArray[$i]){
                
$CategoryOK 1;
                break;
            }
            else
                
$CategoryOK 0;
        }

        if(!
$CategoryOK){
            echo 
"<center><br>";
            echo 
"<font color=red size=+1> กรุณาระบุ Category ให้ตรงกับที่ web เปิดใช้ด้วยครับ</font>";
            echo 
"<br><br>";
            echo 
"<font color=red size=+1><b>[</b> <a href='javascript:history.back(1)'>กลับไปแก้ไข</a> <b>]</b></font>";
            echo 
"</center>";
            exit();
            return 
0;
        }
        else {
            return 
$Category;
        }

    }
    
//$online = 1;
    
function convert_date($str) {
$d substr($str82);
$m substr($str52);
$y substr($str04);
$h substr($str115);
$s substr($str142);
$result $d.'-'.$m.'-'.$y.' '.$h;
return 
$result;
}

//thaidate
/*
function convert_date($str) {
$d = substr($str, 8, 2);
$m = substr($str, 5, 2);
$y = substr($str, 0, 4);
$y  = $y + 543;
$h = substr($str, 11, 5);
$s = substr($str, 14, 2);
$result = $d.'-'.$m.'-'.$y.' '.$h;
return $result;
}
*/

function convert_ckdate($str) {
$d substr($str82);
$m substr($str52);
$y substr($str04);
$h substr($str115);
//$h =$h + 7;
$s substr($str142);
$result $d.'-'.$m.'-'.$y.' '.$h;
return 
$result;
}

?>