Exemple #1
0
 function _list()
 {
     global $_G;
     $url = 'm=shop&a=list';
     $and = '';
     $size = 10;
     seo('品牌店铺 - 合作商家');
     if ($_GET['cate']) {
         $cateid = intval($_GET[cate]);
         $cate = $_G['shop_cate'][$cateid];
         $and .= " AND cate = " . $cateid;
         $url .= "&cate=" . $cateid;
         if ($cate['page'] > 0) {
             $size = intval($cate['page']);
         }
         if ($cate['title']) {
             seo($cate[title], $cate[keywords], $cate[description]);
         } else {
             seo($cate['name'] . ' - 品牌店铺', $cate[keywords], $cate[description]);
         }
     }
     if (isset($_GET['shop_type'])) {
         $shop_type = intval($_GET[shop_type]);
         $and .= " AND shop_type = " . $shop_type;
         $url .= "&shop_type=" . $shop_type;
     }
     $and .= " AND start_time < " . TIMESTAMP;
     $and .= " AND ( end_time = 0 or  end_time > " . TIMESTAMP . ")";
     $rs = D(array('table' => 'shop', 'and' => $and . ' AND `hide` = 0', 'order' => ' `sort` DESC,id DESC  ', 'key' => ''), array('size' => $size, 'url' => $url));
     $this->add($rs);
     $this->show();
 }
Exemple #2
0
	 /**
	 *	申请友情链接 
	 */
	public function register() { 
 		$siteid = SITEID;
 		if(isset($_POST['dosubmit'])){
 			if($_POST['name']==""){
 				showmessage(L('sitename_noempty'),"?m=link&c=index&a=register&siteid=$siteid");
 			}
 			if($_POST['url']==""){
 				showmessage(L('siteurl_not_empty'),"?m=link&c=index&a=register&siteid=$siteid");
 			}
 			if(!in_array($_POST['linktype'],array('0','1'))){
 				$_POST['linktype'] = '0';
 			}
 			$link_db = pc_base::load_model(link_model);
 			$_POST['logo'] =new_html_special_chars($_POST['logo']);
 			
 			if($_POST['linktype']=='0'){
 				$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url']);
 			}else{
 				$sql = array('siteid'=>$siteid,'typeid'=>$_POST['typeid'],'linktype'=>$_POST['linktype'],'name'=>$_POST['name'],'url'=>$_POST['url'],'logo'=>$_POST['logo']);
 			}
 			$link_db->insert($sql);
 			showmessage(L('add_success'), "?m=link&c=index&siteid=$siteid");
 		} else {
  			$setting = getcache('link', 'commons');
			$setting = $setting[$siteid];
 			if($setting['is_post']=='0'){
 				showmessage(L('suspend_application'), HTTP_REFERER);
 			}
 			$this->type = pc_base::load_model('type_model');
 			$types = $this->type->get_types($siteid);//获取站点下所有友情链接分类
 			pc_base::load_sys_class('form', '', 0);
  			$SEO = seo(SITEID, '', L('application_links'), '', '');
   			include template('link', 'register');
 		}
	} 
 function _list()
 {
     global $_G;
     $id = intval($_GET['id']);
     $and = '';
     $url = URL . "m=article&a=list";
     if ($id > 0) {
         foreach ($_G[setting][article_tag] as $k => $v) {
             if ($k == $id) {
                 $tag = $v;
             }
         }
         if (!$tag) {
             showmessage('未找到分类');
             return false;
         }
         $and .= " AND tag = " . $id;
         $url .= "&id=" . $id;
     }
     $rs = D(array('and' => $and . ' AND `hide` = 0 ', 'table' => 'article', 'order' => '`sort` DESC,`id` DESC'), array('size' => 10, 'url' => $url));
     foreach ($rs[goods] as $k => $v) {
         $rs[goods][$k][message] = trim_html($v[message], 1);
     }
     $this->add(array('tag' => $tag));
     $this->add($rs);
     seo('文章列表' . ' - ' . $_G['setting'][title]);
     $this->show();
 }
Exemple #4
0
 /**
  * 申请友情链接
  */
 public function register()
 {
     if (isset($_POST['dosubmit'])) {
         if ($_POST['name'] == "") {
             showmessage(L('sitename_noempty'), U('link/index/register'));
         }
         if ($_POST['url'] == "") {
             showmessage(L('siteurl_not_empty'), U('link/index/register'));
         }
         if (!in_array($_POST['linktype'], array('0', '1'))) {
             $_POST['linktype'] = '0';
         }
         $link_db = Loader::model('link_model');
         $_POST['logo'] = String::htmlspecialchars($_POST['logo']);
         if ($_POST['linktype'] == '0') {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url']);
         } else {
             $sql = array('typeid' => $_POST['typeid'], 'linktype' => $_POST['linktype'], 'name' => $_POST['name'], 'url' => $_POST['url'], 'logo' => $_POST['logo']);
         }
         $link_db->insert($sql);
         showmessage(L('add_success'), U('link/index'));
     } else {
         $setting = S('common/link');
         if (isset($setting['is_post']) && $setting['is_post'] == '0') {
             showmessage(L('suspend_application'), HTTP_REFERER);
         }
         $this->type = Loader::model('type_model');
         $types = $this->type->get_types();
         // 获取站点下所有友情链接分类
         $SEO = seo('', L('application_links'), '', '');
         include template('link', 'register');
     }
 }
