debugging = false; //================================================ // Part 2 : Data Management $cookie_params = session_get_cookie_params(); $today = strftime("%m/%d/%Y", time()); list($m,$d,$y) = split("/", $today); $m = $m*1; $d = $d*1;$y = $y*1; $ty = $y+543; $thaidate = "$d/$m/$ty"; $login_link = ""; if ( IsWanpra_Jantarakati( $thaidate )) { $jan = thaidate2jantarakati_reading($thaidate); $login_link .= "วันนี้ วันพระ
"; } if ( IsWanpra_Jantarakati( jd2thaidate(thaidate2jd($thaidate) + 1 ))) { $login_link .= "พรุ่งนี้ วันพระ
"; } if ( $current_time - $login_time < $limit_time ) { // ยังอยู่ในเวลา login $login_time = $current_time; // update เวลาให้เป็นเวลาปัจจุบันเลย! //$login_link = "ตั้งกระทู้ใหม่ | วิธีใช้ | Logout |
แก้ไขข้อมูลส่วนตัว | เปลี่ยน Password"; $login_link .= "ตั้งกระทู้ใหม่ | กระทู้เก่า | Logout |
แก้ไขข้อมูลส่วนตัว | เปลี่ยน Password"; $login_link .= ($admin)? " |
เพิ่มสมาชิก" : ""; $login_link .= ($admin==2)? " | phpMyAdmin" : ""; } else { //$login_link = "Login | สมัครสมาชิก"; $login_link .= "กระทู้เก่า | Login"; } //----------------------------------------------------------------------- $sql = "SELECT * FROM ssanti_kratoo WHERE permission > '0' ORDER BY kratoo_id DESC LIMIT $max_kratoo_show"; $db->query($sql); $i=0; $max_kratoo_id = 1; while($db->next_record()) { $kratoo_id[$i] = $db->f("kratoo_id"); $max_kratoo_id = ( $i == 0 )? $db->f("kratoo_id") : $max_kratoo_id; $num_msg[$i] = $db->f("num_msg"); $topic[$i] = $db->f("topic"); //$message[] = $db->f("message"); $name[$i] = $db->f("name"); //$ip[] = $db->f("ip"); $tab_color[$i] = ( $db->f("kratoo_id") %2)? "lightyellow":"#BBBBBB"; $thai_date_time = ThaiDateandTime($db->f("date_time")); //$thai_lastmsg_date_time = ThaiDateandTime($db->f("lastmsg_date_time")); list($lastdate,) = split(" ", $db->f("lastmsg_date_time")); $thai_lastmsg_date_time = ( $calc->dateNow("%Y-%m-%d") == $lastdate )? "".ThaiDateandTime($db->f("lastmsg_date_time"))."" : ThaiDateandTime($db->f("lastmsg_date_time")); $kratoo_time[$i] = ($thai_date_time == $thai_lastmsg_date_time)? $thai_date_time : "$thai_date_time / $thai_lastmsg_date_time"; $i++; } $min_kratoo_id = ( $max_kratoo_id - $max_kratoo_show + 1 > 0)? $max_kratoo_id - $max_kratoo_show + 1 : 1; $sql = "UPDATE ssanti_kratoo SET permission = -1 WHERE kratoo_id < '$min_kratoo_id' "; $db->query($sql); //================================================ // Part 3 : Assign Data to Template and Display $smarty->assign(login_link, $login_link); $smarty->assign(kratoo_id, $kratoo_id); $smarty->assign(kratoo_time, $kratoo_time); $smarty->assign(topic, $topic); $smarty->assign(name, $name); $smarty->assign(num_msg, $num_msg); $smarty->assign(tab_color, $tab_color); $smarty->assign(webmaster_email, $webmaster_email); $smarty->display('ss_list.tpl'); ?>