コード例 #1
0
 /**
  *展会信息
  *@date 2010-6-2
  *@time 上午10:38:22
  */
 function show()
 {
     //展会信息
     $aid = intval($_REQUEST['aid']);
     $this->assign('industries', $this->_get_fair());
     $this->assign("city", $this->_get_city('fair'));
     $this->assign('date', $this->_get_time());
     $year = array();
     $nowyear = date('Y');
     $year['sy']['name'] = $nowyear;
     $year['sy']['ms'] = mktime(0, 0, 0, 1, 1, $nowyear);
     $year['sy']['me'] = mktime(0, 0, 0, 1, 1, $nowyear + 1) - 1;
     $year['ny']['name'] = $nowyear + 1;
     $year['ny']['ms'] = mktime(0, 0, 0, 1, 1, $nowyear + 1);
     $year['ny']['me'] = mktime(0, 0, 0, 1, 1, $nowyear + 2) - 1;
     $this->assign('year', $year);
     $flang = Input::getVar($_REQUEST['flang']);
     $dao = D("Archives");
     $condition = array();
     if ($flang) {
         $lan = explode('_', $flang);
         if ($lan['1'] == 'CN') {
             $flang = $lan['0'] . '_CN';
         } else {
             $flang = $lan['0'] . '_EN';
         }
         $condition['writer'] = $flang;
         $condition['channel'] = 11;
         $_SESSION['flang'] = $lan['1'];
     } else {
         $condition['id'] = $aid;
     }
     $info = $dao->where($condition)->find();
     if ($info['ismake'] == '0') {
         $this->error("error: the information has been deleted!");
     }
     if (empty($info)) {
         $this->error("sorry,the information is not available now.<br/>\n您查看的信息暂时空缺。");
     }
     $lan = explode('_', $info['writer']);
     $lang['cn'] = $lan['0'] . '_CN';
     $lang['en'] = $lan['0'] . '_EN';
     $this->assign('lang', $lang);
     $info['_fair'] = $dao->relationGet("fair");
     $album = $this->get_album($info['id'], $info['channel']);
     if ($info['picurl']) {
         $info['picurl'] = str_replace('../Public/Uploads', '/Public/Uploads', $info['picurl']);
     } else {
         $info['picurl'] = out_images($album['0'], 's');
     }
     $info['albumnum'] = count($album);
     $this->assign("album", $album);
     $this->assign('info', $info);
     $page = array();
     $page['title'] = $info['title'] . ' - BeingfunChina 缤纷中国';
     $page['keywords'] = $info['keywords'] . ',fair,china,biz';
     $page['description'] = $info['description'];
     $this->assign('page', $page);
     $this->assign('dh', $this->_get_dh($info['typeid']));
     $this->display();
 }