Exemple #5
0
 /**
  * 按照模型搜索
  */
 public function lists()
 {
     $tag = safe_replace(addslashes($_GET['tag']));
     $keyword_data_db = pc_base::load_model('keyword_data_model');
     //获取标签id
     $r = $this->keyword_db->get_one(array('keyword' => $tag, 'siteid' => $this->siteid), 'id');
     if (!$r['id']) {
         showmessage('不存在此关键字!');
     }
     $tagid = intval($r['id']);
     $page = max($_GET['page'], 1);
     $pagesize = 20;
     $where = '`tagid`=\'' . $tagid . '\' AND `siteid`=' . $this->siteid;
     $infos = $keyword_data_db->listinfo($where, '`id` DESC', $page, $pagesize);
     $pages = $keyword_data_db->pages;
     $total = $keyword_data_db->number;
     if (is_array($infos)) {
         $datas = array();
         foreach ($infos as $info) {
             list($contentid, $modelid) = explode('-', $info['contentid']);
             $this->db->set_model($modelid);
             $res = $this->db->get_one(array('id' => $contentid), 'title, description, url, inputtime, style');
             $res['title'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['title']);
             $res['description'] = str_replace($tag, '<font color="#f00">' . $tag . '</font>', $res['description']);
             $datas[] = $res;
         }
     }
     $SEO = seo($siteid, '', $tag);
     include template('content', 'tag_list');
 }
 public function __construct()
 {
     if (is_mobile_request()) {
         $params = $_GET;
         $this->redirect('Mobile/' . CONTROLLER_NAME . '/' . ACTION_NAME, $params);
     }
     parent::__construct();
     $this->assign('controller', CONTROLLER_NAME);
     //读取配置信息
     $web_stting = F('setting');
     if ($web_stting === false) {
         $params = array();
         $list = M('Setting')->getField('name,value');
         foreach ($list as $key => $val) {
             $params[$key] = unserialize($val) ? unserialize($val) : $val;
         }
         F('setting', $params);
         $web_stting = F('setting');
     }
     $this->assign('web_stting', $web_stting);
     //站点状态判断
     if ($web_stting['site_status'] != 1) {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
         echo $web_stting['closed_reason'];
         exit;
     } else {
         $link = M('Link')->where(array('status' => 1))->order('sort desc')->select();
         $this->assign('seo', seo());
         $this->assign('link', $link);
     }
 }
 public function __construct()
 {
     parent::__construct();
     //读取配置信息
     $web_stting = F('setting');
     if ($web_stting === false) {
         $params = array();
         $list = M('Setting')->getField('name,value');
         foreach ($list as $key => $val) {
             $params[$key] = unserialize($val) ? unserialize($val) : $val;
         }
         F('setting', $params);
         $web_stting = F('setting');
     }
     $this->assign('web_stting', $web_stting);
     //站点状态判断
     if ($web_stting['site_status'] != 1) {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
         echo $web_stting['closed_reason'];
         exit;
     } else {
         $this->check_login();
         $link = M('Link')->where(array('status' => 1))->order('sort DESC')->select();
         $this->assign('link', $link);
         $this->assign('seo', seo());
     }
 }
 public function index()
 {
     //URL规则
     $urlrules = F('urlrules');
     $where = array();
     if (isset($_GET['tagid'])) {
         $where['tagid'] = array("EQ", (int) $this->_get("tagid"));
         $r = M("Tags")->where($where)->find();
         $where['tag'] = $r['tag'];
         unset($where['tagid']);
     } else {
         $where['tag'] = array("EQ", $this->_get("tag"));
     }
     $data = M("Tags")->where($where)->find();
     if (!$data) {
         $this->error("该Tag不存在!");
     }
     $this->assign($data);
     M("Tags")->where($where)->setInc("hits");
     M("Tags")->where($where)->save(array("lasthittime" => time()));
     $page = $this->_get(C("VAR_PAGE"));
     $this->assign("page", $page);
     $urlrules = $urlrules[CONFIG_TAGURL];
     define('URLRULE', str_replace('|', '~', str_replace(array('{$tag}', '{$tagid}'), array($this->_get('tag'), (int) $this->_get("tagid")), $urlrules)));
     $SEO = seo();
     //seo分配到模板
     $this->assign("SEO", $SEO);
     //把分页分配到模板
     $this->assign(C("VAR_PAGE"), $page);
     $this->display("Tags:tag");
 }
 public function __construct()
 {
     parent::__construct();
     $this->assign('controller', CONTROLLER_NAME);
     //读取配置信息
     $web_stting = F('setting');
     if ($web_stting === false) {
         $params = array();
         $list = M('Setting')->getField('name,value');
         foreach ($list as $key => $val) {
             $params[$key] = unserialize($val) ? unserialize($val) : $val;
         }
         F('setting', $params);
         $web_stting = F('setting');
     }
     $this->web_stting = $web_stting;
     //站点状态判断
     if ($this->web_stting['site_status'] != 1) {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
         echo $this->web_stting['closed_reason'];
         exit;
     } else {
         $this->assign('seo', seo());
     }
     //检查登录
     /* session('member_id',null);
     		if(!session('member_id'))
     		{
     			$this->wx_auto_login(); //自动登录	
     		}
     		$this->mid = session('member_id'); */
     $this->mid = 10;
     $this->m_info = M('Member')->where('member_id=' . $this->mid)->find();
 }
 public function index()
 {
     //编号,也就是下载第几个链接,有的是多文件下载用的!
     $k = I('get.k', 0, 'intval');
     //字段名称
     $f = I('get.f', '');
     if (empty($this->id) || empty($this->catid) || empty($f)) {
         $this->error("参数有误!");
     }
     //模型ID
     $modelid = getCategory($this->catid, 'modelid');
     $ModelField = cache('ModelField');
     $Model_field = $ModelField[$modelid];
     //判断字段类型
     if (!in_array($Model_field[$f]['formtype'], array('downfiles', 'downfile'))) {
         $this->error('下载地址错误!');
     }
     $this->db = \Content\Model\ContentModel::getInstance($modelid);
     $data = $this->db->relation(true)->where(array("id" => $this->id, 'status' => 99))->find();
     if (empty($data)) {
         $this->error("该信息不存在!");
     }
     $this->db->dataMerger($data);
     if (!empty($data)) {
         //取得下载字段信息
         $downfiles = $data[$f];
         $dowUnserialize = unserialize($downfiles);
         if ($dowUnserialize) {
             $info = $dowUnserialize[$k];
             if (empty($info)) {
                 $this->error("该下载地址已经失效!");
             }
         } else {
             $info = array();
             $info['filename'] = basename($downfiles);
             $info['point'] = 0;
             $info['groupid'] = 0;
         }
         //当前客户端标识
         $aut = md5($this->userid . $this->groupid . substr($_SERVER['HTTP_USER_AGENT'], 0, 254));
         //加密
         //格式:aut|栏目ID|信息id|下载编号|字段
         $key = \Libs\Util\Encrypt::authcode(implode('|', array($aut, $this->catid, $this->id, $k, $f)), '', '', 3600);
         $this->assign("info", $data);
         $this->assign("fileurl", U("Download/d", array('key' => urlencode($key))));
         $this->assign("filename", $info['filename']);
         $this->assign("point", $info['point']);
         $this->assign("groupid", $info['groupid']);
         $this->assign("Member_group", cache("Member_group"));
         $this->assign("SEO", seo($this->catid, urldecode($info['filename']), '', ''));
         $this->display("Public:download");
     } else {
         $this->error("该信息不存在!");
     }
 }
 public function index()
 {
     $where = array();
     $catid = I('get.catid', 0, 'intval');
     $rssid = I('get.rssid', 0, 'intval');
     if ($rssid) {
         header("Content-Type: text/xml; charset=" . C("DEFAULT_CHARSET"));
         //检测缓存
         $data = S("Rss_{$rssid}");
         if ($data) {
             echo $data;
             exit;
         }
         $Cat = getCategory($rssid);
         //检查栏目是否存在
         if (empty($Cat)) {
             $this->error('该栏目不存在!');
         }
         //检查栏目类型
         if ($Cat['type'] != 0) {
             $this->error('栏目类型不正确!');
         }
         $where['status'] = array("EQ", 99);
         //判断是否有子栏目
         if (getCategory($rssid, 'child')) {
             $where['catid'] = array("IN", getCategory($rssid, 'arrchildid'));
         } else {
             $where['catid'] = array("EQ", $rssid);
         }
         //模型ID
         $modelid = getCategory($rssid, 'modelid');
         //获取表名
         $tablename = ucwords(getModel($modelid, 'tablename'));
         if (empty($tablename)) {
             $this->error('出现错误!');
         }
         //栏目配置
         $setting = getCategory($rssid, 'setting');
         $data = M($tablename)->where($where)->order(array("updatetime" => "DESC", "id" => "DESC"))->limit(50)->select();
         import('@.ORG.Rss');
         $Rss = new Rss($this->XMLstr(getCategory($rssid, 'catname') . ' - ' . CONFIG_SITENAME), $this->XMLstr(getCategory($rssid, 'url')), $this->XMLstr(getCategory($rssid, 'description')), $this->XMLstr(getCategory($rssid, 'image')));
         foreach ($data as $k => $v) {
             $v = $this->XMLstr($v);
             $Rss->AddItem($v['title'], $v['url'], $v['description'], date("Y-m-d H:i:s A", $v['updatetime']));
         }
         //进行缓存
         S("Rss_{$rssid}", $Rss->Fetch(), 900);
         $Rss->Display();
     }
     $this->assign('catid', $catid);
     $this->assign('rssid', $rssid);
     $this->assign("SEO", seo(0, 'Rss订阅中心'));
     $this->display();
 }
