当前位置: 首页>>代码示例>>PHP>>正文


PHP global_run函数代码示例

本文整理汇总了PHP中global_run函数的典型用法代码示例。如果您正苦于以下问题:PHP global_run函数的具体用法?PHP global_run怎么用?PHP global_run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了global_run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . "system_article" . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('system_article.html', $cache_id)) {
         $id = intval($_REQUEST['act']);
         if ($id == 0) {
             app_redirect(APP_ROOT . "/");
         }
         $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.id = " . $id . " and a.is_effect = 1 and a.is_delete = 0");
         if (!$article || $article['type_id'] != 3) {
             app_redirect(APP_ROOT . "/");
         }
         $GLOBALS['tmpl']->assign("article", $article);
         $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     }
     $GLOBALS['tmpl']->display("system_article.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:25,代码来源:sys_articleModule.class.php

示例2: index

 public function index()
 {
     global_run();
     $GLOBALS['tmpl']->caching = true;
     $GLOBALS['tmpl']->cache_lifetime = 600;
     //首页缓存10分钟
     $cache_id = md5(MODULE_NAME . ACTION_NAME . $GLOBALS['city']['id']);
     if (!$GLOBALS['tmpl']->is_cached('mall.html', $cache_id)) {
         init_app_page();
         //获取商城公告
         $notice_list = get_notice(0, array(0, 2));
         $GLOBALS['tmpl']->assign("notice_list", $notice_list);
         //输出首页推荐的分类
         $index_cates = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate where is_delete = 0 and is_effect = 1 and recommend = 1 and pid = 0 order by sort");
         foreach ($index_cates as $k => $v) {
             $index_cates[$k]['deal_cate_type_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "shop_cate  where pid = " . $v['id'] . " order by sort limit 8");
             require_once APP_ROOT_PATH . "system/model/deal.php";
             $deal_result = get_goods_list(8, array(DEAL_ONLINE, DEAL_NOTICE), array("city_id" => $GLOBALS['city']['id'], "cid" => $v['id']), "", " d.buy_type <> 1 and d.is_shop = 1 and d.is_recommend = 1 ");
             $index_cates[$k]['deal_list'] = $deal_result['list'];
         }
         $GLOBALS['tmpl']->assign("index_cates", $index_cates);
         $GLOBALS['tmpl']->assign("drop_nav", "no_drop");
         //首页下拉菜单不输出
         $GLOBALS['tmpl']->assign("wrap_type", "1");
         //首页宽屏展示
     }
     $GLOBALS['tmpl']->display("mall.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:28,代码来源:mallModule.class.php

示例3: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME);
     if (!$GLOBALS['tmpl']->is_cached('link_index.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['FRIEND_LINK'], 'url' => url("index", "acate"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $p_link_group = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link_group where is_effect = 1 order by sort desc");
         foreach ($p_link_group as $k => $v) {
             $g_links = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "link where is_effect = 1 and group_id = " . $v['id'] . " order by sort desc");
             if ($g_links) {
                 foreach ($g_links as $kk => $vv) {
                     if (substr($vv['url'], 0, 7) == 'http://') {
                         $g_links[$kk]['url'] = str_replace("http://", "", $vv['url']);
                     }
                 }
                 $p_link_group[$k]['links'] = $g_links;
             } else {
                 unset($p_link_group[$k]);
             }
         }
         $GLOBALS['tmpl']->assign("click_url", url('index', 'link#go'));
         $GLOBALS['tmpl']->assign("p_link_data", $p_link_group);
         $GLOBALS['tmpl']->assign("page_title", $GLOBALS['lang']['FRIEND_LINK']);
     }
     $GLOBALS['tmpl']->display("link_index.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:32,代码来源:linkModule.class.php

示例4: do_exchange

 public function do_exchange()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $result['status'] = 2;
         ajax_return($result);
     }
     $id = intval($_REQUEST['id']);
     $ecv_type = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ecv_type where id = " . $id);
     if (!$ecv_type) {
         showErr($GLOBALS['lang']['INVALID_VOUCHER'], 1);
     } else {
         $exchange_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "ecv where ecv_type_id = " . $id . " and user_id = " . intval($GLOBALS['user_info']['id']));
         if ($ecv_type['exchange_limit'] > 0 && $exchange_count >= $ecv_type['exchange_limit']) {
             $msg = sprintf($GLOBALS['lang']['EXCHANGE_VOUCHER_LIMIT'], $ecv_type['exchange_limit']);
             showErr($msg, 1);
         } elseif ($ecv_type['exchange_score'] > intval($GLOBALS['db']->getOne("select score from " . DB_PREFIX . "user where id = " . intval($GLOBALS['user_info']['id'])))) {
             showErr($GLOBALS['lang']['INSUFFCIENT_SCORE'], 1);
         } else {
             require_once APP_ROOT_PATH . "system/libs/voucher.php";
             $rs = send_voucher($ecv_type['id'], $GLOBALS['user_info']['id'], 1);
             if ($rs) {
                 require_once APP_ROOT_PATH . "system/model/user.php";
                 $msg = sprintf($GLOBALS['lang']['EXCHANGE_VOUCHER_USE_SCORE'], $ecv_type['name'], $ecv_type['exchange_score']);
                 modify_account(array('money' => 0, 'score' => "-" . $ecv_type['exchange_score']), $GLOBALS['user_info']['id'], $msg);
                 showSuccess($GLOBALS['lang']['EXCHANGE_SUCCESS'], 1);
             } else {
                 showSuccess($GLOBALS['lang']['EXCHANGE_FAILED'], 1, url('index', 'uc_voucher'));
             }
         }
     }
 }
开发者ID:macall,项目名称:jsd,代码行数:32,代码来源:uc_voucherModule.class.php

示例5: __construct

 public function __construct()
 {
     if (file_exists(APP_ROOT_PATH . "public/uc_config.php")) {
         require_once APP_ROOT_PATH . "public/uc_config.php";
     }
     if (app_conf("INTEGRATE_CODE") == 'Ucenter' && UC_CONNECT == 'mysql') {
         if (file_exists(APP_ROOT_PATH . "public/uc_data/creditsettings.php")) {
             require_once APP_ROOT_PATH . "public/uc_data/creditsettings.php";
             $this->creditsettings = $_CACHE['creditsettings'];
             if (count($this->creditsettings) > 0) {
                 foreach ($this->creditsettings as $k => $v) {
                     $this->creditsettings[$k]['srctitle'] = $this->credits_CFG[$v['creditsrc']]['title'];
                 }
                 $this->allow_exchange = true;
             }
         }
     }
     $GLOBALS['tmpl']->assign("allow_exchange", $this->allow_exchange);
     parent::__construct();
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     init_app_page();
 }
开发者ID:macall,项目名称:jsd,代码行数:25,代码来源:uc_logModule.class.php

示例6: biz_register

 public function biz_register()
 {
     global_run();
     $msg = $this->upload("biz_register", true);
     $msg['origin_img'] = $msg['url'];
     $msg['url'] = get_spec_image($msg['url'], 88, 75, 1);
     $msg['url_path'] = $msg['url'];
     ajax_return($msg);
 }
开发者ID:macall,项目名称:jsd,代码行数:9,代码来源:uploadModule.class.php

示例7: do_reply_dp

 public function do_reply_dp()
 {
     global_run();
     $s_account_info = $GLOBALS['account_info'];
     $account_id = intval($s_account_info['id']);
     $dp_id = intval($_REQUEST['dp_id']);
     $reply_content = strim($_REQUEST['reply_content']);
     require_once APP_ROOT_PATH . 'system/model/review.php';
     ajax_return(biz_do_reply_dp($account_id, $dp_id, $reply_content));
 }
开发者ID:macall,项目名称:jsd,代码行数:10,代码来源:eventrModule.class.php

示例8: send

 public function send()
 {
     global_run();
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         $data['status'] = 1000;
         ajax_return($data);
     } else {
         $t = strim($_REQUEST['t']);
         $id = intval($_REQUEST['id']);
         $youhui_log = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "youhui_log where id = " . $id . " and user_id = " . $GLOBALS['user_info']['id']);
         $youhui_info = load_auto_cache("youhui", array("id" => $youhui_log['youhui_id']));
         if ($youhui_log) {
             if ($youhui_log['confirm_time'] > 0) {
                 $data['status'] = 0;
                 $data['info'] = "优惠券已使用";
                 ajax_return($data);
             } elseif ($youhui_log['expire_time'] > 0 && $youhui_log['expire_time'] < NOW_TIME) {
                 $data['status'] = 0;
                 $data['info'] = "优惠券已过期";
                 ajax_return($data);
             } else {
                 if ($t == "sms") {
                     if (app_conf("SMS_ON") == 0 || $youhui_info['is_sms'] == 0) {
                         $data['status'] = 0;
                         $data['info'] = "不支持短信发送";
                         ajax_return($data);
                     } elseif ($youhui_log['sms_count'] >= app_conf("SMS_COUPON_LIMIT")) {
                         $data['status'] = 0;
                         $data['info'] = "短信发送已超过" . app_conf("SMS_COUPON_LIMIT") . "次";
                         ajax_return($data);
                     } elseif ($GLOBALS['user_info']['mobile'] == "") {
                         $data['status'] = 0;
                         $data['info'] = "请先设置手机号";
                         $data['jump'] = url("index", "uc_account");
                         ajax_return($data);
                     } else {
                         send_youhui_log_sms($id);
                         $GLOBALS['db']->query("update " . DB_PREFIX . "youhui_log set sms_count = sms_count + 1 where id = " . $id);
                         $data['status'] = 1;
                         $data['info'] = "短信成功发送到" . $GLOBALS['user_info']['mobile'] . ",请注意查收。";
                         ajax_return($data);
                     }
                 } else {
                     $data['status'] = 0;
                     $data['info'] = "非法操作";
                     ajax_return($data);
                 }
             }
         } else {
             $data['status'] = 0;
             $data['info'] = "优惠券不存在";
             ajax_return($data);
         }
     }
 }
