public function index() { //初始化数据 获取userid usercode if (isset($_COOKIE["klbweixinuserid"])) { $userid = $_COOKIE['klbweixinuserid']; if (!isset($_COOKIE['klbweixinusercode'])) { //通过userid去user的信息 $backArr = WEIXINURL::getuserinfobyuserid($userid); if ($backArr["errcode"] == "0" && $backArr["errmsg"] == "ok") { $usercode = $backArr["extattr"]["attrs"][0]["value"] != "" ? $backArr["extattr"]["attrs"][0]["value"] : "为空"; } else { echo "获取人员信息失败" . $backArr["errcode"] . $backArr["errmsg"]; exit; } } else { $usercode = $_COOKIE['klbweixinusercode']; } } else { exit; } $adminindexM = M('adminindex'); $mydata = $adminindexM->index($userid, $usercode); VIEW::assign(array('mydata' => $mydata)); VIEW::display('adminindex.html'); }
private static function row() { $rsnum = CRUD::dataFetch('feedback', false, false, array('createdate' => 'desc'), false, true); if (!empty($rsnum)) { VIEW::newBlock("TAG_FEEDBACK_BLOCK"); $data = CRUD::$data; foreach ($data as $key => $row) { VIEW::newBlock("TAG_FEEDBACK_LIST"); foreach ($row as $field => $var) { switch ($field) { case "gender": $gender = $var ? self::$lang['male'] : self::$lang['female']; $var = $gender; break; case "status": $status = $var ? self::$lang["status_on"] : self::$lang["status_off"]; if (empty($var)) { VIEW::assign("CLASS_STATUS_RED", 'red'); } $var = $status; break; } VIEW::assign("VALUE_" . strtoupper($field), $var); } VIEW::assign('VALUE_NUMBER', PAGE::$start + ++$i); } } else { VIEW::newBlock("TAG_NONE"); } }
function newsshow() { $data = M('news')->getnewsinfo(intval($_GET['id'])); $this->showabout(); VIEW::assign(array('data' => $data)); VIEW::display('index/show.html'); }
public function add() { $sid = intval($_GET['sid']); $sname = daddslashes($_GET['sname']); if (!isset($_SESSION['username']) || empty($_SESSION['username'])) { $this->showmessage('请登录后操作!', "index.php?controller=user&method=login"); } if (!isset($_POST['submit'])) { VIEW::assign(array('title' => "添加" . $sname . "旅游攻略", 'sid' => $sid)); VIEW::display("addstrategy.html"); } else { $strategy = daddslashes($_POST['strategy']); $impression = daddslashes($_POST['impression']); if (empty($strategy)) { $this->showmessage("请填写您的旅游攻略!", 'index.php?controller=strategy&method=add&sid=' . $sid . '&sname=' . $sname); } $username = $_SESSION['username']; $data = array('sid' => $sid, 'username' => $username, 'strategy' => $strategy, 'dateline' => time()); if (!empty($impression) && isset($impression)) { $data['impression'] = $impression; } $strategyobj = M('strategy'); $strategyobj->addStrategy($data); $this->showmessage('添加攻略成功!', 'index.php?controller=strategy&method=detail&sid=' . $sid . "&sname=" . $sname); } }
function __construct(REQUEST $req = NULL, $opts) { //$this->shelldisplay = false; parent::__construct($req, $opts); // Getting window interval //$this->window = $this->req->GetProp("window", false); // i.e. 1398891148-1400627534 }
public function add() { if (!isset($_SESSION['username'])) { $this->showmessage('请登录后操作!', 'index.php?controller=user&method=login'); } if (empty($_POST['submit']) || !isset($_POST['submit'])) { $sid = intval(daddslashes($_GET['sid'])); $sname = daddslashes($_GET['sname']); $team['sid'] = $sid; $team['sname'] = $sname; VIEW::assign(array('title' => "创建" . $sname . "旅游队伍", 'team' => $team)); VIEW::display('addTeam.html'); } else { $username = array(); $sid = intval(daddslashes($_POST['sid'])); $sname = daddslashes($_POST['sname']); $username[] = daddslashes($_SESSION['username']); $dateline = daddslashes($_POST['date']); $dateline = $this->getLeaveTime($dateline); $data = array('sid' => $sid, 'username' => $username, 'dateline' => $dateline); $teamobj = M('partner'); $teamobj->addTeam($data); $this->showmessage("创建队伍成功!", "index.php?controller=partner&method=detail&sid=" . $sid . "&sname=" . $sname); } }
public static function init($viewtype, $configArr) { self::$view = new $viewtype(); foreach ($configArr as $key => $value) { self::$view->{$key} = $value; } }
function __construct() { if (!CORE::$cfg['loadScreen']) { return false; } VIEW::assignGlobal(array('TAG_LOAD_SCREEN_CSS' => self::loadCss(), 'TAG_LOAD_SCREEN_HTML' => self::loadHtml(), 'TAG_LOAD_SCREEN_JS' => self::loadJs())); }
function __construct($func = false, $title = false, $custom = false) { self::$temp = CORE::$temp_main; self::$temp['MAIN'] = 'ogs-response-tpl.html'; $tplPath = CORE::$temp . self::$temp['MAIN']; file_put_contents($tplPath, SYSTEM::$setting['response']); switch ($func) { case "feedback": VIEW::assignGlobal(array('SEO_H1' => !empty($title) ? $title : '感謝您的評價')); break; case "contact": VIEW::assignGlobal(array('SEO_H1' => !empty($title) ? $title : '感謝您的留言')); break; } if (is_array($custom)) { VIEW::assignGlobal($custom); } $msg = SESS::get('msg'); if (empty($msg)) { header('location: ' . CORE::$root . $func . '/'); exit; } SESS::del('msg'); if (is_array($msg)) { $output['TAG_NAME'] = CORE::fetchName(array($msg['lastName'], $msg['firstName']), 'call', $msg['gender']); foreach ($msg as $field => $var) { $output['TAG_' . strtoupper($field)] = $var; } } else { $output['TAG_MSG'] = $msg; } VIEW::assignGlobal($output); CORE::common_resource(); new VIEW(CORE::$temp_option["HULL"], self::$temp, false, false); }
public static function row() { $args = !self::$cate ? array('status' => '1') : array('status' => '1', 'id' => self::$cate); $rsnum = CRUD::dataFetch('ad_cate', $args); if (!empty($rsnum)) { $dataRow = CRUD::$data; $nowDate = date("Y-m-d"); foreach ($dataRow as $key => $cate) { $rsnum = CRUD::dataFetch('ad', array('langtag' => CORE::$langtag, 'parent' => $cate["id"], 'custom' => "status = '1' or (status = '2' and startdate <= '{$nowDate}' and limitdate >= '{$nowDate}')")); if (!empty($rsnum)) { VIEW::newBlock("TAG_AD_BLOCK" . $cate["id"]); foreach (CRUD::$data as $key => $row) { VIEW::newBlock("TAG_AD_LIST" . $cate["id"]); foreach ($row as $field => $var) { switch ($field) { case "link": if (empty($var)) { $var = '#'; } default: VIEW::assign("VALUE_" . strtoupper($field), $var); break; } } IMAGES::load('ad', $row["id"]); list($images) = IMAGES::$data; VIEW::assign(array("VALUE_IMAGE" => $images["path"], "VALUE_ALT" => $images["alt"], "VALUE_TITLE" => $images["title"])); } } } } }
public static function gaLoad($gaCode = false) { if (!empty($gaCode)) { VIEW::assignGlobal('SYSTEM_GA', $gaCode); new VIEW('ogs-fn-ga-tpl.html', false, true); return VIEW::$output; } }
public function login() { if (!isset($_POST['submit'])) { VIEW::display('login.html'); } else { $this->checkLogin(); } }
function newsshow() { /* 显示文章详情控制层函数 */ $data = M('news')->getnewsinfo($_GET['id']); VIEW::assign(array('data' => $data)); /* 调用smarty函数 */ VIEW::display('index/newsshow.html'); }
function index() { $appinfo = $this->getappinfo(); $key = $this->getkeywords(); $contact = $this->getcontact(); // VIEW::assign(array('appinfo'=>$appinfo,'keywords'=>$key,'contact'=>$contact )); VIEW::display('appmanager/appmanager.html'); }
/** * 得到一条具体的留言信息 * @return */ public function message_detail() { $id = intval(safeString($_GET['id'])); $message_m = M('message'); $messageOne = $message_m->getMessageOne($id); VIEW::assign("messageOne", $messageOne); VIEW::display('message/message_detail.html'); }
public function register() { if (!isset($_POST['submit'])) { VIEW::assign(array("title" => "注册")); VIEW::display('register.html'); } else { $this->checkregister(); } }
/** * 实例化模板引擎 * @param string $viewtype 模板引擎类型 * @param array $config 模板引擎的配置信息,必须为关联数组 * @return [type] [description] */ public static function init($viewtype, $config) { self::$view = new $viewtype(); //此处为smartym模板引擎信息,格式为 //$smarty->left_delimiter='{<'; foreach ($config as $key => $value) { self::$view->{$key} = $value; } }
public function strategy() { $strategyobj = M('strategy'); $result = $strategyobj->listStrategy(); $qaobj = M('qa'); $data = $qaobj->getAllQAndA(); VIEW::assign(array("title" => "旅游攻略", "view" => "strategy", "data" => $data, "scene" => $result)); VIEW::display('strategy.html'); }
public function index() { //进入后就调用acctoken方法 确保 acctoken够新 --相当于人员进入登录的时候都会对accesstoken刷新一次 // 如果缓存有accesstoken 则取缓存 $acctokenModel = M("accesstoken"); $acctokenModel->getaccesstoken(); //优先判断进入方式 是否为auth2.0进入网页 if (isset($_GET["code"])) { //表示为auth2.0进入 通过code获得userid $backArr = WEIXINURL::getuseridbycode($_GET["code"]); if (isset($backArr['userid'])) { // 成功取得useid $userid = $backArr['userid']; } else { // 失败再次刷新地址 jumpurl($this->authurl); } //将userid存入cookie setcookie("klbweixinuserid", $userid, time() + 3600 * 24 * 7); } if (!isset($userid)) { //判断是否存在cookie if (isset($_COOKIE["klbweixinuserid"])) { $userid = $_COOKIE['klbweixinuserid']; } else { jumpurl($this->authurl); exit; } } //通过userid去user的信息 $backArr = WEIXINURL::getuserinfobyuserid($userid); if ($backArr["errcode"] == "0" && $backArr["errmsg"] == "ok") { $usercode = $backArr["extattr"]["attrs"][0]["value"] != "" ? $backArr["extattr"]["attrs"][0]["value"] : "为空"; VIEW::assign(array('username' => $backArr["name"], 'usercode' => $usercode, 'avatarimg' => $backArr["avatar"])); setcookie("klbweixinusername", $backArr["name"], time() + 3600 * 24 * 7); setcookie("klbweixinusercode", $usercode, time() + 3600 * 24 * 7); } else { echo "获取人员信息失败" . $backArr["errcode"] . $backArr["errmsg"]; exit; } //到此步已经确定具备userid //第一步是判断用户是否已经设置了密码 $authobj = M('auth'); if ($authobj->checkauth($userid, '') == "") { //空密码 //注册变量填充模版 VIEW::assign(array('visable' => '')); VIEW::assign(array('title' => '确认')); } else { //非空密码 VIEW::assign(array('visable' => ' uk-hidden ')); VIEW::assign(array('title' => '登录')); } setcookie("klbweixinusersessionid", session_id(), time() + 3600 * 24); VIEW::display('index.html'); }
public static function notFound() { CORE::common_resource(); SEO::load('nofound'); SEO::output(); VIEW::assignGlobal('SEO_H1', empty(SEO::$data['h1']) ? '404 not found' : SEO::$data['h1']); $temp = CORE::$temp_main; $temp["MAIN"] = 'ogs-fn-404-tpl.html'; new VIEW(CORE::$temp_option["HULL"], $temp, false, false); }
private static function news() { self::$rsnum[] = $rsnum = CRUD::dataFetch('news', array('langtag' => CORE::$langtag, 'status' => '1', 'custom' => "(subject like '%" . self::$kw . "%' or content like '%" . self::$kw . "%')")); if (!empty($rsnum)) { $dataRow = CRUD::$data; foreach ($dataRow as $key => $row) { VIEW::newBlock("TAG_SEARCH_LIST"); VIEW::assign(array("VALUE_SUBJECT" => $row["subject"], "VALUE_CONTENT" => mb_substr(strip_tags($row["content"]), 0, 50, 'UTF-8'), "VALUE_LINK" => NEWS::dataLink($row["parent"], $row))); } } }
private static function nav() { VIEW::assignGlobal("NAV_CATE_TITLE", 'ABOUT'); $rsnum = CRUD::dataFetch('intro', array('status' => '1', 'langtag' => CORE::$langtag), false, array('sort' => CORE::$cfg["sort"])); if (!empty($rsnum)) { $dataRow = CRUD::$data; foreach ($dataRow as $key => $row) { VIEW::newBlock("TAG_NAV_LIST"); VIEW::assign(array("VALUE_NAV_SUBJECT" => $row["subject"], "VALUE_NAV_LINK" => CORE::$root . 'intro/' . SEO::link($row) . '/', "VALUE_NAV_CURRENT" => empty(self::$id) && ++$i == 1 || self::$id == $row["id"] ? 'active' : '')); } } }
function __construct(REQUEST $req = NULL, $opts) { parent::__construct($req, $opts); $this->object = $this->req->GetProp("view_object", false); if ($this->object) { $this->max_points = $this->GetOption('max_points', 500); } else { $this->max_points = $this->GetOption('max_points', 5000); } $this->min_width = $this->GetOption('min_width', 300); $this->min_height = $this->GetOption('min_height', 300); }
public static function init($viewtype, $config) { self::$view = new $viewtype(); /*$smarty = new Smarty();//ʵ����smarty $smarty->left_delimiter=$config["left_delimiter"];//���� $smarty->right_delimiter=$config["right_delimiter"];//�Ҷ����� $smarty->template_dir=$config["template_dir"];//htmlģ���ĵ�ַ $smarty->compile_dir=$config["compile_dir"];//ģ���������ɵ��ļ� $smarty->cache_dir=$config["cache_dir"];//����*/ foreach ($config as $key => $value) { self::$view->{$key} = $value; } }
public static function output() { CHECK::is_array_exist(self::$data); if (CHECK::is_pass()) { SCHEMA::breadcrumb(self::$data); foreach (self::$data as $key => $args) { VIEW::newBlock("TAG_CRUMBS_LIST"); foreach ($args as $field => $var) { VIEW::assign("CRUMBS_" . strtoupper($field), $var); } } } }
public static function init($viewtype, $config) { self::$view = new $viewtype(); /*$smarty = new Smarty();//实例化smarty $smarty->left_delimiter=$config["left_delimiter"];//左定界符 $smarty->right_delimiter=$config["right_delimiter"];//右定界符 $smarty->template_dir=$config["template_dir"];//html模板的地址 $smarty->compile_dir=$config["compile_dir"];//模板编译生成的文件 $smarty->cache_dir=$config["cache_dir"];//缓存*/ foreach ($config as $key => $value) { self::$view->{$key} = $value; } }
public static function output($tb_name, $id, $setnum = 0, $tag = false, $tagRow = false) { $rsnum = IMAGES::load($tb_name, $id); # 指定數量 if (!empty($setnum)) { for ($i = 0; $i < $setnum; $i++) { $row = IMAGES::$data[$i]; if (!$tag) { $tag = 'IMAGES_BLOCK'; } if ($tagRow) { VIEW::newBlock($tag); } else { VIEW::newBlock($tag . $i); } if (is_array($row)) { foreach ($row as $field => $var) { VIEW::assign("IMAGES_" . strtoupper($field), $var); } } } return true; } # 自動偵測 switch ($rsnum) { case "0": return false; break; case "1": list($row) = IMAGES::$data; foreach ($row as $field => $var) { VIEW::assignGlobal("IMAGES_" . strtoupper($field), $var); } break; default: if (!$tag) { $tag = 'IMAGES_BLOCK'; } foreach (IMAGES::$data as $key => $row) { if ($tagRow) { VIEW::newBlock($tag); } else { VIEW::newBlock($tag . $key); } foreach ($row as $field => $var) { VIEW::assign("IMAGES_" . strtoupper($field), $var); } } break; } }
public function add() { if (empty($_SESSION['username']) || !isset($_SESSION['username'])) { $this->showmessage('请登录后操作!', "index.php?controller=user&method=login"); } elseif ($_SESSION['admin'] == 0) { $this->showmessage('权限不足!', "index.php?controller=index&method=scene"); } if (!isset($_POST['submit'])) { VIEW::assign(array("title" => "新增景点信息")); VIEW::display("addscene.html"); } else { $this->checkscene(); } }
function __construct(REQUEST $req = NULL, $opts) { //$this->shelldisplay = false; parent::__construct($req, $opts); $this->object = $this->req->GetProp("view_object", false); if ($this->object) { $this->max_points = $this->GetOption('max_points', 500); } else { $this->max_points = $this->GetOption('max_points', 5000); } $this->min_width = $this->GetOption('min_width', 300); $this->min_height = $this->GetOption('min_height', 300); $this->num_bins = $this->GetOption('bins', array(0)); }
public function web_base_info() { if (empty($_POST['submit'])) { $web_base_info_m = M('system'); $row = $web_base_info_m->fetchInfo(); VIEW::assign('web_name', $row['web_name']); VIEW::assign('web_extension', $row['web_extension']); VIEW::assign('content', $row['content']); VIEW::assign('web_logo', $row['web_logo']); VIEW::display('system/web_base_info.html'); } else { $this->addOrEdit(); } }