Exemple #12
0
 function main()
 {
     global $_G;
     $title = $_G[setting][seo_title];
     $and = '';
     $url = URL . 'm=list';
     $rs = array('showpage' => '', 'count' => 0, 'goods' => array());
     $size = $channel['page'] > 0 ? intval($channel['page']) : $_G['setting'][cate_page];
     $this->add($rs);
     $this->add(array('channel' => $channel));
     seo($channel['title'], $channel['keywords'], $channel['description']);
     $this->show();
 }
Exemple #13
0
 public function init()
 {
     $catid = intval($_GET['catid']);
     $id = intval($_GET['id']);
     if (!$catid || !$id) {
         showmessage(L('information_does_not_exist'), 'blank');
     }
     $_userid = $this->_userid;
     $_username = $this->_username;
     $_groupid = $this->_groupid;
     $page = intval($_GET['page']);
     $page = max($page, 1);
     $siteids = getcache('category_content', 'commons');
     $siteid = $siteids[$catid];
     $CATEGORYS = getcache('category_content_' . $siteid, 'commons');
     if (!isset($CATEGORYS[$catid]) || $CATEGORYS[$catid]['type'] != 0) {
         showmessage(L('information_does_not_exist'), 'blank');
     }
     $this->category = $CAT = $CATEGORYS[$catid];
     $this->category_setting = $CAT['setting'] = string2array($this->category['setting']);
     $siteid = $GLOBALS['siteid'] = $CAT['siteid'];
     $MODEL = getcache('model', 'commons');
     $modelid = $CAT['modelid'];
     $tablename = $this->db->table_name = $this->db->db_tablepre . $MODEL[$modelid]['tablename'];
     $r = $this->db->get_one(array('id' => $id));
     if (!$r || $r['status'] != 99) {
         showmessage(L('info_does_not_exists'), 'blank');
     }
     $this->db->table_name = $tablename . '_data';
     $r2 = $this->db->get_one(array('id' => $id));
     $rs = $r2 ? array_merge($r, $r2) : $r;
     //再次重新赋值,以数据库为准
     $catid = $CATEGORYS[$r['catid']]['catid'];
     $modelid = $CATEGORYS[$catid]['modelid'];
     require_once CACHE_MODEL_PATH . 'content_output.class.php';
     $content_output = new content_output($modelid, $catid, $CATEGORYS);
     $data = $content_output->get($rs);
     extract($data);
     //最顶级栏目ID
     $arrparentid = explode(',', $CAT['arrparentid']);
     $top_parentid = $arrparentid[1] ? $arrparentid[1] : $catid;
     $template = 'demo';
     //SEO
     $seo_keywords = '';
     if (!empty($keywords)) {
         $seo_keywords = implode(',', $keywords);
     }
     $SEO = seo($siteid, $catid, $title, $description, $seo_keywords);
     include template('content', $template);
 }
 /**
  * 显示下载页面 
  */
 public function index()
 {
     //栏目ID
     $catid = (int) $this->_get('catid');
     //信息ID
     $id = (int) $this->_get('id');
     //编号
     $k = (int) $this->_get('k');
     //字段名称
     $f = $this->_get('f');
     if (!$catid || !$id || !$f) {
         $this->error("参数有误!");
     }
     $Category = F('Category');
     $Model = F('Model');
     //模型ID
     $modelid = $Category[$catid]['modelid'];
     $Model_field = F("Model_field_" . $modelid);
     //主表名称
     if ((int) $Model_field[$f]['issystem'] == 1) {
         $tablename = ucwords($Model[$modelid]['tablename']);
     } else {
         $tablename = ucwords($Model[$modelid]['tablename']) . "_data";
     }
     //字段配置
     $setting = unserialize($Model_field[$f]['setting']);
     if ($setting) {
         //字段信息
         $downfiles = M($tablename)->where(array("id" => $id))->getField($f);
         $downfiles = unserialize($downfiles);
         $info = $downfiles[$k];
         if (!$info) {
             $this->error("该下载地址已经失效!");
         }
         //加验证码
         $aut = md5(get_client_ip() . substr($_SERVER['HTTP_USER_AGENT'], 0, 254));
         //加密
         //格式:aut|栏目ID|信息id|下载编号|字段
         $key = authcode($aut . "|" . $catid . "|" . $id . "|" . $k . "|" . $f, "", '', 3600);
         $this->assign("fileurl", U("Download/d", "key=" . str_replace("%2F", "%*2F", urlencode($key))));
         $this->assign("filename", $info['filename']);
         $this->assign("point", $info['point']);
         $this->assign("groupid", $info['groupid']);
         $this->assign("Member_group", F("Member_group"));
         $this->assign("SEO", seo($catid, urldecode($info['filename']), '', ''));
         $this->display("Public:download");
     } else {
         $this->error("出现错误,请联系管理员更新缓存!");
     }
 }
 public function index()
 {
     $search = $_GET;
     $gc = array();
     if (intval($search['cate'])) {
         $array = M('GoodsClass')->order('gc_sort desc')->select();
         $ids = getChildsId($array, intval($search['cate']), 'gc_id', 'gc_parent_id');
         $ids[] = intval($search['cate']);
         $where['gc_id'] = array('IN', $ids);
         $gc = M('GoodsClass')->where($where)->find();
         if ($gc['gc_parent_id']) {
             $pcate = $gc['gc_parent_id'];
         } else {
             $pcate = intval($search['cate']);
         }
         $search['cateName'] = $gc['gc_name'];
         $param['title'] = $gc['gc_title'];
         $param['keywords'] = $gc['gc_key'];
         $param['description'] = $gc['gc_desc'];
         $this->seo = seo($param);
     }
     if (trim($search['tag'])) {
         $tag = explode(',', trim($search['tag']));
         $where['_string'] = '';
         if (is_array($tag)) {
             foreach ($tag as $key => $val) {
                 $where['_string'] .= '(tag like "%|' . $val . '|%") AND ';
             }
             $where['_string'] = substr($where['_string'], 0, -5);
         }
     }
     $order = 'goods_sort desc';
     $where['goods_status'] = 1;
     $count = D('Goods')->where($where)->count();
     $page = new Page($count, 8);
     $list = D('Goods')->where($where)->limit($page->firstRow . ',' . $page->listRows)->order($order)->select();
     $tc_ids = $gc['tc_id'];
     if (!empty($tc_ids)) {
         $tag_class = D('TagClass')->relation(true)->where(array('tc_id' => array('IN', $tc_ids)))->order('tc_sort desc')->select();
         $this->assign('tag_class', $tag_class);
     }
     $this->assign('pcate', $pcate);
     $this->assign('list', $list);
     $this->assign('page', $page->show());
     $this->assign('search', $search);
     $this->display();
 }