开发者ID:macall,项目名称:jsd,代码行数:55,代码来源:uc_youhuiModule.class.php

示例9: submit

 public function submit()
 {
     global_run();
     $m_name = strim($_REQUEST['m_name']);
     $a_name = strim($_REQUEST['a_name']);
     $id = intval($_REQUEST['id']);
     $change = intval($_REQUEST['op_change']);
     $reason = strim($_REQUEST['reason']);
     $func = "op_" . $m_name . "_" . $a_name;
     $res = $this->{$func}($id, $change, $reason);
     ajax_return($res);
 }
开发者ID:macall,项目名称:jsd,代码行数:12,代码来源:opModule.class.php

示例10: callback

 public function callback()
 {
     global_run();
     require_once APP_ROOT_PATH . "system/api_login/qqv2/qqConnectAPI.php";
     $qc = new QC();
     $access_token = $qc->qq_callback();
     $openid = $qc->get_openid();
     $use_info_keysArr = array("access_token" => $access_token, "openid" => $openid, "oauth_consumer_key" => $this->api['config']['app_key']);
     $use_info_url = "https://graph.qq.com/user/get_user_info";
     $graph_use_info_url = $qc->urlUtils->combineURL($use_info_url, $use_info_keysArr);
     $response = $qc->urlUtils->get_contents($graph_use_info_url);
     if ($response['ret'] != 0) {
         showErr("授权失败,错误信息:" . $response['msg']);
         die;
     }
     $response = json_decode($response, 1);
     $msg['field'] = 'qqv2_id';
     $msg['id'] = $openid;
     $msg['name'] = $response["nickname"];
     es_session::set("api_user_info", $msg);
     $user_data = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where qqv2_id = '" . $openid . "' and qqv2_id <> '' and is_effect=1 and is_delete=0");
     $is_bind = intval(es_session::get("is_bind"));
     if ($user_data) {
         $GLOBALS['db']->query("update " . DB_PREFIX . "user set qq_token = '" . $access_token . "',login_ip = '" . CLIENT_IP . "',login_time= " . NOW_TIME . " where id =" . $user_data['id']);
         es_session::delete("api_user_info");
         if ($is_bind) {
             if (intval($user_data['id']) != intval($GLOBALS['user_info']['id'])) {
                 showErr("该帐号已经被别的会员绑定过,请直接用帐号登录", 0, url("index", "uc_account"));
             } else {
                 require_once APP_ROOT_PATH . "system/model/user.php";
                 load_user($user_data['id'], true);
                 es_session::set("user_info", $user_data);
                 app_redirect(url("index", "uc_account"));
             }
         } else {
             require_once APP_ROOT_PATH . "system/model/user.php";
             auto_do_login_user($user_data['user_name'], $user_data['user_pwd'], $from_cookie = false);
             app_redirect(url("index", "index"));
         }
     } elseif ($is_bind == 1 && $GLOBALS['user_info']) {
         //当有用户身份且要求绑定时
         $GLOBALS['db']->query("update " . DB_PREFIX . "user set qqv2_id= '" . $msg['id'] . "', qq_token ='" . $access_token . "' where id =" . $GLOBALS['user_info']['id']);
         require_once APP_ROOT_PATH . "system/model/user.php";
         load_user($GLOBALS['user_info']['id'], true);
         app_redirect(url("index", "uc_account"));
     } else {
         $user_info = $this->create_user();
         require_once APP_ROOT_PATH . "system/model/user.php";
         auto_do_login_user($user_info['user_name'], $user_info['user_pwd'], $from_cookie = false);
         app_redirect(url("index", "index"));
     }
 }