コード例 #2
0
 /**
  *分类信息内容页面
  *@date 2010-4-30
  *@time 下午05:08:30
  */
 function show()
 {
     //分类信息内容页面
     $aid = intval($_GET['aid']);
     if (empty($aid)) {
         $this->error("error: aid is null!");
     }
     $dao = D("Archives");
     $info = $dao->where("id={$aid}")->find();
     if (empty($info)) {
         $this->error("error: info is null!");
     }
     if ($info['ismake'] == '0') {
         $this->error("error: the information has been deleted!");
     }
     $this->ads($info['channel'], 'content', '1');
     $city = $this->_get_city('localion');
     switch (true) {
         case $info['channel'] == 4:
             //Jobs
             $info['_jobs'] = $dao->relationGet("jobs");
             $info['itype'] = $info['itype'] == '0' ? 'All' : $info['itype'] == '1' ? 'Offered' : 'Wanted';
             $category = array("All", "Full time", "Part time", "Internship", "Voluntary");
             $info['category'] = $category[$info['category']];
             break;
         case $info['channel'] == 5:
             //realestate
             $info['_realestate'] = $dao->relationGet("realestate");
             break;
         case $info['channel'] == 6:
             //commerce
             $types = array(1 => 'All', 2 => 'Offered', 3 => 'Wanted');
             $cat = array('Brand-new', 'Second-hand');
             $info['itype'] = $types[$info['type']];
             $info['category'] = $cat[$info['category']];
             $info['_commerce'] = $dao->relationGet("commerce");
             break;
         case $info['channel'] == 7:
             //agents
             $info['_agents'] = $dao->relationGet("agents");
             break;
         case $info['channel'] == 8:
             //personals
             $info['_personals'] = $dao->relationGet("personals");
             break;
         case $info['channel'] == 9:
             //services
             $info['itype'] = $info['itype'] == 1 ? 'All' : $info['itype'] == 2 ? 'Offered' : 'Wanted';
             $category = array("All", "Full time", "Part time", "Internship", "Voluntary");
             $info['category'] = $category[$info['category']];
             $info['_services'] = $dao->relationGet("services");
             break;
     }
     $local = '';
     if ($info['zone_id'] && $info['city_id']) {
         $local = $city[$info['city_id']]['_zone'][$info['zone_id']]['name'] . ',' . $city[$info['city_id']]['cename'];
     } elseif (empty($info['zone_id']) && $info['city_id']) {
         $local = $city[$info['city_id']]['cename'];
     }
     $info['position'] = trim($info['position'] . ',' . $local, ',');
     $album = $this->get_album($info['id'], $info['channel']);
     if ($info['picurl']) {
         $info['picurl'] = str_replace('../Public/Uploads', '/Public/Uploads', $info['picurl']);
     } else {
         $info['picurl'] = out_images($album['0'], 's');
     }
     $info['albumnum'] = count($album);
     $this->assign("album", $album);
     $this->assign('info', $info);
     //$this->assign('comments',$this->_get_comments($info['id'],$info['channel']));
     $this->assign("group", $this->member_group($this->member_comments($info['id'], $info['channel']), "0,6"));
     $page = array();
     $page['title'] = $info['title'] . ' - BeingfunChina 缤纷中国';
     $page['keywords'] = $info['keywords'];
     $page['description'] = $info['description'];
     $this->assign('page', $page);
     if ($this->_is_admin() || $this->user['uid'] == $info['uid']) {
         $cp = '<a href="/Cp/photo/info/' . $info['channel'] . '_' . $info['id'] . '">Add Photos</a> / <a href="/Cp/my_edit_classifieds/info/' . $info['channel'] . '_' . $info['id'] . '">edit</a> / <a href="/Cp/del_arc/info/' . $info['channel'] . '_' . $info['id'] . '/to/' . myencode("/clist/{$info['typeid']}.html") . '/">remove</a>';
         $cp .= string2checked('f', $info['flag'], ',', '1') == 1 ? " / <a href=\"/Cp/attr/info/{$info['channel']}_{$info['id']}/clear/f/to/" . myencode("/clss/{$info['id']}.html") . "\" title=\"clear Featured\"><font color=\"#FF0000\">Featured</font></a> / " : " / <a href=\"/Cp/attr/info/{$info['channel']}_{$info['id']}/fld/f/to/" . myencode("/clss/{$info['id']}.html") . "\" title=\"Set Featured\">Featured</a> / ";
         $this->assign('cp', $cp);
     }
     //dump($this->_get_dh($info['typeid']));
     $this->assign('dh', $this->_get_dh($info['typeid']));
     $cid_sql = '';
     if ($this->pcid == '0') {
         $cid_sql = "";
     } elseif ($this->pcid < 1000) {
         $cid_sql = " AND (cid={$this->pcid} or cid='0')";
     } else {
         $city_temp = array('name' => '', 'id' => '');
         foreach ($this->cgroup[$this->pcid]['city'] as $k => $v) {
             $city_temp['id'] .= $k . ',';
             $city_temp['name'] .= $v . ',';
         }
         $cid_sql = " AND (cid in ({$city_temp['id']} or cid='0')";
     }
     $this->assign("new_arc", $this->_get_uptype_arc($info['typeid']));
     $f_arc = array();
     $condition = array();
     $condition['ismake'] = '1';
     $classifieds_ch = '4,5,6,7,8,9';
     $condition['channel'] = array('in', "{$classifieds_ch}");
     $condition['_string'] = "FIND_IN_SET('f',`flag`) > 0";
     if ($this->pcid == '0') {
         $condition['_string'] .= "";
     } elseif ($this->pcid < 1000) {
         $condition['_string'] .= " AND (cid={$this->pcid} or cid='0')";
     } else {
         $city_temp = array('name' => '', 'id' => '');
         foreach ($this->cgroup[$this->pcid]['city'] as $k => $v) {
             $city_temp['id'] .= $k . ',';
             $city_temp['name'] .= $v . ',';
         }
         $condition['_string'] .= " AND (cid in ({$city_temp['id']}) or cid='0')";
     }
     $f_arc = $dao->where($condition)->order("pubdate DESC")->limit("0,20")->findAll();
     shuffle($f_arc);
     $this->assign('f_arc', $f_arc);
     $condition = array();
     $st = mktime(0, 0, 1, date("m"), date("d"), date("Y"));
     $et = mktime(59, 59, 59, date("m"), date("d") + 30, date("Y"));
     $condition['channel'] = '10';
     $condition['ismake'] = '1';
     $condition['_string'] = "`showstart`>={$st} AND `showstart`<={$et}";
     if ($this->pcid == '0' || empty($this->pcid)) {
         $city = '';
     } elseif ($this->pcid < 1000) {
         $city = " AND (cid={$this->pcid} or cid='0')";
     } else {
         $city_temp = array('name' => '', 'id' => '');
         foreach ($this->cgroup[$this->pcid]['city'] as $k => $v) {
             $city_temp['id'] .= $k . ',';
             $city_temp['name'] .= $v . ',';
         }
         $city = " AND (cid in ({$city_temp['id']}) or cid='0')";
     }
     $condition['_string'] .= $city;
     $f_event = array();
     $f_event = $dao->where($condition)->order("pubdate DESC")->limit("0,20")->findAll();
     shuffle($f_event);
     $this->assign("event", $f_event);
     $this->display();
 }