Exemple #16
0
 /**
  * 按照模型搜索
  */
 public function init()
 {
     if (!isset($_GET['catid'])) {
         showmessage(L('missing_part_parameters'));
     }
     $catid = intval($_GET['catid']);
     $siteids = getcache('category_content', 'commons');
     $siteid = $siteids[$catid];
     $this->categorys = getcache('category_content_' . $siteid, 'commons');
     if (!isset($this->categorys[$catid])) {
         showmessage(L('missing_part_parameters'));
     }
     if (isset($_GET['info']['catid']) && $_GET['info']['catid']) {
         $catid = intval($_GET['info']['catid']);
     } else {
         $_GET['info']['catid'] = 0;
     }
     if (isset($_GET['tag']) && trim($_GET['tag']) != '') {
         $tag = safe_replace(strip_tags($_GET['tag']));
     } else {
         showmessage(L('illegal_operation'));
     }
     $modelid = $this->categorys[$catid]['modelid'];
     $modelid = intval($modelid);
     if (!$modelid) {
         showmessage(L('illegal_parameters'));
     }
     $CATEGORYS = $this->categorys;
     $siteid = $this->categorys[$catid]['siteid'];
     $siteurl = siteurl($siteid);
     $this->db->set_model($modelid);
     $page = $_GET['page'];
     $datas = $infos = array();
     $infos = $this->db->listinfo("`keywords` LIKE '%{$tag}%'", 'id DESC', $page, 20);
     $total = $this->db->number;
     if ($total > 0) {
         $pages = $this->db->pages;
         foreach ($infos as $_v) {
             if (strpos($_v['url'], '://') === false) {
                 $_v['url'] = $siteurl . $_v['url'];
             }
             $datas[] = $_v;
         }
     }
     $SEO = seo($siteid, $catid, $tag);
     include template('content', 'tag');
 }