开发者ID:macall,项目名称:jsd,代码行数:52,代码来源:Qqv2_api.php

示例11: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     if (check_save_login() != LOGIN_STATUS_LOGINED) {
         app_redirect(url("index", "user#login"));
     }
     $GLOBALS['tmpl']->assign("page_title", "我的点评");
     assign_uc_nav_list();
     //begin review
     require_once APP_ROOT_PATH . "system/model/review.php";
     require_once APP_ROOT_PATH . "app/Lib/page.php";
     //分页
     $page_size = 10;
     $page = intval($_REQUEST['p']);
     if ($page == 0) {
         $page = 1;
     }
     $limit = ($page - 1) * $page_size . "," . $page_size;
     $dp_res = get_dp_list($limit, "", " user_id = " . $GLOBALS['user_info']['id']);
     $dp_list = $dp_res['list'];
     $total = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "supplier_location_dp  where " . $dp_res['condition']);
     $page = new Page($total, $page_size);
     //初始化分页对象
     $p = $page->show();
     $GLOBALS['tmpl']->assign('pages', $p);
     foreach ($dp_list as $k => $v) {
         if ($v['deal_id'] > 0) {
             $data_info = load_auto_cache("deal", array("id" => $v['deal_id']));
         } elseif ($v['youhui_id'] > 0) {
             $data_info = load_auto_cache("youhui", array("id" => $v['youhui_id']));
         } elseif ($v['event_id'] > 0) {
             $data_info = load_auto_cache("event", array("id" => $v['event_id']));
         }
         if (empty($data_info)) {
             $data_info = load_auto_cache("store", array("id" => $v['supplier_location_id']));
         }
         $dp_list[$k]['data_info'] = $data_info;
     }
     $GLOBALS['tmpl']->assign('dp_list', $dp_list);
     require_once APP_ROOT_PATH . "system/model/topic.php";
     global $no_lazy;
     $no_lazy = true;
     $review_html = decode_topic_without_img($GLOBALS['tmpl']->fetch("inc/uc_review_list.html"));
     $GLOBALS['tmpl']->assign("review_html", $review_html);
     //end review
     $no_lazy = false;
     $GLOBALS['tmpl']->display("uc/uc_review_index.html");
 }
