function __construct() { CORE::$bgend = true; CORE::summon(__FILE__); self::$func = $func = array_shift(CORE::$args); self::$temp = CORE::$cfg["temp"]['admin']; self::$temp_option = CORE::$cfg["temp"]['admin_option']; self::$lang = (include CORE::$path . 'lang/lang-cht.php'); CORE::res_init('ogs_admin', 'font', 'fix', 'css'); CORE::res_init('default', 'js'); # 預定使用功能 $function = array('system' => false, 'manager' => true, 'ad' => true, 'intro' => true, 'faq' => true, 'news' => true, 'products' => true, 'order' => false, 'member' => true, 'contact' => true, 'sk' => false, 'blog' => true, 'feedback' => true, 'gallery' => true, 'rewrite' => true); MANAGER::ban_check(); MANAGER::class_handle($function); if (isset($function[$func])) { $func_name = strtoupper($func); new $func_name($function[$func]); } else { self::$temp["MAIN"] = self::$temp_option["INDEX"]; } MANAGER::check(); # 登入檢查 MANAGER::level_check($func); # 權限檢查 self::language_select(); if (!CORE::$mobile) { VIEW::assignGlobal('TAG_PC', 'pc'); } if (!CHECK::is_ajax()) { new VIEW(self::$temp_option["HULL"], self::$temp, false, 1); } }
function __construct() { list($func) = CORE::$args; $nav_class = 'SALE'; MANAGER::level_check(1); CORE::res_init('pyramid', 'css'); switch ($func) { case "bonus": # 未發送獎金列表 $nav_func = 'BONUS'; self::$temp["MAIN"] = 'ogs-admin-sale-bonus-tpl.html'; self::bonus(); break; case "grant": # 獎金發送 self::$temp["MAIN"] = self::$temp_option["MSG"]; self::grant(); break; case "granted": # 已發送獎金列表 $nav_func = 'GRANTED'; self::$temp["MAIN"] = 'ogs-admin-sale-granted-tpl.html'; self::granted(); break; default: self::$id = $func; self::$temp["MAIN"] = 'ogs-admin-sale-tpl.html'; self::row(); break; } self::nav_current($nav_class, $nav_func); }
function __construct() { list($args) = CORE::$args; self::$temp = CORE::$temp_main; self::$id = SEO::origin('intro', $args); self::$temp["MAIN"] = 'ogs-intro-tpl.html'; self::row(); self::nav(); CORE::common_resource(); CORE::res_init('about/data', 'css'); new VIEW(CORE::$temp_option["HULL"], self::$temp, false, false); }
private static function row() { CORE::res_init('fix', 'css'); if (!empty(self::$cate)) { $rsnum = CRUD::dataFetch('gallery', array('parent' => self::$cate, 'status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"])); } else { $rsnum = CRUD::dataFetch('gallery', array('status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"])); } if (!empty($rsnum)) { #VIEW::newBlock("TAG_GALLERY_BLOCK"); $dataRow = CRUD::$data; foreach ($dataRow as $key => $row) { VIEW::newBlock("TAG_GALLERY_LIST"); foreach ($row as $field => $var) { switch ($field) { case "dirpath": #list($var) = self::dirLoad($var,1); break; case "content": $strLength = 30; $var = mb_strlen(strip_tags($var)) > $strLength ? mb_substr(strip_tags($var), 0, $strLength, 'UTF-8') . '...' : $var; break; } $output["VALUE_" . strtoupper($field)] = $var; } IMAGES::load('gallery', $row['id']); list($image) = IMAGES::$data; $output['VALUE_IMAGE'] = $image['path']; $output['VALUE_LINK'] = self::dataLink($row["parent"], $row); VIEW::assign($output); } # SEO $cate_rsnum = CRUD::dataFetch('gallery_cate', array('id' => self::$cate)); if (!empty($cate_rsnum)) { list($cate_row) = CRUD::$data; SEO::load($cate_row["seo_id"]); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = $cate_row["subject"]; } } else { SEO::load('gallery'); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = CORE::$lang["gallery"]; } } SEO::output(); CRUMBS::fetch('gallery', $cate_row); } else { VIEW::newBlock("TAG_NONE"); } }
function __construct() { list($func, $id) = CORE::$args; $nav_class = 'INTRO'; switch ($func) { case "add": self::$temp["MAIN"] = 'ogs-admin-intro-insert-tpl.html'; self::$temp["SEO"] = self::$temp_option["SEO"]; CORE::res_init('tab', 'box'); self::add(); break; case "insert": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::insert(); break; case "detail": self::$temp["MAIN"] = 'ogs-admin-intro-modify-tpl.html'; self::$temp["SEO"] = self::$temp_option["SEO"]; CORE::res_init('tab', 'box'); self::detail($id); break; case "modify": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::modify(); break; case "del": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::delete($id); break; case "multi": self::$temp["MAIN"] = self::$temp_option["MSG"]; parent::multi('intro', CORE::$manage . 'intro/'); break; case "multiChange": self::$temp["MAIN"] = self::$temp_option["MSG"]; $idArray = parent::multiChange('intro'); if (is_array($idArray)) { foreach ($idArray as $id) { $_POST['id'] = $id; self::modify(); } } break; default: self::$temp["MAIN"] = 'ogs-admin-intro-list-tpl.html'; self::row(); break; } self::nav_current($nav_class, $nav_func); }
function __construct() { $func = array_shift(CORE::$args); switch ($func) { case "cate": # 類別管理 CORE::res_init('get', 'box'); self::$temp["MAIN"] = 'ogs-admin-stock-cate-tpl.html'; self::cate(); break; case "cate-replace": # 類別更新 self::$temp["MAIN"] = self::$temp_option["MSG"]; self::cate_replace(); break; case "cate-del": # 類別刪除 self::cate_del(); break; case "item": # 項目管理 CORE::res_init('get', 'box'); self::$temp["MAIN"] = 'ogs-admin-stock-item-tpl.html'; self::item(); break; case "item-replace": # 項目更新 self::$temp["MAIN"] = self::$temp_option["MSG"]; self::item_replace(); break; case "item-del": self::item_del(); break; case "replace": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::replace(); break; case "del": self::del(); break; default: CORE::res_init('get', 'box'); self::$temp["MAIN"] = 'ogs-admin-stock-bind-tpl.html'; self::bind($func); $func = false; break; } self::nav_current('STOCK', $func); }
private static function row() { CORE::res_init('fix', 'css'); if (!empty(self::$cate)) { $rsnum = CRUD::dataFetch('news', array('parent' => self::$cate, 'status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"])); } else { $rsnum = CRUD::dataFetch('news', array('status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"])); } if (!empty($rsnum)) { #VIEW::newBlock("TAG_NEWS_BLOCK"); $dataRow = CRUD::$data; SCHEMA::make('news_list', $dataRow); foreach ($dataRow as $key => $row) { VIEW::newBlock("TAG_NEWS_LIST"); foreach ($row as $field => $var) { switch ($field) { case "showdate": VIEW::assign("VALUE_" . strtoupper($field), date("Y.m.d", strtotime($var))); break; default: VIEW::assign("VALUE_" . strtoupper($field), $var); break; } } IMAGES::load('news', $row["id"]); list($images) = IMAGES::$data; VIEW::assign(array("VALUE_LINK" => self::dataLink($row["parent"], $row), "VALUE_IMAGE" => $images["path"], "VALUE_ALT" => $images["alt"], "VALUE_TITLE" => $images["title"])); } # SEO $cate_rsnum = CRUD::dataFetch('news_cate', array('id' => self::$cate)); if (!empty($cate_rsnum)) { list($cate_row) = CRUD::$data; SEO::load($cate_row["seo_id"]); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = $cate_row["subject"]; } } else { SEO::load('news'); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = CORE::$lang["news"]; } } SEO::output(); CRUMBS::fetch('news', $cate_row); } else { VIEW::newBlock("TAG_NONE"); } }
function __construct() { list($func) = CORE::$args; switch ($func) { case "replace": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::replace(); break; case "del": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::del(); break; default: CORE::res_init('get', 'box'); self::$temp["MAIN"] = 'ogs-admin-rewrite-tpl.html'; self::row(); break; } self::nav_current('SYSTEM', 'REWRITE'); }
private static function row() { CORE::res_init('tab', 'box'); $rsnum = CRUD::dataFetch('system', array('id' => '1')); if (!empty($rsnum)) { $row = CRUD::$data[0]; foreach ($row as $field => $var) { VIEW::assignGlobal("VALUE_" . strtoupper($field), $var); } } # SEO $rsnum = CRUD::dataFetch('seo', array('custom' => "name != ''", 'langtag' => CORE::$langtag)); if (!empty($rsnum)) { VIEW::newBlock("TAG_SEO_BLOCK"); foreach (CRUD::$data as $key => $row) { VIEW::newBlock("TAG_SEO_TITLE"); switch ($row["name"]) { case "index": VIEW::assign("VALUE_NAME", self::$lang['home']); break; default: VIEW::assign("VALUE_NAME", self::$lang[$row["name"]]); break; } VIEW::newBlock("TAG_SEO_TAB"); foreach ($row as $field => $var) { switch ($field) { case "name": $name = $var == 'index' ? self::$lang['home'] : self::$lang[$var]; VIEW::assign("VALUE_" . strtoupper($field), $name); break; default: VIEW::assign("VALUE_" . strtoupper($field), $var); break; } } } } }
private static function row() { CORE::res_init('fix', 'css'); $rsnum = CRUD::dataFetch('products_cate', array('parent' => self::$cate, 'status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"])); if (!empty($rsnum)) { #VIEW::newBlock("TAG_PRODUCTS_CATE_BLOCK"); $dataRow = CRUD::$data; foreach ($dataRow as $key => $row) { VIEW::newBlock("TAG_PRODUCTS_CATE_LIST"); foreach ($row as $field => $var) { switch ($field) { default: VIEW::assign("VALUE_" . strtoupper($field), $var); break; } } IMAGES::load('products_cate', $row["id"]); list($images) = IMAGES::$data; VIEW::assign(array("VALUE_LINK" => self::dataLink($row["parent"]), "VALUE_IMAGE" => $images["path"], "VALUE_ALT" => $images["alt"], "VALUE_TITLE" => $images["title"])); } SEO::output(); } else { if (!self::itemRow()) { VIEW::newBlock("TAG_NONE"); } } # SEO $cate_rsnum = CRUD::dataFetch('products_cate', array('id' => self::$cate)); if (!empty($cate_rsnum)) { list($cate_row) = CRUD::$data; SEO::load($cate_row["seo_id"]); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = $cate_row["subject"]; } SEO::output(); } CRUMBS::fetch('products', $cate_row); }
function __construct() { list($func, $id) = CORE::$args; $nav_class = 'BLOG'; switch ($func) { case "cate": $nav_func = "CATE"; self::$temp["MAIN"] = 'ogs-admin-blog-cate-list-tpl.html'; self::cate(); break; case "cate-add": $nav_func = "CATE"; self::$temp["MAIN"] = 'ogs-admin-blog-cate-insert-tpl.html'; self::$temp["SEO"] = self::$temp_option["SEO"]; CORE::res_init('tab', 'box'); self::cate_add(); break; case "cate-insert": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::cate_insert(); break; case "cate-detail": $nav_func = "CATE"; self::$temp["MAIN"] = 'ogs-admin-blog-cate-modify-tpl.html'; self::$temp["SEO"] = self::$temp_option["SEO"]; CORE::res_init('tab', 'box'); self::cate_detail($id); break; case "cate-modify": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::cate_modify(); break; case "cate-del": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::cate_delete($id); break; case "cate-multi": self::$temp["MAIN"] = self::$temp_option["MSG"]; parent::multi('blog_cate', CORE::$manage . 'blog/cate/'); break; case "add": self::$temp["MAIN"] = 'ogs-admin-blog-insert-tpl.html'; self::$temp["SEO"] = self::$temp_option["SEO"]; self::$temp["IMAGE"] = self::$temp_option["IMAGE"]; CORE::res_init('tab', 'box'); self::add(); break; case "insert": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::insert(); break; case "detail": self::$temp["MAIN"] = 'ogs-admin-blog-modify-tpl.html'; self::$temp["SEO"] = self::$temp_option["SEO"]; self::$temp["IMAGE"] = self::$temp_option["IMAGE"]; CORE::res_init('tab', 'box'); self::detail($id); break; case "modify": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::modify(); break; case "del": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::delete($id); break; case "multi": self::$temp["MAIN"] = self::$temp_option["MSG"]; parent::multi('blog', CORE::$manage . 'blog/'); break; default: self::$temp["MAIN"] = 'ogs-admin-blog-list-tpl.html'; self::row($func); break; } self::nav_current($nav_class, $nav_func); }
private static function cate_add() { CORE::res_init('get', 'box'); $rsnum = CRUD::dataFetch('products_cate', array("langtag" => CORE::$langtag)); CRUD::args_output(true, true); VIEW::assignGlobal(array("VALUE_SORT" => ++$rsnum, "VALUE_PARENT_OPTION" => self::cate_select())); }
function __construct() { self::$args = self::$origin_args; $func = array_shift(self::$args); switch ($func) { case "level": # 權限管理 CORE::res_init('get', 'box'); self::$temp["MAIN"] = 'ogs-admin-manager-level-tpl.html'; self::level(); break; case "level-modify": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::level_modify(); break; case "level-del": self::level_del(); break; case "add": # 新增管理員 self::$temp["MAIN"] = 'ogs-admin-manager-insert-tpl.html'; self::add(); break; case "insert": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::insert(); break; case "detail": # 管理員詳細 self::$temp["MAIN"] = 'ogs-admin-manager-detail-tpl.html'; self::detail(self::$args[0]); $func = false; break; case "modify": # 資料修改處理 self::$temp["MAIN"] = self::$temp_option["MSG"]; self::modify(); break; case "ban": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::ban(self::$args[0]); break; case "reverify": self::$temp["MAIN"] = 'ogs-admin-manager-reverify-tpl.html'; self::reverify(); break; case "reverify-act": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::reverify_act(); break; case "quick": self::$temp["MAIN"] = 'ogs-admin-manager-quick-tpl.html'; self::quick(); break; case "quick-insert": self::$temp["MAIN"] = self::$temp_option["MSG"]; self::quick_insert(); break; default: # 管理員列表 self::$temp["MAIN"] = 'ogs-admin-manager-list-tpl.html'; self::row(); break; } self::nav_current('MANAGER', $func); }
private static function row() { CORE::res_init('fix', 'css'); if (!empty(self::$cate)) { $rsnum = CRUD::dataFetch('blog', array('parent' => self::$cate, 'status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"]), false, true); } else { $rsnum = CRUD::dataFetch('blog', array('status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"]), false, true); } if (!empty($rsnum)) { #VIEW::newBlock("TAG_BLOG_BLOCK"); $dataRow = CRUD::$data; SCHEMA::make('blog_list', $dataRow); foreach ($dataRow as $key => $row) { VIEW::newBlock("TAG_BLOG_LIST"); foreach ($row as $field => $var) { switch ($field) { case "showdate": $varSec = strtotime($var); $month = date('M', $varSec); $day = date('jS', $varSec); $year = date('Y', $varSec); $dateStr = $month . ' ' . $day . ' , ' . $year; VIEW::assign("VALUE_" . strtoupper($field), $dateStr); break; case "content": $var = strip_tags($var); $maxLength = 100; $var = mb_strlen($var, 'UTF-8') > $maxLength ? mb_substr(strip_tags($var), 0, $maxLength, 'UTF-8') . '...' : $var; default: VIEW::assign("VALUE_" . strtoupper($field), $var); break; } } CRUD::dataFetch('blog_cate', array('id' => $row['parent'])); list($cate) = CRUD::$data; IMAGES::load('blog', $row["id"]); list($images) = IMAGES::$data; VIEW::assign(array("VALUE_LINK" => self::dataLink($row["parent"], $row), "VALUE_IMAGE" => $images["path"], "VALUE_ALT" => $images["alt"], "VALUE_TITLE" => $images["title"], "VALUE_PARENT" => $cate['subject'])); # 顯示評分星星數 if (!empty($row['score'])) { VIEW::newBlock('TAG_SCORE_BLOCK'); VIEW::assign('VALUE_SCORE', $row['score']); $score = 0; while (++$score <= $row['score']) { VIEW::newBlock('TAG_SCORE_STAR'); } } # 顯示瀏覽數 if (!empty($row['view_number']) || !empty($row['view_custom'])) { VIEW::newBlock('TAG_VIEW_BLOCK'); VIEW::assign('VALUE_VIEW_TOTAL', number_format($row['view_number'] + $row['view_custom'])); } } # SEO $cate_rsnum = CRUD::dataFetch('blog_cate', array('id' => self::$cate)); if (!empty($cate_rsnum)) { list($cate_row) = CRUD::$data; SEO::load($cate_row["seo_id"]); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = $cate_row["subject"]; } } else { SEO::load('blog'); if (empty(SEO::$data["h1"])) { SEO::$data["h1"] = CORE::$lang["blog"]; } } SEO::output(); CRUMBS::fetch('blog', $cate_row); } else { VIEW::newBlock("TAG_NONE"); } }