Exemple #17
0
 /**
  * 按照模型搜索
  */
 public function init()
 {
     if (!isset($_GET['catid'])) {
         showmessage(L('missing_part_parameters'));
     }
     $catid = intval($_GET['catid']);
     $this->categorys = S('common/category_content');
     if (!isset($this->categorys[$catid])) {
         showmessage(L('missing_part_parameters'));
     }
     if (isset($_GET['info']['catid']) && $_GET['info']['catid']) {
         $catid = intval($_GET['info']['catid']);
     } else {
         $_GET['info']['catid'] = 0;
     }
     if (isset($_GET['tag']) && trim($_GET['tag']) != '') {
         $tag = safe_replace(strip_tags($_GET['tag']));
     } else {
         showmessage(L('illegal_operation'));
     }
     $modelid = $this->categorys[$catid]['modelid'];
     $modelid = intval($modelid);
     if (!$modelid) {
         showmessage(L('illegal_parameters'));
     }
     $CATEGORYS = $this->categorys;
     $this->db->set_model($modelid);
     $page = isset($_GET['page']) ? intval($_GET['page']) : 1;
     $datas = $infos = array();
     $where = array();
     $where['status'] = 99;
     $where['keywords'] = array('like', "%{$tag}%");
     $infos = $this->db->where($where)->order('id DESC')->listinfo($page, 20);
     $total = $this->db->number;
     if ($total > 0) {
         $pages = $this->db->pages;
         foreach ($infos as $_v) {
             if (strpos($_v['url'], '://') === false) {
                 $_v['url'] = SITE_URL . $_v['url'];
             }
             $datas[] = $_v;
         }
     }
     $SEO = seo($catid, $tag);
     include template('content', 'tag');
 }