コード例 #3
0
 /**
  *城市指南内容页
  *@date 2010-5-12
  *@time 下午04:13:26
  */
 function show()
 {
     //城市指南内容页
     $aid = intval($_GET['aid']);
     if (empty($aid)) {
         $this->error("error: aid is null!");
     }
     $this->chk_cid();
     /*$dao=D("CityGuideView");
     		$info=$dao->where("Archives.id=$aid")->find();*/
     $dao = D("Archives");
     $info = $dao->where("id={$aid}")->find();
     if (!empty($info['reurl']) && $info['reurl'] != 'http://') {
         redirect($info['reurl']);
     }
     if ($info['ismake'] == '0') {
         $this->error("error: the information has been deleted!");
     }
     $info['content'] = $dao->relationGet("article");
     $cname = array('bj' => 'Beijing', 'sh' => 'Shanghai', 'gz' => 'Guangzhou', 'sz' => 'Shenzhen');
     //if(empty($info['maps'])){
     $city = $this->_get_city('localion');
     $local = '';
     if ($info['zone_id'] && $info['city_id']) {
         $local = $cname[$city[$info['city_id']]['cename']] . ' ' . $city[$info['city_id']]['_zone'][$info['zone_id']]['name'] . ' District';
     } elseif (empty($info['zone_id']) && $info['city_id']) {
         $local = $city[$info['city_id']]['cename'];
     }
     $local = trim($info['position'] . ',' . $local, ',');
     $info['maps'] = $info['contact'];
     //}
     $album = $this->get_album($info['id'], $info['channel']);
     if ($info['picurl']) {
         $info['picurl'] = str_replace('../Public/Uploads', '/Public/Uploads', $info['picurl']);
     } else {
         $info['picurl'] = out_images($album['0'], 's');
     }
     $info['albumnum'] = count($album);
     $this->assign("album", $album);
     $this->assign("group", $this->member_group($this->member_comments($info['id'], $info['channel']), "0,6"));
     $this->assign('info', $info);
     $page = array();
     $page['title'] = $info['title'] . ' - BeingfunChina 缤纷中国';
     $page['keywords'] = $info['keywords'];
     $page['description'] = $info['description'];
     $this->assign('page', $page);
     $this->assign('dh', $this->_get_dh($info['typeid']));
     $this->ads('2', 'content', 0, $info['typeid']);
     if ($this->_is_admin()) {
         $cp = '<a href="/Cp/photo/info/2_' . $info['id'] . '">Add Photos</a> / <a href="/Cp/my_edit_cityguide/info/2_' . $info['id'] . '">edit</a> / <a href="/Cp/del_arc/info/2_' . $info['id'] . '/to/' . myencode("/cglist/{$info['typeid']}.html") . '">remove</a>';
         $this->assign('cp', $cp);
     }
     $this->assign("new_arc", $this->_get_uptype_arc($info['typeid']));
     $condition = array();
     $st = mktime(0, 0, 1, date("m"), date("d"), date("Y"));
     $et = mktime(59, 59, 59, date("m"), date("d") + 30, date("Y"));
     $condition['channel'] = '10';
     $condition['ismake'] = '1';
     $condition['_string'] = "`showstart`>={$st} AND `showstart`<={$et}";
     if ($this->pcid == '0' || empty($this->pcid)) {
         $city = '';
     } elseif ($this->pcid < 1000) {
         $city = " AND (cid={$this->pcid} or cid='0')";
     } else {
         $city_temp = array('name' => '', 'id' => '');
         foreach ($this->cgroup[$this->pcid]['city'] as $k => $v) {
             $city_temp['id'] .= $k . ',';
             $city_temp['name'] .= $v . ',';
         }
         $city = " AND (cid in ({$city_temp['id']}) or cid='0')";
     }
     $condition['_string'] .= $city;
     $f_event = array();
     $f_event = $dao->where($condition)->order("pubdate DESC")->limit("0,20")->findAll();
     shuffle($f_event);
     //dump($dao->getLastSql());
     $this->assign("event", $f_event);
     self::album();
     self::ctg_news();
     $this->display();
 }