开发者ID:macall,项目名称:jsd,代码行数:51,代码来源:uc_reviewModule.class.php

示例12: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('notice_list.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $id = intval($_REQUEST['act']);
         $cate_item = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "article_cate where id = " . $id . " and is_effect = 1 and is_delete = 0");
         if ($id > 0 && !$cate_item) {
             app_redirect(APP_ROOT . "/");
         } elseif ($cate_item && $cate_item['type_id'] != 2) {
             if ($cate_item['type_id'] == 1) {
                 app_redirect(url("index", "help"));
             }
             if ($cate_item['type_id'] == 0) {
                 app_redirect(url("index", "acate"));
             }
             if ($cate_item['type_id'] == 3) {
                 app_redirect(APP_ROOT . "/");
             }
         }
         $cate_id = intval($cate_item['id']);
         $cate_tree = get_acate_tree('', 2, "news");
         $GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
         //分页
         $page = intval($_REQUEST['p']);
         if ($page <= 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_article_list($limit, $cate_id, 'ac.type_id = 2', '', false);
         $GLOBALS['tmpl']->assign("list", $result['list']);
         $page = new Page($result['count'], app_conf("PAGE_SIZE"));
         //初始化分页对象
         $p = $page->show();
         $GLOBALS['tmpl']->assign('pages', $p);
         $GLOBALS['tmpl']->assign("cur_id", $cate_id);
         $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']);
         $GLOBALS['tmpl']->assign("page_title", $cate_item['title']);
         $GLOBALS['tmpl']->assign("page_keyword", $cate_item['title'] . ",");
         $GLOBALS['tmpl']->assign("page_description", $cate_item['title'] . ",");
     }
     $GLOBALS['tmpl']->display("notice_list.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:50,代码来源:newsModule.class.php

示例13: upload

 /**
  * 通用上传,上传到attachments目录,按日期划分
  * 错误返回 error!=0,message错误消息, error=1000表示未登录
  * 正确时返回 error=0, url: ./public格式的文件相对路径  path:物理路径 name:文件名
  */
 public function upload()
 {
     global_run();
     if (empty($GLOBALS['account_info'])) {
         $data['error'] = 1000;
         //未登录
         $data['msg'] = $GLOBALS['lang']['PLEASE_LOGIN_FIRST'];
         ajax_return($data);
     }
     //上传处理
     //创建comment目录
     if (!is_dir(APP_ROOT_PATH . "public/attachment")) {
         @mkdir(APP_ROOT_PATH . "public/attachment");
         @chmod(APP_ROOT_PATH . "public/attachment", 0777);
     }
     $dir = to_date(NOW_TIME, "Ym");
     if (!is_dir(APP_ROOT_PATH . "public/attachment/" . $dir)) {
         @mkdir(APP_ROOT_PATH . "public/attachment/" . $dir);
         @chmod(APP_ROOT_PATH . "public/attachment/" . $dir, 0777);
     }
     $dir = $dir . "/" . to_date(NOW_TIME, "d");
     if (!is_dir(APP_ROOT_PATH . "public/attachment/" . $dir)) {
         @mkdir(APP_ROOT_PATH . "public/attachment/" . $dir);
         @chmod(APP_ROOT_PATH . "public/attachment/" . $dir, 0777);
     }
     $dir = $dir . "/" . to_date(NOW_TIME, "H");
     if (!is_dir(APP_ROOT_PATH . "public/attachment/" . $dir)) {
         @mkdir(APP_ROOT_PATH . "public/attachment/" . $dir);
         @chmod(APP_ROOT_PATH . "public/attachment/" . $dir, 0777);
     }
     if (app_conf("IS_WATER_MARK") == 1) {
         $img_result = save_image_upload($_FILES, "file", "attachment/" . $dir, $whs = array(), 1, 1);
     } else {
         $img_result = save_image_upload($_FILES, "file", "attachment/" . $dir, $whs = array(), 0, 1);
     }
     if (intval($img_result['error']) != 0) {
         ajax_return($img_result);
     } else {
         if ($GLOBALS['distribution_cfg']['OSS_TYPE'] && $GLOBALS['distribution_cfg']['OSS_TYPE'] != 'NONE') {
             syn_to_remote_image_server($img_result['file']['url']);
         }
     }
     $data_result['error'] = 0;
     $data_result['url'] = $img_result['file']['url'];
     $data_result['web_40'] = get_spec_image($data_result['url'], 40, 40, 1);
     $data_result['path'] = $img_result['file']['path'];
     $data_result['name'] = $img_result['file']['name'];
     ajax_return($data_result);
 }
开发者ID:macall,项目名称:jsd,代码行数:54,代码来源:fileModule.class.php

示例14: jump

 /**
  * 智能跳转
  * 用于热门关键词的智能检索,优先搜团购->商品->优惠券->活动->商家->分享,如都没有提示没有相关数据
  */
 public function jump()
 {
     $kw = strim($_REQUEST['kw']);
     if ($kw) {
         $param['kw'] = $kw;
         $condition_param['city_id'] = $GLOBALS['city']['id'];
         global_run();
         //先验证团购
         require_once APP_ROOT_PATH . "system/model/deal.php";
         $ext_condition = "  d.buy_type <> 1 and d.is_shop = 0 ";
         $ext_condition .= " and d.name like '%" . $kw . "%' ";
         if (get_deal_count(array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition)) {
             app_redirect(url("index", "tuan", $param));
         } else {
             //商品
             $ext_condition = "  d.buy_type <> 1 and d.is_shop = 1 ";
             $ext_condition .= " and d.name like '%" . $kw . "%' ";
             if (get_goods_count(array(DEAL_ONLINE, DEAL_NOTICE), $condition_param, "", $ext_condition)) {
                 app_redirect(url("index", "cate", $param));
             } else {
                 //优惠券
                 require_once APP_ROOT_PATH . "system/model/youhui.php";
                 $ext_condition = " y.name like '%" . $kw . "%' ";
                 if (get_youhui_count(array(YOUHUI_NOTICE, YOUHUI_ONLINE), $condition_param, "", $ext_condition)) {
                     app_redirect(url("index", "youhuis", $param));
                 } else {
                     //活动
                     require_once APP_ROOT_PATH . "system/model/event.php";
                     $ext_condition = " e.name like '%" . $kw . "%' ";
                     if (get_event_count(array(EVENT_NOTICE, EVENT_ONLINE), $condition_param, "", $ext_condition)) {
                         app_redirect(url("index", "events", $param));
                     } else {
                         //商家
                         require_once APP_ROOT_PATH . "system/model/supplier.php";
                         $ext_condition = " sl.name like '%" . $kw . "%' ";
                         $rs = get_location_list(1, $condition_param, "", $ext_condition);
                         if ($rs['list']) {
                             app_redirect(url("index", "stores", $param));
                         } else {
                             app_redirect(url("index", "discover", $param));
                         }
                     }
                 }
             }
         }
     } else {
         app_redirect(url("index"));
     }
 }
开发者ID:macall,项目名称:jsd,代码行数:53,代码来源:searchModule.class.php

示例15: index

 public function index()
 {
     global_run();
     init_app_page();
     $GLOBALS['tmpl']->assign("no_nav", true);
     //无分类下拉
     $GLOBALS['tmpl']->caching = true;
     $cache_id = md5(MODULE_NAME . ACTION_NAME . trim($_REQUEST['act']));
     if (!$GLOBALS['tmpl']->is_cached('notice_index.html', $cache_id)) {
         $site_nav[] = array('name' => $GLOBALS['lang']['HOME_PAGE'], 'url' => url("index", "index"));
         $site_nav[] = array('name' => $GLOBALS['lang']['SITE_NOTICE_LIST'], 'url' => url("index", "news"));
         $GLOBALS['tmpl']->assign("site_nav", $site_nav);
         $id = intval($_REQUEST['act']);
         if ($id == 0) {
             app_redirect(url("index", "news"));
         }
         $article = $GLOBALS['db']->getRow("select a.*,ac.type_id from " . DB_PREFIX . "article as a left join " . DB_PREFIX . "article_cate as ac on a.cate_id = ac.id where a.id = " . $id . " and a.is_effect = 1 and a.is_delete = 0");
         $cate_tree = get_acate_tree('', 2, "news");
         $GLOBALS['tmpl']->assign("acate_tree", $cate_tree);
         if (!$article || $article['type_id'] != 2) {
             app_redirect(APP_ROOT . "/");
         } else {
             if ($article['rel_url'] != '') {
                 if (!preg_match("/http:\\/\\//i", $article['rel_url'])) {
                     if (substr($article['rel_url'], 0, 2) == 'u:') {
                         app_redirect(parse_url_tag($article['rel_url']));
                     } else {
                         app_redirect(APP_ROOT . "/" . $article['rel_url']);
                     }
                 } else {
                     app_redirect($article['rel_url']);
                 }
             }
         }
         $GLOBALS['tmpl']->assign("article", $article);
         $GLOBALS['tmpl']->assign("cur_id", $article['cate_id']);
         $GLOBALS['tmpl']->assign("cur_title", $GLOBALS['lang']['SITE_NOTICE_LIST']);
         $seo_title = $article['seo_title'] != '' ? $article['seo_title'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_title", $seo_title);
         $seo_keyword = $article['seo_keyword'] != '' ? $article['seo_keyword'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_keyword", $seo_keyword . ",");
         $seo_description = $article['seo_description'] != '' ? $article['seo_description'] : $article['title'];
         $GLOBALS['tmpl']->assign("page_description", $seo_description . ",");
     }
     $GLOBALS['tmpl']->display("notice_index.html", $cache_id);
 }
开发者ID:macall,项目名称:jsd,代码行数:46,代码来源:noticeModule.class.php


注:本文中的global_run函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。