Exemple #18
0
 public function main()
 {
     global $_G;
     if (!$_GET['id']) {
         showmessage('抱歉,ID不存在');
         return false;
     }
     $id = intval($_GET[id]);
     $ad = $_G[ad]['k' . $id];
     if (!$ad[id] || $ad[hide] == 1 || $ad[show] == false) {
         showmessage('抱歉,未找到广告或广告禁止查看..');
         return false;
     }
     $this->add(array('ad' => $ad));
     seo($ad[title] . ' - ' . $_G['setting'][title]);
     $this->show();
 }
Exemple #19
0
 function _list()
 {
     global $_G;
     $url = URL . 'm=img&a=list';
     $and = ' `hide` = 0 ';
     $tag = '';
     if ($_GET[tag]) {
         $tag = $_GET['tag'];
         $tag = urldecode_utf8($tag);
         $tag = daddslashes($tag);
         $and .= "AND FIND_IN_SET('" . $tag . "', keywords) ";
         $url .= "&tag=" . urlencode_utf8($tag);
     }
     $img = D(array('and' => $and, 'table' => 'img', 'order' => '`sort` DESC,id DESC', 'key' => 'img_list_' . $tag), array('size' => 10, 'url' => $url));
     $this->add($img);
     seo('值得买 - ' . $_G['setting'][title]);
     $this->show();
 }
Exemple #20
0
 /**
  * 展示公告
  */
 public function show()
 {
     if (!isset($_GET['id'])) {
         showmessage(L('illegal_operation'));
     }
     $_GET['id'] = intval($_GET['id']);
     $where = array('aid' => $_GET['id'], 'passed' => '1', 'endtime' => array(array('gt', date('Y-m-d')), array('eq', '0000-00-00'), 'or'));
     $r = $this->db->where($where)->find();
     if ($r['aid']) {
         $this->db->where(array('id' => $r['id']))->update(array('hits' => '+=1'));
         $template = $r['show_template'] ? $r['show_template'] : 'show';
         extract($r);
         $SEO = seo('', $title);
         include template('announce', $template, $r['style']);
     } else {
         showmessage(L('no_exists'));
     }
 }
 public function index()
 {
     $where = array();
     $catid = (int) $this->_get('catid');
     $rssid = (int) $this->_get('rssid');
     if ($rssid) {
         header("Content-Type: text/xml; charset=" . C("DEFAULT_CHARSET"));
         //检测缓存
         $data = S("Rss_{$rssid}");
         if ($data) {
             echo $data;
             exit;
         }
         $Category = F("Category");
         $Model = F("Model");
         $where['status'] = array("EQ", 99);
         //判断是否有子栏目
         if ($Category[$rssid]['child']) {
             $where['catid'] = array("IN", $Category[$rssid]['arrchildid']);
         } else {
             $where['catid'] = array("EQ", $rssid);
         }
         //模型ID
         $modelid = $Category[$rssid]['modelid'];
         //获取表名
         $tablename = ucwords($Model[$modelid]['tablename']);
         //栏目配置
         $setting = unserialize($Category[$rssid]['setting']);
         $data = M($tablename)->where($where)->order(array("updatetime" => "DESC", "id" => "DESC"))->limit(50)->select();
         import('@.ORG.Rss');
         $Rss = new Rss($this->XMLstr($Category[$rssid]['catname'] . ' - ' . CONFIG_SITENAME), $this->XMLstr($Category[$rssid]['url']), $this->XMLstr($Category[$rssid]['description']), $this->XMLstr($Category[$rssid]['image']));
         foreach ($data as $k => $v) {
             $v = $this->XMLstr($v);
             $Rss->AddItem($v['title'], $v['url'], $v['description'], date("Y-m-d H:i:s A", $v['updatetime']));
         }
         //进行缓存
         S("Rss_{$rssid}", $Rss->Fetch(), 900);
         $Rss->Display();
     }
     $this->assign('catid', $catid);
     $this->assign('rssid', $rssid);
     $this->assign("SEO", seo(0, 'Rss订阅中心'));
     $this->display();
 }
 /**
  * 帮助详情
  */
 public function detail()
 {
     $id = intval($_GET['id']);
     $where['article_id'] = array('eq', $id);
     $where['ac_type'] = array('eq', CONTROLLER_NAME);
     $where['article_show'] = array('eq', 1);
     $info = $this->model->where($where)->find();
     if (empty($info)) {
         unset($where['article_id']);
         $info = $this->model->where($where)->limit(1)->order($this->order)->find();
     }
     $this->assign('info', $info);
     $seo_param['title'] = $info['seo_title'];
     $seo_param['keywords'] = $info['seo_key'];
     $seo_param['description'] = $info['seo_desc'];
     $this->assign('seo', seo($seo_param));
     $this->h3_title = '帮助详情';
     $this->display();
 }
Exemple #23
0
	/**
	 * չʾ¹«¸æ
	 */
	public function show() {
		if(!isset($_GET['aid'])) {
			showmessage(L('illegal_operation'));
		}
		$_GET['aid'] = intval($_GET['aid']);
		$where = '';
		$where .= "`aid`='".$_GET['aid']."'";
		$where .= " AND `passed`='1' AND (`endtime` > '".date('Y-m-d')."' or `endtime`='0000-00-00')";
		$r = $this->db->get_one($where);
		if($r['aid']) {
			$this->db->update(array('hits'=>'+=1'), array('aid'=>$r['aid']));
			$template = $r['show_template'] ? $r['show_template'] : 'show';
			extract($r);
			$SEO = seo(get_siteid(), '', $title);
			include template('announce', $template, $r['style']);
		} else {
			showmessage(L('no_exists'));	
		}
	}
