"; } $allow_view = $row[ALLOW_VIEW]; $ARTICLE_TOPIC = $row[ARTICLE_TOPIC]; $ARTICLE_DETAIL = $row[ARTICLE_DETAIL]; $file1_title = $row["FILE1_TITLE"]; $file2_title = $row["FILE2_TITLE"]; $file3_title = $row["FILE3_TITLE"]; $file1 = $row["FILE1"]; $file2 = $row["FILE2"]; $file3 = $row["FILE3"]; $TRAINER_ID = $row[TRAINER_ID]; $FNAME = $row[FNAME]; $LNAME = $row[LNAME]; $DATE_ADD = Convert_YMDHMS_2_DMYHM($row[DATE_ADD]); $article_privilege = $row["ARTICLE_PRIVILEGE"]; $article_extra = $row["ARTICLE_EXTRA"]; $allow_comment = $row["ALLOW_COMMENT"]; } mysql_free_result($result); $icon_extra = ""; $arr_icon_extra = preg_split ("/,/",$article_privilege . $article_extra, -1, PREG_SPLIT_NO_EMPTY); foreach ($arr_icon_extra as $strTemp) { $icon_extra .= " "; } $attach_file = ""; if ($file1) { $attach_file .= <<$file1_title
Data; } if ($file2) { $attach_file .= <<$file2_title
Data; } if ($file3) { $attach_file .= <<$file3_title
Data; } if ($attach_file) { $attach_file = "

ข้อมูลเพิ่มเติม :
$attach_file"; } $arrARTICLE_DETAIL = preg_split("/$cfg_content_split_page_sign/", $ARTICLE_DETAIL, -1, PREG_SPLIT_NO_EMPTY); $all_page = sizeof($arrARTICLE_DETAIL); $ARTICLE_DETAIL = $arrARTICLE_DETAIL[0]; if ($all_page > 0) { if (!$p_content) { $p_content = 1; } $detail_position = $p_content - 1; $ARTICLE_DETAIL = $arrARTICLE_DETAIL[$detail_position]; $new_query_string = "&article_id=$article_id"; # เลขหน้าสำหรับทำลิงค์ # $script_file = $_SERVER["PHP_SELF"]; for ($i=1;$i<=$all_page;$i++) { $p_content_temp = $p_content + 1; $p_content_temp2 = $p_content - 1; if ($i == 1) { if ($i == $p_content) { $page_content_link .= "[ $i ] "; } else { $page_content_link .= "<< Prev [ $i ] "; } } elseif ($i == $all_page) { if ($i == $p_content) { $page_content_link .= "[ $i ] "; } else { $page_content_link .= "[ $i ] Next >>"; } } else { if ($i == $p_content) { $page_content_link .= "[ $i ] "; } else { $page_content_link .= "[ $i ] "; } } } # /เลขหน้าสำหรับทำลิงค์ # # /split page } if ($all_page == 1) { $page_content_link = ""; } if ($allow_view == "member") { if (!$_SESSION['s_trainer_username']) { if (!$_SESSION['s_user_username']) { $error = $cfg_text_error_session; $go = urlencode($_SERVER["REQUEST_URI"]); header("Location: $cfg_main_url/user/index.php?error=$error&go=$go"); exit; } } } $sql2 = "SELECT * FROM $db_table_trainer_article_stats WHERE ARTICLE_ID = '$article_id' LIMIT 0,1"; $result2 = mysql_query($sql2); while($row2 = mysql_fetch_array($result2)) { $total_view = $row2[TOTAL_VIEW]; $poll_Y = $row2[POLL_Y]; $poll_N = $row2[POLL_N]; } mysql_free_result($result2); mysql_close($db); $total_poll = $poll_Y + $poll_N; $poll_percent_Y = 0; $poll_percent_N = 0; if ($poll_Y > 0) { $poll_percent_Y = sprintf ("%.02f",(100 / $total_poll) * $poll_Y); } if ($poll_N > 0) { $poll_percent_N = sprintf ("%.02f",(100 / $total_poll) * $poll_N); } $fb_href = "http://www.tumcivil.com" . $_SERVER["REQUEST_URI"]; $strSelfTrainer = "N"; if($TRAINER_ID == $_SESSION['s_trainer_id']) { $strSelfTrainer = "Y"; } if ($allow_comment == "Y") { $fb_comment = << Data; $CONTENT_COMMENT = Content_Comment("article",$article_id,$p,$strSelfTrainer); } else { $fb_comment = ""; $CONTENT_COMMENT = "

ขออภัย บทความนี้ปิดการแสดงความคิดเห็น
"; } $category = "article"; $content_id = $article_id; $template = $tp_article_gen; $fp = fopen($template,"r"); $HTML = fread($fp,filesize($template)); fclose($fp); $HTML = preg_replace("/\\$(\w+)/e","$$1",$HTML); echo $HTML; ob_end_flush(); exit; ob_end_flush(); #### end of program #### ##################################################################### #### Start sub program. Don't touch anything below #### ?>