// breadcrumbs $breadcrumb = gcms::loadtemplate($index['module'], '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', $canonical, $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // โมดูล if ($index['module'] != $module_list[0]) { if (isset($install_modules[$index['module']]['menu_text'])) { $m = $install_modules[$index['module']]['menu_text']; $t = $install_modules[$index['module']]['menu_tooltip']; } else { $m = ucwords($index['module']); $t = $m; } $canonical = gcms::getURL($index['module']); $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $t, $m, $breadcrumb); } // อัปเดทการเปิดดู if (!isset($_REQUEST['visited'])) { $index['visited']++; $db->edit(DB_INDEX, $index['id'], array('visited' => $index['visited'])); } $cache->save($sql, $index); // แทนที่ลงใน template ของโมดูล $patt = array('/{BREADCRUMS}/', '/{TOPIC}/', '/{DETAIL}/', '/{MODULE}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = $index['topic']; $replace[] = gcms::showDetail($index['detail'], true, false); $replace[] = $module; $content = preg_replace($patt, $replace, gcms::loadtemplate($index['module'], '', 'main'));
<?php // modules/member/register.php if (defined('MAIN_INIT')) { // title $title = $lng['LNG_REGISTER_TITLE']; // breadcrumbs $breadcrumb = gcms::loadtemplate('', '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // url ของหน้านี้ $breadcrumbs['MODULE'] = gcms::breadcrumb('', gcms::getURL('register'), $lng['LNG_REGISTER_TITLE'], $lng['LNG_REGISTER_TITLE'], $breadcrumb); if (isset($config['custom_register']) && is_file(ROOT_PATH . $config['custom_register'])) { // custom register form include ROOT_PATH . $config['custom_register']; } else { // antispam $register_antispamchar = gcms::rndname(32); $_SESSION[$register_antispamchar] = gcms::rndname(4); // แสดงฟอร์ม registerfrm.html $patt = array('/{BREADCRUMS}/', '/<PHONE>(.*)<\\/PHONE>/isu', '/<IDCARD>(.*)<\\/IDCARD>/isu', '/<INVITE>(.*)<\\/INVITE>/isu', '/{(LNG_[A-Z0-9_]+)}/e', '/{ANTISPAM}/', '/{WEBURL}/', '/{MODAL}/', '/{INVITE}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = empty($config['member_phone']) ? '' : '\\1'; $replace[] = empty($config['member_idcard']) ? '' : '\\1'; $replace[] = empty($config['member_invitation']) ? '' : '\\1'; $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng'; $replace[] = $register_antispamchar; $replace[] = WEB_URL; $replace[] = gcms::getVars($_POST, 'action', '') != 'modal' ? 'false' : 'true';
$breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', $canonical, $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // url ของหน้านี้ $canonical = gcms::getURL($index['module']); // โมดูล if ($index['module'] != $module_list[0]) { if (isset($install_modules[$index['module']]['menu_text'])) { $m = $install_modules[$index['module']]['menu_text']; $t = $install_modules[$index['module']]['menu_tooltip']; } else { $m = ucwords($index['module']); $t = $m; } $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $t, $m, $breadcrumb); } // แก้ไข $breadcrumbs['EDIT'] = gcms::breadcrumb('', WEB_URL . "/index.php?module={$index['module']}-write&id={$index['id']}", "{$index['topic']}.{$index['ext']}", "{$index['topic']}.{$index['ext']}", $breadcrumb); // default query $where = " WHERE D.`module_id`='{$index['module_id']}' AND D.`document_id`='{$index['id']}'"; // จำนวนทั้งหมด $sql = "SELECT COUNT(*) AS `count` FROM `" . DB_EDOCUMENT_DOWNLOAD . "` AS D {$where}"; $count = $cache->get($sql); if (!$count) { $count = $db->customQuery($sql); $count = $count[0]; $cache->save($sql, $count); } // หน้าที่เรียก $page = gcms::getVars($_REQUEST, 'page', 0); $totalpage = round($count['count'] / $config['edocument_listperpage']); $totalpage += $totalpage * $config['edocument_listperpage'] < $count['count'] ? 1 : 0; $page = $page > $totalpage ? $totalpage : $page;
$title = $lng['LNG_DATA_NOT_FOUND']; $content = '<div class=error>' . $title . '</div>'; } else { $index = $index[0]; // config gcms::r2config($index['config'], $index); // login $login = gcms::getVars($_SESSION, 'login', array('id' => 0, 'status' => -1, 'email' => '', 'password' => '')); // breadcrumbs $breadcrumb = gcms::loadtemplate($index['module'], '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // breadcrumb ของ โมดูล $m = $install_modules[$index['module']]['menu_text']; $breadcrumbs['MODULE'] = gcms::breadcrumb('', gcms::getURL($index['module']), $install_modules[$index['module']]['menu_tooltip'], $m == '' ? $index['module'] : $m, $breadcrumb); // หมวด $categories = array(); $categories[0] = '<option value=0>{LNG_NO_CATEGORY}</option>'; $sql = "SELECT `category_id`,`topic` FROM `" . DB_CATEGORY . "` WHERE `module_id`='{$index['module_id']}' ORDER BY `category_id`"; $list = $cache->get($sql); if (!$list) { $list = $db->customQuery($sql); $cache->save($sql, $list); } foreach ($list as $item) { if ($isAdmin || $cat == $item['category_id']) { $sel = $cat == $item['category_id'] ? ' selected' : ''; $categories[$item['category_id']] = "<option value={$item['category_id']}{$sel}>" . gcms::ser2Str($item, 'topic') . "</option>"; } }
<?php // modules/member/dologin.php if (defined('MAIN_INIT')) { // title $title = $lng['LNG_LOGIN']; // breadcrumbs $breadcrumb = gcms::loadtemplate('member', '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // url ของหน้านี้ $breadcrumbs['MODULE'] = gcms::breadcrumb('', gcms::getURL('dologin'), strip_tags($lng['LNG_LOGIN_TITLE']), $lng['LNG_LOGIN'], $breadcrumb); if (!gcms::isMember()) { // อ่านข้อมูลจาก cookie $login_email = empty($_COOKIE[PREFIX . '_login_email']) ? '' : gcms::decode($_COOKIE[PREFIX . '_login_email']); $login_password = empty($_COOKIE[PREFIX . '_login_password']) ? '' : gcms::decode($_COOKIE[PREFIX . '_login_password']); $login_remember = empty($_COOKIE[PREFIX . '_login_remember']) ? 0 : (int) $_COOKIE[PREFIX . '_login_remember']; if (!empty($config['custom_login']) && is_file(ROOT_PATH . $config['custom_login'])) { // custom login form include_once ROOT_PATH . $config['custom_login']; } else { // ฟอร์ม login $patt = array('/{BREADCRUMS}/', '/{(LNG_[A-Z0-9_]+)}/e', '/{WEBTITLE}/', '/{SUBTITLE}/', '/{EMAIL}/', '/{PASSWORD}/', '/{REMEMBER}/', '/{WEBURL}/', '/{FACEBOOK}/', '/{NEXT}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng'; $replace[] = $config['web_title']; $replace[] = empty($error) ? $config['web_description'] : '<span class=error>' . $error . '</span>'; $replace[] = $login_email; $replace[] = $login_password;
<?php // modules/member/forgot.php if (defined('MAIN_INIT')) { // title $title = $lng['LNG_FORGOT_TITLE']; // breadcrumbs $breadcrumb = gcms::loadtemplate('', '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // url ของหน้านี้ $breadcrumbs['MODULE'] = gcms::breadcrumb('', gcms::getURL('forgot'), $lng['LNG_FORGOT_TITLE'], $lng['LNG_FORGOT_TITLE'], $breadcrumb); if (isset($config['custom_forgot']) && is_file(ROOT_PATH . $config['custom_forgot'])) { // custom register form include ROOT_PATH . $config['custom_forgot']; } else { // แสดงฟอร์ม member/forgotfrm.html $patt = array('/{BREADCRUMS}/', '/{(LNG_[A-Z0-9_]+)}/e', '/{WEBURL}/', '/{MODAL}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng'; $replace[] = WEB_URL; $replace[] = gcms::getVars($_POST, 'action', '') == 'modal' ? 'true' : 'false'; $content = gcms::pregReplace($patt, $replace, gcms::loadtemplate('member', 'member', 'forgotfrm')); } // เลือกเมนู $menu = 'forgot'; }
} $splitpage .= $i < $totalpage ? str_replace('%1', $totalpage, $url) : ''; } } // stop timer $mtime = microtime(); $mtime = explode(' ', $mtime); $time_end = $mtime[1] + $mtime[0]; // breadcrumbs $breadcrumb = gcms::loadtemplate('', '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // หน้าค้นหา $canonical = WEB_URL . '/index.php?module=search&q=' . urlencode($search); $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, '{LNG_SEARCH}', '{LNG_SEARCH}', $breadcrumb); // แสดงผล $patt = array('/{BREADCRUMS}/', '/{(LNG_[A-Z0-9_]+)}/e', '/{WEBURL}/', '/{MODULE}/', '/{SEARCH}/', '/{RESULT}/', '/{LIST}/', '/{SPLITPAGE}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng'; $replace[] = WEB_URL; $replace[] = $module; $replace[] = $search; $replace[] = sizeof($list) == 0 ? '' : sprintf($lng['ALL_SEARCH'], $start + 1, $end, $rows, $search, number_format($time_end - $time_start, 4)); if ($search == '') { $replace[] = $lng['LNG_SEARCH_TIP']; } elseif (sizeof($list) == 0) { $replace[] = sprintf($lng['LNG_SEARCH_NOT_FOUND'], $search) . $lng['LNG_SEARCH_TIP']; } else { $replace[] = gcms::HighlightSearch(implode("\n", $list), $search);
// อ่าน config gcms::r2config($index['config'], $index); } } if (!$index) { $title = $lng['LNG_DOCUMENT_NOT_FOUND']; $content = '<div class=error>' . $title . '</div>'; } else { if ($cat_count == 1) { $index['topic'] = gcms::ser2Str($index, 'topic'); $index['description'] = gcms::ser2Str($index, 'description'); $index['icon'] = gcms::ser2Str($index, 'icon'); } // category if ($cat_count == 1 && $index['topic'] != '') { $breadcrumbs['CATEGORY'] = gcms::breadcrumb('', gcms::getURL($index['module'], '', (int) $index['category_id']), $index['description'], $index['topic'], $breadcrumb); } $splitpage = ''; $list = array(); if ($cat_count > 0 || $index['categories'] == 0 || $index['category_display'] == 0) { // เลือกหมวดมา หรือไม่มีหมวด หรือปิดการแสดงผลหมวดหมู่ แสดงรายการเรื่อง include ROOT_PATH . 'modules/document/stories.php'; $template = 'list'; } else { // ลิสต์รายชื่อหมวด include ROOT_PATH . 'modules/document/categories.php'; $template = 'category'; } // แสดงผลหน้าเว็บ $patt = array('/{BREADCRUMS}/', '/{LIST}/', '/{NEWTOPIC}/', '/{CATEGORY}/', '/{TOPIC}/', '/{DETAIL}/', '/{SPLITPAGE}/', '/{LANGUAGE}/', '/{MODULE}/'); $replace = array();
$categories = array(); if ($index && $canEdit) { // breadcrumbs $breadcrumb = gcms::loadtemplate($index['module'], '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', $canonical, $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // โมดูล if (isset($install_modules[$index['module']]['menu_text'])) { $m = $install_modules[$index['module']]['menu_text']; $t = $install_modules[$index['module']]['menu_tooltip']; } else { $m = ucwords($index['module']); $t = $m; } $breadcrumbs['MODULE'] = gcms::breadcrumb('', gcms::getURL($index['module']), $t, $m, $breadcrumb); if ($rid == 0) { $categories[0] = '<option value=0>{LNG_NO_CATEGORY}</option>'; $sql = "SELECT `category_id`,`topic` FROM `" . DB_CATEGORY . "` WHERE `module_id`='{$index['module_id']}' ORDER BY `category_id`"; foreach ($db->customQuery($sql) as $item) { if ($moderator || $index['category_id'] == $item['category_id']) { $sel = $index['category_id'] == $item['category_id'] ? ' selected' : ''; $categories[$item['category_id']] = "<option value={$item['category_id']}{$sel}>" . gcms::ser2Str($item, 'topic') . "</option>"; } } if (sizeof($categories) > 1) { unset($categories[0]); } } // antispam $register_antispamchar = gcms::rndname(32);
$index['id'] = 0; $reciever = array(); } if ($id == 0 || $canEdit) { // antispam $antispam = gcms::rndname(32); $_SESSION[$antispam] = gcms::rndname(4); // breadcrumbs $breadcrumb = gcms::loadtemplate($index['module'], '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', $canonical, $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // url ของหน้านี้ $canonical = gcms::getURL($index['module']); // module $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $index['title'], $index['title'], $breadcrumb); // สถานะ (กลุ่ม) ของสมาชิกทั้งหมด $status = array(); $sel = in_array(-1, $reciever) ? ' selected' : ''; $status[] = '<option value=-1' . $sel . '>{LNG_GUEST}</option>'; foreach ($config['member_status'] as $i => $item) { $sel = in_array($i, $reciever) ? ' selected' : ''; $status[] = '<option value=' . $i . $sel . '>' . $item . '</option>'; } // form $patt = array('/{BREADCRUMS}/', '/{GROUPS}/', '/{(LNG_[A-Z0-9_]+)}/e', '/{TYPE}/', '/{SIZE}/', '/{ANTISPAM}/', '/{ANTISPAMVAL}/', '/{ID}/', '/{NO}/', '/{TOPIC}/', '/{DETAIL}/', '/{ICON}/', '/{ACTION}/'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = implode('', $status); $replace[] = OLD_PHP ? '$lng[\'$1\']' : 'gcms::getLng'; $replace[] = implode(', ', $config['edocument_file_typies']);
$breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // โมดูล if (isset($install_modules[$index['module']]['menu_text'])) { $m = $install_modules[$index['module']]['menu_text']; $t = $install_modules[$index['module']]['menu_tooltip']; } else { $m = ucwords($index['module']); $t = $m; } $canonical = gcms::getURL($index['module']); $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $t, $m, $breadcrumb); // กลุ่ม if ($id > 0) { $breadcrumbs['CATEGORY'] = gcms::breadcrumb('', gcms::getURL($index['module'], '', 0, 0, "cat={$id}"), $categories[$id], $categories[$id], $breadcrumb); } // default query $q = array(); $q[] = "`module_id`='{$index['module_id']}'"; if ($id > 0) { $q[] = "`category_id`='{$id}'"; } $where = 'WHERE ' . implode(' AND ', $q); // query บุคลากร $sql = "SELECT * FROM `" . DB_PERSONNEL . "` AS M"; $sql .= " {$where} ORDER BY `category_id` ASC,`order` ASC,`id` ASC"; $list = $cache->get($sql); if (!$list) { $list = $db->customQuery($sql); $cache->save($sql, $list);
$sql .= " WHERE I.`module_id`={$index['module_id']} AND I.`language` IN ('" . LANGUAGE . "','') LIMIT 1"; $mo = $cache->get($sql); if (!$mo) { $mo = $db->customQuery($sql); $cache->save($sql, $mo); } $m = $mo[0]['topic']; $t = $mo[0]['topic']; } $canonical = gcms::getURL($index['module']); $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $t, $m, $breadcrumb); } // category $category = gcms::ser2Str($index, 'category'); if (!empty($category)) { $breadcrumbs['CATEGORY'] = gcms::breadcrumb('', gcms::getURL($index['module'], '', $index['category_id']), gcms::ser2Str($index, 'cat_tooltip'), $category, $breadcrumb); } // ความคิดเห็น $comments = array(); if ($canReply) { $patt = array('/(edit-{QID}-{RID}-{NO}-{MODULE})/', '/(delete-{QID}-{RID}-{NO}-{MODULE})/', '/{DETAIL}/', '/{UID}/', '/{DISPLAYNAME}/', '/{STATUS}/', '/{DATE}/', '/{DATEISO}/', '/{IP}/', '/{NO}/', '/{RID}/'); $skin = gcms::loadtemplate($index['module'], 'document', 'commentitem'); // query $sql = "SELECT C.*,U.`status`"; $sql .= ",(CASE WHEN ISNULL(U.`id`) THEN C.`email` WHEN U.`displayname`='' THEN U.`email` ELSE U.`displayname` END) AS `displayname`"; $sql .= " FROM `" . DB_COMMENT . "` AS C"; $sql .= " LEFT JOIN `" . DB_USER . "` AS U ON U.`id`=C.`member_id`"; $sql .= " WHERE C.`index_id`='{$index['id']}' AND C.`module_id`='{$index['module_id']}'"; $sql .= " ORDER BY C.`id` ASC"; if (isset($_REQUEST['visited'])) { $datas = $db->customQuery($sql);
// modules/member/main.php if (defined('MAIN_INIT') && $isMember) { // query ข้อมูลสมาชิก $sql = "SELECT * FROM `" . DB_USER . "` WHERE `id`=" . gcms::getVars($_REQUEST, 'id', 0) . " LIMIT 1"; $result = $cache->get($sql); if (!$result) { $result = $db->customQuery($sql); $cache->save($sql, $result); } if (sizeof($result) == 1) { $result = $result[0]; // breadcrumbs $breadcrumb = gcms::loadtemplate('', '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // แสดงผล $patt = array('/{BREADCRUMS}/', '/{WEBURL}/', '/{WEBTITLE}/', '/{SKIN}/', '/{ID}/', '/{COLOR}/', '/{DISPLAYNAME}/', '/{EMAIL}/', '/{SEX}/', '/{DATE}/', '/{WEBSITE}/', '/{VISITED}/', '/{SOCIAL}/', '/{LASTVISITED}/', '/{POST}/', '/{REPLY}/', '/{STATUS}/', '/{POINT}/', '/{(LNG_[A-Z0-9_]+)}/e'); $replace = array(); $replace[] = implode("\n", $breadcrumbs); $replace[] = WEB_URL; $replace[] = $config['web_title']; $replace[] = SKIN; $replace[] = $result['id']; $replace[] = $result['status']; $u = array(); gcms::checkempty($result['pname'], $u); gcms::checkempty($result['fname'], $u); gcms::checkempty($result['lname'], $u); if (sizeof($u) > 0) { if ($result['displayname'] != '') {
// โมดูล if ($index['module'] != $module_list[0]) { if (isset($install_modules[$index['module']]['menu_text'])) { $m = $install_modules[$index['module']]['menu_text']; $t = $install_modules[$index['module']]['menu_tooltip']; } else { $m = ucwords($index['module']); $t = $m; } $canonical = gcms::getURL($index['module']); $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $t, $m, $breadcrumb); } $canonical = gcms::getURL($index['module'], '', 0, 0, "id={$id}"); if (!empty($index['category'])) { // อัลบัม $breadcrumbs['CATEGORY'] = gcms::breadcrumb('', $canonical, $index['category'], $index['category'], $breadcrumb); } // ทั้งหมด $sql = "SELECT COUNT(*) AS `count` FROM `" . DB_GALLERY . "`"; $sql .= " WHERE `module_id`='{$index['module_id']}' AND `album_id`='{$id}'"; $count = $cache->get($sql); if (!$count) { $count = $db->customQuery($sql); $cache->save($sql, $count); } if ($count[0]['count'] == 0) { $content = '<div class=error>' . $lng['LNG_LIST_EMPTY'] . '</div>'; } else { // จำนวนที่ต้องการ $list_per_page = $config['gallery_rows'] * $config['gallery_cols']; // หน้าที่เรียก
// modules/member/editprofile.php if (defined('MAIN_INIT') && $isMember) { // ข้อมูล user ที่ login $user = $db->getRec(DB_USER, $_SESSION['login']['id']); if (!$user) { $title = $lng['LNG_MEMBER_NOT_FOUND']; $content = '<div class=error>' . $title . '</div>'; } else { // breadcrumbs $breadcrumb = gcms::loadtemplate('', '', 'breadcrumb'); $breadcrumbs = array(); // หน้าหลัก $breadcrumbs['HOME'] = gcms::breadcrumb('icon-home', WEB_URL . '/index.php', $install_modules[$module_list[0]]['menu_tooltip'], $install_modules[$module_list[0]]['menu_text'], $breadcrumb); // url ของหน้านี้ $breadcrumbs['MODULE'] = gcms::breadcrumb('', gcms::getURL('forgot'), $lng['LNG_MEMBER_EDIT_TITLE'], $lng['LNG_MEMBER_EDIT_TITLE'], $breadcrumb); if ($user['fb'] == 1) { unset($member_tabs['password']); } // ตรวจสอบ tab ที่เลือก $title = ''; $tab = gcms::getVars($_REQUEST, 'tab', ''); $file = isset($member_tabs[$tab][1]) ? $member_tabs[$tab][1] : ''; if ($file == '' || !is_file(ROOT_PATH . "{$file}.php")) { // เรียก tab แรก ถ้าไม่มีการระบุ tab มา reset($member_tabs); $tab = key($member_tabs); $file = $member_tabs[$tab][1]; } if ($file != 'modules/member/editprofile') { include ROOT_PATH . "{$file}.php";
$m = ucwords($index['module']); $t = $m; } $canonical = gcms::getURL($index['module']); $breadcrumbs['MODULE'] = gcms::breadcrumb('', $canonical, $t, $m, $breadcrumb); } // default query $q = array(); $q[] = "`module_id`='{$index['module_id']}'"; // หมวด $cat = gcms::getVars($_REQUEST, 'cat', 0); if ($cat > 0) { $q[] = "`category_id`='{$cat}'"; if (!empty($categories[$cat])) { // category $breadcrumbs['CATEGORY'] = gcms::breadcrumb('', gcms::getURL($index['module']) . '?cat=' . $cat, $categories[$cat], $categories[$cat], $breadcrumb); } } // ข้อความค้นหา $search = $db->sql_trim_str($_REQUEST, 'q'); if ($search != '') { $q[] = "(`name` LIKE '%{$search}%' OR `ext` LIKE '%{$search}%' OR `detail` LIKE '%{$search}%')"; } $where = ' WHERE ' . implode(' AND ', $q); // จำนวนดาวน์โหลดทั้งหมด $sql = "SELECT COUNT(*) AS `count` FROM `" . DB_DOWNLOAD . "` {$where}"; $count = $cache->get($sql); if (!$count) { $count = $db->customQuery($sql); $count = $count[0]; $cache->save($sql, $count);