Exemple #24
0
 /**
  * 按照模型搜索
  */
 public function init()
 {
     $catid = intval($_GET['catid']);
     $siteid = get_siteid();
     $this->categorys = getcache('category_ask_' . $siteid, 'commons');
     if ($catid && !isset($this->categorys[$catid])) {
         showmessage(L('missing_part_parameters'));
     }
     if (isset($_GET['tag']) && trim($_GET['tag']) != '') {
         $tag = safe_replace(strip_tags($_GET['tag']));
     } else {
         showmessage(L('illegal_operation'));
     }
     $CATEGORYS = $this->categorys;
     $siteurl = siteurl($siteid);
     $page = $_GET['page'];
     $datas = $infos = array();
     if ($_GET['type'] == 'nosolve') {
         $sql = " AND status = 3 ";
     } elseif ($_GET['type'] == 'solve') {
         $sql = " AND status = 5 ";
     } elseif ($_GET['type'] == 'vote') {
         $sql = " AND flag = 1 ";
     } elseif ($_GET['type'] == 'high') {
         $sql = " AND flag = 2 ";
     } else {
         $sql = " AND status > 2 ";
     }
     $infos = $this->db->listinfo("`keywords` LIKE '%{$tag}%' {$sql}", 'askid DESC', $page, 20);
     $total = $this->db->number;
     if ($total > 0) {
         $pages = $this->db->pages;
         foreach ($infos as $_v) {
             if (strpos($_v['url'], '://') === false) {
                 $_v['url'] = $siteurl . $_v['url'];
             }
             $datas[] = $_v;
         }
     }
     $SEO = seo($siteid, $catid, $tag);
     include template('ask', 'tag');
 }
 public function __construct()
 {
     parent::__construct();
     $this->controller_name = CONTROLLER_NAME;
     $this->action_name = ACTION_NAME;
     //读取配置信息
     $web_stting = F('setting');
     if ($web_stting === false) {
         $params = array();
         $list = M('Setting')->getField('name,value');
         foreach ($list as $key => $val) {
             $params[$key] = unserialize($val) ? unserialize($val) : $val;
         }
         F('setting', $params);
         $web_stting = F('setting');
     }
     $this->assign('web_stting', $web_stting);
     //站点状态判断
     if ($web_stting['site_status'] != 1) {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
         echo $web_stting['closed_reason'];
         exit;
     } else {
         /* $link = M('Link')->where(array('status'=>1))->order('sort DESC')->select();
         			$this->assign('link',$link); */
         $this->mid = session('member_id');
         $this->assign('seo', seo());
         $this->about = M('SystemArticle')->where(array('ac_type' => 'about'))->order('article_sort desc')->select();
         $this->service = M('SystemArticle')->where(array('ac_type' => 'service'))->order('article_sort desc')->select();
         $this->article_class = M('ArticleClass')->where(array('ac_parent_id' => 0))->order('ac_sort desc')->select();
         $this->ip_info = get_ip_info(get_client_ip(), 2);
         /*$ip = new Ip();
         		$this->ip_info = $ip->find(get_client_ip());
         		if ($this->ip_info[0] != '中国' || $this->ip_info[1] != '香港' || $this->ip_info[1] != '澳门' || $this->ip_info[1] != '台湾')
         		{
         			$this->in_gfw = 0;
         		}else {
         			$this->in_gfw = 1;
         		}*/
     }
 }
