function pay_f() { $sn = $this->trans_lib->safe("sn"); $paycode = $this->trans_lib->safe("paycode"); $pass = $this->trans_lib->safe("pass"); if (!$paycode || !$sn) { error($this->lang["error"], $this->url("index")); } $rs = $this->payment_m->get_one_code($paycode); if (!$rs) { error($this->lang["order_not_payrs"], $this->url("index")); } $order_rs = $this->checkout_m->get_one_sn($sn); if (!$_SESSION["user_id"]) { if (!$pass || $pass != $order_rs["pass"]) { error($this->lang["order_not_popedom"], $this->url("index")); } } else { if ($_SESSION["user_id"] != $order_rs["uid"]) { error($this->lang["order_not_popedom"], $this->url("index")); } } $this->tpl->assign("order_rs", $order_rs); if ($order_rs["pay_status"]) { error($this->lang["order_status_pay_ok"], $this->url("index")); } $this->tpl->assign("rs", $rs); if ($rs["next_act"] && file_exists(APP . "control/" . $rs["next_act"] . ".php")) { sys_header($this->url($rs["next_act"], "sn=" . $sn . "&paycode=" . $paycode . "&pass="******"payment." . $this->tpl->ext); } }
function index_f() { $id = $this->trans_lib->int("id"); $ts = $this->trans_lib->safe("ts"); //增加分页 $pageid = $this->trans_lib->int(SYS_PAGEID); if ($pageid < 1) { $pageid = 1; } $this->tpl->assign("pageid", $pageid); if (!$id && !$ts) { error($this->lang["msg_not_id"], site_url("index")); } if ($id) { $rs = $this->msg_m->get_one($id, true, $pageid); } else { $rs = $this->msg_m->get_one_fromtype($ts, $_SESSION["sys_lang_id"], $pageid); } if (!$rs) { error($this->lang["msg_not_rs"], site_url("index")); } //判断阅读权限 $popedom = sys_user_popedom("read"); //获取阅读权限 if ($rs["cate_id"]) { if (!$popedom || !$popedom["category"] || $popedom != "all" && !in_array($rs["cate_id"], $popedom["category"])) { error($this->lang["not_popedom"], site_url("usercp")); } } else { if (!$popedom || !$popedom["module"] || $popedom != "all" && !in_array($rs["module_id"], $popedom["module"])) { error($this->lang["not_popedom"], site_url("usercp")); } } //判断如果语言包不一样,自动刷新一遍 if ($rs["langid"] != $_SESSION["sys_lang_id"]) { $_SESSION["sys_lang_id"] = $rs["langid"]; sys_header(site_url("msg", "id=" . $rs["id"])); } //如果存在分类 $this->subject = $rs["title"]; $this->load_module_msg($rs["module_id"]); if ($rs["cate_id"]) { $this->load_cate_msg($rs["cate_id"]); } $this->phpok_seo($rs); $id = $rs["id"]; $this->tpl->assign("id", $id); $this->tpl->assign("rs", $rs); $this->tpl->assign("cateid", $rs["cate_id"]); //读取自定义配置字段的数据信息 if ($rs["tplfile"]) { $this->tplfile = $rs["tplfile"]; } //更新点击率 $this->msg_m->update_hits($rs["id"]); $this->tpl->display($this->tplfile . "." . $this->tpl->ext); }
function index_f() { $sn = $this->trans_lib->safe("sn"); $paycode = "alipay"; $pass = $this->trans_lib->safe("pass"); $rs = $this->payment_m->get_one_code($paycode); if (!$rs) { error($this->lang["alipay_not_rs"], $this->url("checkout,info", "sn=" . $sn . "&pass="******"user_id"]) { if (!$pass || $pass != $order_rs["pass"]) { error($this->lang["alipay_not_popedom"], $this->url("index")); } } else { if ($_SESSION["user_id"] != $order_rs["uid"]) { error($this->lang["alipay_not_popedom"], $this->url("index")); } } $this->tpl->assign("order_rs", $order_rs); if ($order_rs["pay_status"]) { error($this->lang["alipay_paystatus_ok"], $this->url("checkout,info", "sn=" . $sn . "&pass="******"price"] < 0.001) { error($this->lang["alipay_free"], $this->url("checkout,info", "sn=" . $sn . "&pass="******"id"]); //判断是否是客 //加载alipay付款类 $return_url = $this->sys_config["siteurl"] . site_url("alipay,return", "sn=" . $sn . "&pass="******"pass"]); $show_url = $this->sys_config["siteurl"] . site_url("checkout,info", "sn=" . $sn . "&pass="******"pass"]); $notify_url = $this->sys_config["siteurl"] . site_url("alipay,notify", "sn=" . $sn . "&pass="******"pass"]); $order_rs["pdate"] = date("Y-m-d H:i:s", $order_rs["postdate"]); $parameter = array("service" => "create_direct_pay_by_user", "partner" => $f_rs["partner"], "return_url" => $return_url, "notify_url" => $notify_url, "_input_charset" => $f_rs["charset"], "subject" => sys_eval($this->lang["alipay_order_title"], $order_rs), "body" => sys_eval($this->lang["alipay_order_body"], $order_rs), "out_trade_no" => $order_rs["sn"], "total_fee" => floatval($order_rs["price"]), "payment_type" => "1", "seller_email" => $f_rs["seller_email"], "show_url" => $show_url); include_once LIBS . "payment/alipay_service.php"; //加载alipay_server操作类 $alipay = new alipay_service($parameter, $f_rs["code"], "MD5"); $link = $alipay->create_url(); sys_header($link); }
function index_f() { $id = $this->trans_lib->int("id"); $ts = $this->trans_lib->safe("ts"); if (!$id && !$ts) { error($this->lang["msg_not_id"], site_url("index")); } if ($id) { $rs = $this->msg_m->get_one($id); } else { $rs = $this->msg_m->get_one_fromtype($ts, $_SESSION["sys_lang_id"]); } if (!$rs) { error($this->lang["msg_not_rs"], site_url("index")); } //判断如果语言包不一样,自动刷新一遍 if ($rs["langid"] != $_SESSION["sys_lang_id"]) { $_SESSION["sys_lang_id"] = $rs["langid"]; sys_header(site_url("msg", "id=" . $rs["id"])); } //如果存在分类 $this->subject = $rs["title"]; $this->load_module_msg($rs["module_id"]); if ($rs["cate_id"]) { $this->load_cate_msg($rs["cate_id"]); } $this->phpok_seo($rs); $id = $rs["id"]; $this->tpl->assign("id", $id); $this->tpl->assign("rs", $rs); $this->tpl->assign("cateid", $rs["cate_id"]); //读取自定义配置字段的数据信息 if ($rs["tplfile"]) { $this->tplfile = $rs["tplfile"]; } //更新点击率 $this->msg_m->update_hits($rs["id"]); $this->tpl->display($this->tplfile . "." . $this->tpl->ext); }
function error($msg = "", $url = "", $time = 2) { $app = sys_init(); //哪果没有内容 if (!$msg && !$url) { exit("error: false"); } //如果没有内容提示,则直接跳转 if (!$msg) { sys_header($url); } //如果有内容提示跳转 $app->tpl->assign("msg", $msg); $app->tpl->assign("error_url", $url); if ($url) { $error_note = sys_eval($app->lang["error_note"], $time); $app->tpl->assign("error_note", $error_note); } $app->tpl->assign("time", $time); //毫秒级,在JS中应用 $app->tpl->assign("micro_time", $time * 1000); $app->tpl->display("error." . $app->tpl->ext); exit; }
function index_module($mid) { //判断权限 $popedom = sys_user_popedom("read"); //获取阅读权限 if (!$popedom || !$popedom["module"]) { error($this->lang["not_popedom"], site_url("usercp")); } if ($popedom != "all" && !in_array($mid, $popedom["module"])) { error($this->lang["not_popedom"], site_url("usercp")); } $rs = $this->module_m->get_one($mid); $this->tpl->assign("mid", $mid); $this->tpl->assign("m_rs", $rs); $this->phpok_seo($rs); $this->tplfile = "list_" . $rs["identifier"]; if (!$rs["status"]) { error($this->lang["module_is_close"], HOME_PAGE); } //判断是否有分类,且分类路至主题 if (!$rs["if_list"] && $rs["if_msg"]) { $msg_rs = $this->module_m->get_module_sub_one($mid); $header_url = msg_url($msg_rs); sys_header($header_url); } else { $list_rs = $this->module_m->get_module_cateid($mid); if ($list_rs) { $header_url = list_url($list_rs); sys_header($header_url); exit; } $sitetitle = $rs["title"]; $this->tpl->assign("sitetitle", $sitetitle); $leader[0] = array("title" => $rs["title"]); $this->tpl->assign("leader", $leader); //读取列表信息 $pageid = $this->trans_lib->int(SYS_PAGEID); $pageurl = module_url($rs, 0, true, false); //读取列表数据 $this->list_m->set_module($rs); $this->list_m->langid($_SESSION["sys_lang_id"]); $total = $this->list_m->get_count_from_cate(); //取得总数量 $this->tpl->assign("total", $total); $psize = $rs["psize"] ? $rs["psize"] : SYS_PSIZE; $offset = $pageid > 0 ? ($pageid - 1) * $psize : 0; $this->page_lib->set_psize($psize); $pagelist = $this->page_lib->page_www($pageurl, $total, true); //分页数组 $this->tpl->assign("pagelist", $pagelist); $rslist = $this->list_m->get_list_from_cate($offset, $psize); $this->tpl->assign("rslist", $rslist); $this->tpl->display("list_" . $rs["identifier"] . "." . $this->tpl->ext); } }
if ($APP->langconfig_m) { $_tmp_langid = $_SESSION["sys_lang_id"] ? $_SESSION["sys_lang_id"] : ""; $_tmp_rs = $APP->langconfig_m->get_one($_tmp_langid); if ($_tmp_rs) { $_SESSION["sys_lang_id"] = $_tmp_rs["langid"]; } else { $_SESSION["sys_lang_id"] = defined("SYS_LANG") ? SYS_LANG : "zh"; } //读取语言包数据,后台强制为中文 $_lang = $APP->langconfig_m->get_list("zh"); //$_lang = $APP->langconfig_m->get_list($_SESSION["sys_lang_id"]); } else { $_SESSION["sys_lang_id"] = defined("SYS_LANG") ? SYS_LANG : "zh"; $_lang = array(); } //指定语言包 $_lang = $APP->lang($_SESSION["sys_lang_id"], $_lang); $APP->langid = $_SESSION["sys_lang_id"]; //验证管理员 if (defined("SYS_IF_CHECKED") && SYS_IF_CHECKED == true) { if (!defined("SYS_CHECKED_SESSION_ID") || SYS_CHECKED_SESSION_ID == "" || !defined("SYS_CHECKED_FALSE") || SYS_CHECKED_FALSE == "") { exit("error: setting false."); } if (!$_SESSION[SYS_CHECKED_SESSION_ID] && $p_c != SYS_CHECKED_FALSE) { $url = $APP->url(SYS_CHECKED_FALSE); sys_header($url); } } $function_name = strtolower($p_f) . "_f"; unset($p_c, $p_f, $p_d, $control_file); $APP->{$function_name}();