Exemple #26
0
 public function init()
 {
     $hot = isset($_GET['hot']) && intval($_GET['hot']) ? intval($_GET['hot']) : 0;
     pc_base::load_sys_class('form');
     $reviewsid =& $this->reviewsid;
     $modules =& $this->modules;
     $contentid =& $this->contentid;
     $siteid =& $this->siteid;
     $username = param::get_cookie('_username', L('phpcms_friends'));
     $userid = param::get_cookie('_userid');
     $reviews_setting_db = pc_base::load_model('reviews_setting_model');
     $setting = $reviews_setting_db->get_one(array('siteid' => $this->siteid));
     //SEO
     $SEO = seo($siteid, '', $title);
     //通过API接口调用数据的标题、URL地址
     if (!($data = get_comment_api($reviewsid))) {
         $this->_show_msg(L('illegal_parameters'));
     } else {
         $title = $data['title'];
         $url = $data['url'];
         if (isset($data['allow_reviews']) && empty($data['allow_reviews'])) {
             showmessage(L('canot_allow_comment'));
         }
         unset($data);
     }
     if (isset($_GET['iframe'])) {
         if (strpos($url, APP_PATH) === 0) {
             $domain = APP_PATH;
         } else {
             $urls = parse_url($url);
             $domain = $urls['scheme'] . '://' . $urls['host'] . (isset($urls['port']) && !empty($urls['port']) ? ":" . $urls['port'] : '') . '/';
         }
         if ($_GET['iframe'] == 1) {
             include template('reviews', 'show_list');
         } else {
             include template('reviews', 'show_milist');
         }
     } else {
         include template('reviews', 'list');
     }
 }
 function _list()
 {
     global $_G;
     if (isset($_GET[all])) {
     } else {
         $and_time .= " AND start_time < " . TIMESTAMP;
         $and_time .= " AND ( end_time = 0 or  end_time > " . TIMESTAMP . ")";
         $and = ' AND  `hide`=0 ' . $and_time;
         $url = '';
     }
     if (isset($_GET['tag']) && $_GET['tag']) {
         $tag = intval($_GET['tag']);
         $and .= " AND   tag = " . $tag;
         $url .= "&tag=" . $tag;
     }
     $rs = D(array('and' => $and, 'order' => ' `sort` DESC,id DESC ', 'table' => 'duihuan', 'key' => 'duihuan_' . $_GET['tag']), array('url' => URL . "m=duihuan&a=list" . $url, 'size' => 20));
     $this->add($rs);
     $title = '商品兑换';
     seo($title);
     $this->show('duihuan/list');
 }
 function main()
 {
     global $_G;
     $fid = intval($_GET['fid']);
     $_G['channel'] = $channel = $_G['channels'][$fid] ? $_G['channels'][$fid] : $_G['all_channel']['k' . $fid];
     if ($fid < 1 || !$channel && !$_G[mobile]) {
         showmessage('抱歉FID不存在');
         return false;
     }
     $size = $channel['page'] > 0 ? intval($channel['page']) : $_G[setting][cate_page];
     $url = URL;
     $and = "";
     $sql = make_sql();
     if ($_G['setting']['main_table'] && array_key_exists($_G['setting']['main_table'], table())) {
         $rs = D(array('and' => $and . $sql['and'], 'order' => $sql[order], 'table' => $_G['setting']['main_table'], 'key' => 'channel_' . $_G['fid']), array('url' => $url . $sql[url], 'size' => $size));
         $this->add($rs);
     }
     $this->add(array('channel' => $channel));
     seo($channel['title'], $channel['name'] . ',' . $channel['keywords'], $channel['description']);
     $this->show($channel['channel_tpl'] ? $channel['channel_tpl'] : '');
 }
Exemple #29
0
 /**
  * 评论首页和内容页调用
  */
 public function init()
 {
     $hot = isset($_GET['hot']) && intval($_GET['hot']) ? intval($_GET['hot']) : 0;
     $commentid =& $this->commentid;
     $applications =& $this->applications;
     $contentid =& $this->contentid;
     $username = cookie('_username', L('yuncms_friends'));
     $userid = cookie('_userid');
     $setting = S('common/comment');
     $SEO = seo('');
     // SEO
     // 通过API接口调用数据的标题、URL地址
     if (!($data = get_comment_api($commentid))) {
         $this->_show_msg(L('illegal_parameters'));
     } else {
         $title = $data['title'];
         $url = $data['url'];
         if (isset($data['allow_comment']) && empty($data['allow_comment'])) {
             showmessage(L('canot_allow_comment'));
         }
         unset($data);
     }
     if (isset($_GET['js'])) {
         if (strpos($url, SITE_URL) === 0) {
             $domain = SITE_URL;
         } else {
             $urls = parse_url($url);
             $domain = $urls['scheme'] . '://' . $urls['host'] . (isset($urls['port']) && !empty($urls['port']) ? ":" . $urls['port'] : '') . '/';
         }
         ob_start();
         include template('comment', 'show_list');
         $html = ob_get_contents();
         ob_clean();
         echo format_js($html);
     } else {
         include template('comment', 'list');
     }
 }
Exemple #30
0
    public static function show_error($type, $errormsg, $phpmsg = '', $typemsg = '')
    {
        global $_G, $app;
        if (defined('API') && API === true) {
            exit;
        }
        if ($_G[mobile]) {
            msg($errormsg, 'error');
        } else {
            if (defined('FETCH') || defined('APP')) {
                json($errormsg);
            } else {
                if ($_G[inajax]) {
                    msg($errormsg, 'error');
                }
            }
        }
        seo('Error  by优淘TAE系统');
        $title = $type == 'db' ? 'Database Error' : 'System Error';
        $str = '<link rel="stylesheet" type="text/css" href="/assets/global/css/global.css" media="all" />';
        $str .= '<div class="system_error"><div class="error_main"><a class="y go_home" href="' . $_G[siteurl] . '">返回首页</a><h1>' . $title . ' by uz-system </h1><div class="info">' . $errormsg . ' </div>';
        $helplink = "<a href='http://www.uz-system.com' target=\"_blank\"><span>Need Help? open http://www.uz-system.com</span></a>";
        $str .= '<div class="help">Note. ' . $helplink . '</div>';
        ob_clean();
        $str = '<!doctype html>
<html>
<head>
<title>Error  by优淘TAE系统</title>
<meta name="robots" content="noindex,nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=' . CHARSET . '" />
</head>
<body class="taeapp system_error">
' . $str . "\n</body></html>";
        echo $str;
        die;
    }