Пример #1
0
 function show_action() {
     $this->view->page=front::get('page')?front::get('page'):1;
     $this->pagesize=config::get('list_pagesize');
     $limit=(($this->view->page-1)*$this->pagesize).','.$this->pagesize;
     $special=new special();
     $this->view->special=$special->getrow('spid='.front::get('spid'));
     $this->view->archive['title'] =  $this->view->special['title'];
     $this->view->pages=true;
     $archive=new archive();
     $archives=$archive->getrows('spid='.front::get('spid'),$limit);
     foreach($archives as $order=>$arc) {
         $archives[$order]['url']=archive::url($arc);
         $archives[$order]['catname']=category::name($arc['catid']);
         $archives[$order]['caturl']=category::url($arc['catid']);
         $archives[$order]['adddate']= sdate($arc['adddate']);
         $archives[$order]['stitle']= strip_tags($arc['title']);
     }
     $this->view->archives=$archives;
     $this->view->record_count=$archive->rec_count('spid='.front::get('spid'));
     front::$record_count=$this->view->record_count;
     $this->view->spid=front::get('spid');
     if (front::get('t') == 'wap') {
     	$this->out('wap/special_show.html');
     	return;
     }
 }
Пример #2
0
 function listdata($limit=10) {
     $special=new special();
     $specials=$special->getrows('',$limit);
     foreach ($specials as $order=>$sp) {
         $specials[$order]['url']=special::url($sp['spid'],$sp['ishtml']);
     }
     return $specials;
 }
Пример #3
0
 function make_show_action() {
     header('Cache-control: private, must-revalidate');
     @set_time_limit(0);
     $submit = front::post('submit') ? front::post('submit') : front::get('submit');
     if (!$submit)
         return;
     chkpw('cache_content');
     //time::start();
     $post = front::$post + front::$get;
     unset($post['submit']);
     $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']);
     $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&catid=(\d+)#', '', $c_url);
     $c_url = preg_replace('#&submit=(\d+)#', '', $c_url);
     $c_url = 'index.php?' . $c_url;
     $c_url.='&submit=1';
     
     $category = category::getInstance(); //实例化栏目类
     
     if ($post['aid_start']) {
         $aid_start = $post['aid_start'];
         $aid_end = $post['aid_end'];
         $where = "aid>=$aid_start and aid<=$aid_end AND checked=1 AND (ishtml IS NULL OR ishtml!=2)";
         $c_url.='&aid_start=' . $aid_start . '&aid_end=' . $aid_end;
     } elseif (isset($post['catid'])) {
         $catid = $post['catid'];
         $categories = $category->sons($catid);
         $categories[] = $catid;
         $categories = implode(',', $categories);
         $where = "catid in(" . $categories . ') and checked=1 AND (ishtml IS NULL OR ishtml!=2)';
         $c_url.='&catid=' . $catid;
     }else
         return;
     $case = 'archive';
     $act = 'show';
     $_GET = array('case' => $case, 'act' => $act);
     $front = new front();
     front::$admin = false;
     front::$html = true;
     front::$rewrite = false;
     $case = $case . '_act';
     $case = new $case();
     $case->init();
     $method = $act . '_action';
     //$time_start = time::getTime();
     
     $archive = new archive(); //实例化文章类
     
     if (config::get('group_on')) { //启用分组生成
         $make_page = $post['make_page'] == '' ? 1 : $post['make_page'];
         $archive->getrows($where);
         $archive_num = $archive->record_count;
         $group_count = config::get('group_count');
         $make_page_num = ceil($archive_num / $group_count);
         $totalpage = (($make_page - 1) * $group_count) . ',' . $group_count;
         $c_url.='&make_page=' . ($make_page + 1);
     } else {
         $totalpage = "";
     }
     
     $archives = $archive->getrows($where, $totalpage, '1'); //取到要生成的所有文章
     
     $cpage = 0;
     foreach ($archives as $arc) {
         if (!category::getarcishtml($arc))  //如果文章设置不生成则跳过
             continue;
         if($arc['linkto']){ //如果有跳转连接则跳过生成
         	continue;
         }
         $case->view->archive = $arc;
         front::$get['aid'] = $case->view->aid = $case->view->archive['aid'];
         $case->view->catid = $case->view->archive['catid'];
         
         $case->view->topid = category::gettopparent($case->view->catid);
         $case->view->parentid = $category->getparent($case->view->catid);
         
         $template = $case->view->archive['template'];
         $content = $case->view->archive['content'];
         
         $case->view->categories = category::getpositionlink2($case->view->catid);
         
         //关键字连接
         $linkword = new linkword();
         $linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
         foreach ($linkwords as $linkword) {
             if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
                 $linkword['linktimes'] = (int) $linkword['linktimes'];
                 $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>";
             } else {
                 $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>";
             }
             if (isset($link)) {
                 $content = preg_replace("%(?!\"]*>)$linkword[linkword](?!\s*\")%i", "\\1$link\\2", $content, $linkword['linktimes']);
             }
             unset($link);
         }
         
         //相关文章
         $case->view->likenews = $case->getLike($case->view->archive['tag'], $case->view->archive['keyword']);
         
         //内容分页
         $contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
         if (!empty($contents)) {
             $case->view->pages = count($contents);
             front::$record_count = $case->view->pages * config::get('list_pagesize');
             $case->view->pages = count($contents);
         } else {
             $case->view->pages = 1;
         }
         
         //标签连接
         $taghtml = '';
         $tag_table = new tag();
         foreach ($tag_table->urls($case->view->archive['tag']) as $tag => $url) {
             $taghtml.="<a href='$url' target='_blank'>$tag</a>&nbsp;&nbsp;";
         }
         $case->view->archive['tag'] = $taghtml;
         
         //专题连接
         $case->view->archive['special'] = null;
         if ($case->view->archive['spid']) {
             $spurl = special::url($case->view->archive['spid'],special::getishtml($case->view->archive['spid']));
             $sptitle = special::gettitle($case->view->archive['spid']);
             $case->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a>&nbsp;&nbsp;";
         }
         
         //分类连接
         $case->view->archive['type'] = null;
         if ($case->view->archive['typeid']) {
             $typeurl = type::url($case->view->archive['typeid'],1);
             $typetitle = type::name($case->view->archive['typeid']);
             $case->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a>&nbsp;&nbsp;";
         }
         
         //地区连接
         $case->view->archive['area'] = null;
         $case->view->archive['area'] = area::getpositonhtml($case->view->archive['province_id'], $case->view->archive['city_id'], $case->view->archive['section_id']);
         
         //$arc = $case->view->archive;
         for ($c = 1; $c <= $case->view->pages; $c++) {
             front::$get['page'] = $c;
             $case->view->page = $c;
             if (!empty($contents)) {
                 $content = $contents[$c - 1];
             }
             $case->view->archive['content'] = $content;
             
             //自定义字段
             cb_data($case->view->archive);
             $str = "";
             foreach( $case->view->archive as $key => $value){
             	if(!preg_match('/^my/',$key) || !$value)
             		continue;
             	$sonids = $category->sons(setting::$var['archive'][$key]['catid']);
             	$sonids[] = setting::$var['archive'][$key]['catid'];
             	if(!in_array($case->view->archive['catid'],$sonids) && intval(setting::$var['archive'][$key]['catid'])){
             		//unset($case->view->field[$key]);
             		continue;
             	}
             	$str .= '<p> '.setting::$var['archive'][$key]['cname'].':'. $value.'</p>';
             }
             $arc['my_fields'] = $str;
             
             //上一篇,下一篇
             $aid = $case->view->archive['aid'];
             $catid = $case->view->archive['catid'];
             $sql1 = "SELECT * FROM `{$archive->name}` WHERE catid = '$catid' AND aid > '$aid' ORDER BY aid ASC LIMIT 0,1";
             $sql2 = "SELECT * FROM `{$archive->name}` WHERE catid = '$catid' AND aid < '$aid' ORDER BY aid DESC LIMIT 0,1";
             $n = $archive->rec_query_one($sql1);
             $p = $archive->rec_query_one($sql2);
             $case->view->archive['p'] = $p;
             $case->view->archive['n'] = $n;
             $case->view->archive['p']['url'] = archive::url($p);
             $case->view->archive['n']['url'] = archive::url($n);
             
             //评级
             $case->view->archive['strgrade'] = archive::getgrade($arc['grade']);
             
             //图片
             $case->view->archive['pics'] = unserialize($case->view->archive['pics']);
             if(is_array($case->view->archive['pics']) && !empty($case->view->archive['pics'])){
             	foreach ($case->view->archive['pics'] as $k => $v){
             		if(strtolower(substr($v,0,7)) == 'http://'){
             			$case->view->archive['pics'][$k] = $v;
             		}else{
             			$case->view->archive['pics'][$k] = $v;
             		}
             	}
             }
             $case->view->archive['pics'] = serialize($case->view->archive['pics']);
             
             if ($template && file_exists(TEMPLATE . '/' . $case->view->_style . '/' . $template))
                 $tpl = $template;
             else
                 $tpl = category::gettemplate($case->view->catid, 'showtemplate');
             $content = $case->fetch($tpl);
             $path = ROOT . archive::url($case->view->archive, front::$get['page'] > 1 ? front::$get['page'] : null, true);
             if (!preg_match('/\.[a-zA-Z]+$/', $path))
                 $path = rtrim(rtrim($path, '/'), '\\') . '/index.html';
             $path = rtrim($path, '/');
             $path = rtrim($path, '\\');
             $path = str_replace('//', '/', $path);
             tool::mkdir(dirname($path));
             file_put_contents($path, $content);
             $cpage++;
             if ($case->view->pages > 1 && $c == 1) {
                 $path = ROOT . archive::url($case->view->archive, 1, true);
                 if (!preg_match('/\.[a-zA-Z]+$/', $path))
                     $path = rtrim(rtrim($path, '/'), '\\') . '/index.html';
                 $path = rtrim($path, '/');
                 $path = rtrim($path, '\\');
                 $path = str_replace('//', '/', $path);
                 tool::mkdir(dirname($path));
                 //file_put_contents('logs.txt', file_get_contents('logs.txt')."\r\n".$path);
                 $f = fopen($path,'w');
                 fwrite($f, $content);
                 fclose($f);
                 $cpage++;
             }
         }
     }
     $totalpage = count($archives);
     if (!isset($archives[0]))
         $totalpage = 0;
     if ($make_page >= $make_page_num) {
         $show_msg = "本组生成html <b>{$cpage}</b> 页!  生成html完毕,本次共生成 <b>{$archive_num}</b> 页! 3秒后自动返回内容生成首页面!\n";
         $c_url = preg_replace('#&make_page=(\d+)#', '', $_SERVER['QUERY_STRING']);
         $c_url = preg_replace('#&aid_start=(\d+)#', '', $c_url);
         $c_url = preg_replace('#&aid_end=(\d+)#', '', $c_url);
         $c_url = preg_replace('#&catid=(\d+)#', '', $c_url);
         $c_url = preg_replace('#&submit=(\d+)#', '', $c_url);
         $c_url = 'index.php?' . $c_url;
     } else {
         $show_msg = "第 <b>{$make_page}</b> 组成功生成html <b>{$cpage}</b> 页! 本次共需生成 <b>{$archive_num}</b> 页! 已经生成 <b>" . ($make_page * $group_count) . "</b> 页! 3秒后自动跳入下组生成!\n";
     }
     $getnexturl = "<script>";
     $getnexturl.="var t=4;\n";
     $getnexturl.="setInterval('testTime()',3000);\n";
     $getnexturl.="function testTime() \n";
     $getnexturl.=" { \n";
     $getnexturl.="if(t == 0) location = '" . $c_url . "'; \n";
     $getnexturl.=" t--;\n";
     $getnexturl.="}\n</script> \n";
     if ($cpage > 0) {
         if (!config::get('group_on')) {
             front::flash("成功生成html <b>{$cpage}</b> 页!用时".time::getTime()."!\n");
         } else {
             front::flash($show_msg . "\n" . $getnexturl);
         }
     } else {
         front::flash("没有需要生成的html,可能您选择的栏目暂无内容或者网站并未开启内容生成静态功能!");
     }
     front::$admin = true;
     front::$post = $post;
 }
Пример #4
0
 public function layout_namespace_and_header_process($layout_info)
 {
     if (!$layout_info) {
         return array();
     }
     //专题栏目链接处理
     if (strpos($layout_info['more_href'], 'COLURL') !== false) {
         $intColumnId = intval(str_replace('COLURL', '', $layout_info['more_href']));
         if (!class_exists('special')) {
             include ROOT_PATH . 'lib/class/special.class.php';
         }
         $objSpecial = new special();
         $layout_info['more_href'] = $objSpecial->get_special_col_url($intColumnId);
     }
     $layout_info['content'] = $layout_info['content'] ? str_replace('<NS>', 'm2o-layout-class-' . $layout_info['id'], html_entity_decode($layout_info['content'])) : '';
     $layout_info['css'] = $layout_info['css'] ? str_replace('<NS>', '.m2o-layout-class-' . $layout_info['id'], html_entity_decode($layout_info['css'])) : '';
     $layout_info['layout_css'] = $layout_info['css'];
     $layout_info['header'] = '';
     if ($layout_info['is_header']) {
         $find = array('{$header_text}', '{$more_href}', '{$more_text}');
         $replace = array($layout_info['header_text'], $layout_info['is_more'] ? $layout_info['more_href'] : '#', $layout_info['is_more'] ? '更多>>' : '');
         $header = str_replace($find, $replace, $this->settings['header_dom']['layout']);
         $layout_info['header'] = $header;
         if ($layout_info['content']) {
             $layout_info['content'] = strpos($layout_info['content'], '{$m2o_layout_title}') !== false ? str_replace('{$m2o_layout_title}', $header, $layout_info['content']) : preg_replace('/<div[^>]*m2o-layout-item[^>]*>/is', '\\0' . $header, $layout_info['content']);
         }
     }
     return $layout_info;
 }
Пример #5
0
 public function get_content_by_rid()
 {
     $id = intval($this->input['id']);
     if ($id) {
         $need_pages = intval($this->input['need_pages']);
         $need_process = intval($this->input['need_process']);
         $need_separate = intval($this->input['need_separate']);
         $need_child_detail = intval($this->input['need_child_detail']);
         $not_need_content = intval($this->input['not_need_content']);
         $need_special = intval($this->input['need_special']);
         $sql = "SELECT c.*,c.column_id as main_column_id,r.*,r.id as rid,c.id as id FROM " . DB_PREFIX . "content_relation r LEFT JOIN " . DB_PREFIX . "content c ON r.content_id=c.id WHERE r.id =" . $id;
         $info = $this->db->query_first($sql);
         if (empty($info)) {
             $this->errorOutput('此内容已删除');
         }
         if ($info['indexpic']) {
             $info['indexpic'] = unserialize($info['indexpic']);
         }
         if ($info['video']) {
             $info['video'] = unserialize($info['video']);
             $info['video']['filename'] = str_replace('.mp4', '.m3u8', $info['video']['filename']);
         }
         if ($info['childs_data']) {
             $info['childs_data'] = unserialize($info['childs_data']);
         }
         if ($info['catalog']) {
             $info['catalog'] = unserialize($info['catalog']);
         }
         $info['title'] = $info['title'] ? htmlspecialchars_decode($info['title']) : '';
         $info['brief'] = $info['brief'] ? strip_tags(htmlspecialchars_decode($info['brief'])) : '';
         $info['create_time_format'] = date($this->settings['default_time_format'], $info['create_time']);
         $info['publish_time_stamp'] = $info['publish_time'];
         $info['create_time_stamp'] = $info['create_time'];
         $info['publish_time_format'] = date($this->settings['default_time_format'], $info['publish_time']);
         if ($info['column_id']) {
             $column_data = $this->column->get_site_column_first(' id,name,site_id,fid,childdomain,father_domain,column_dir,relate_dir,col_con_maketype ', $info['column_id']);
             $site_data = $column_data['site_data'];
         }
         $result = array();
         if (!$not_need_content) {
             $apiname = get_tablename($info['bundle_id'], $info['module_id'], $info['struct_id']);
             $filedir = $this->settings['get_content_api_path'] . $apiname . '.class' . $this->settings['get_content_api_suffix'];
             $classname = $apiname;
             if (file_exists($filedir)) {
                 $data = array('id' => $info['expand_id'], 'url' => urldecode($this->input['url']), 'dir' => urldecode($this->input['dir']), 'need_pages' => urldecode($this->input['need_pages']), 'need_child_detail' => urldecode($this->input['need_child_detail']), 'need_process' => urldecode($this->input['need_process']), 'need_separate' => urldecode($this->input['need_separate']), 'child_offset' => intval($this->input['child_offset']), 'child_count' => intval($this->input['child_count']), 'indexpic' => empty($info['indexpic']) ? array() : $info['indexpic']);
                 //echo $filedir;echo $classname;exit;
                 include $filedir;
                 $module_get = new $classname();
                 $result = $module_get->get_processed_content($data);
                 $result = is_array($result) ? $result : array();
             }
         }
         $info1 = $info;
         $info1['id'] = $info['id'];
         if ($info['use_maincolumn']) {
             $column_data = $this->column->get_site_column_first(' id,name,site_id,fid,childdomain,father_domain,column_dir,relate_dir,col_con_maketype ', $info['main_column_id']);
             $site_data = $column_data['site_data'];
             $info['content_url'] = $info['outlink'] ? $info['outlink'] : mk_content_url($site_data, $column_data, array('column_id' => $info['main_column_id']) + $info1);
         } else {
             $info['content_url'] = $info['outlink'] ? $info['outlink'] : mk_content_url($site_data, $column_data, $info1);
         }
         $info['column_info'] = $column_data;
         if ($this->input['video2index'] && $result['content_material_list']) {
             foreach ($result['content_material_list'] as $k => $v) {
                 if ($v['app'] == 'livmedia') {
                     $videourl = parse_url($v['video_url']);
                     $info['video'] = array('host' => $videourl['scheme'] . '://' . $videourl['host'], 'dir' => '', 'filepath' => $videourl['path'], 'filename' => '');
                     $info['is_have_video'] = '1';
                     break;
                 }
             }
         }
         if ($this->input['shorturl'] && $this->settings['App_shorturl']) {
             $curl = new curl($this->settings['App_shorturl']['host'], $this->settings['App_shorturl']['dir']);
             $curl->setReturnFormat('str');
             $curl->setSubmitType('post');
             $curl->initPostData();
             $curl->addRequestData('str', $info['content_url']);
             $ret = $curl->request('shorturl.php');
             if ($ret) {
                 $info['content_url'] = $ret;
             }
         }
         if ($this->settings['App_catalog']) {
             //取编目信息
             $catalog_data = array();
             include ROOT_PATH . 'lib/class/catalog.class.php';
             $catalogobj = new catalog();
             $catalog = $catalogobj->get_catalog($info['bundle_id'], $info['module_id'], $info['content_fromid']);
             $result['catalog_new'] = $catalog;
         }
         $result['source'] = isset($result['source']) ? $result['source'] : '';
         $info['source'] = isset($info['source']) ? $info['source'] : $result['source'];
         if ($result) {
             $result = $info + $result;
         } else {
             $result = $info;
         }
         //统计
         if ($this->input['need_access']) {
             include_once ROOT_PATH . 'lib/class/access.class.php';
             $access_obj = new access();
             $fromType = $this->input['fromType'] ? trim($this->input['fromType']) : "";
             $ret = $access_obj->add_access($info['content_id'], $info['column_id'], $info['bundle_id'], $info['module_id'], $info['title'], $info['content_fromid'], $fromType);
         }
         //加广告
         if ($this->input['ad_group']) {
             $r = array();
             $r['id'] = $result['rid'];
             $r['colid'] = $result['column_id'];
             $r['title'] = $result['title'];
             $r['brief'] = $result['brief'];
             $r['keywords'] = $result['keywords'];
             $r['appid'] = $result['appid'];
             $r['appname'] = $result['appname'];
             $r['create_user'] = $result['create_user'];
             $r['publish_user'] = $result['publish_user'];
             $r['group'] = $this->input['ad_group'];
             $result['ad'] = $this->getAds($this->input['ad_group'], $r, $r['colid']);
         }
         //取这条内容发布到的专题
         if ($need_special && $info['content_id']) {
             $sql = "SELECT relation_data FROM " . DB_PREFIX . "content_push WHERE type=1 AND content_id=" . $info['content_id'];
             $content_push = $this->db->query_first($sql);
             if ($content_push) {
                 $special_data = @unserialize($content_push['relation_data']);
                 if ($special_data) {
                     $special_ids = array();
                     foreach ($special_data as $k => $v) {
                         if ($v['special_id'] = intval($v['special_id'])) {
                             $special_ids[] = $v['special_id'];
                         }
                     }
                     if ($special_ids) {
                         include ROOT_PATH . 'lib/class/special.class.php';
                         $special_obj = new special();
                         $special_datas = $special_obj->get_special_by_ids(implode(',', $special_ids));
                         if (is_array($special_datas)) {
                             $result['special_datas'] = $special_datas;
                         }
                     }
                 }
             }
         }
         $this->addItem($result);
         $this->output();
     } else {
         $this->errorOutput('NO_ID');
     }
 }
Пример #6
0
	static function specialinfo($id) {
		$special = special::getInstance();
		$catinfo[] = $special->getrow($id);
		$catinfo[0]['url'] = special::url($id,$special->getishtml($id));
		return $catinfo;
	}
Пример #7
0
            <div class="blank5"></div>
            地区
            <?php 
echo form::select('search_province_id', get('search_province_id') ? get('search_province_id') : 0, area::province_option());
?>
            <?php 
echo form::select('search_city_id', get('search_city_id') ? get('search_city_id') : 0, area::city_option(get('search_city_id')));
?>
            <?php 
echo form::select('search_section_id', get('search_section_id') ? get('search_section_id') : 0, area::section_option(get('search_section_id')));
?>
 <div class="blank5"></div>
            专题
            <?php 
echo form::select('search_spid', get('search_spid') ? get('search_spid') : 0, special::option());
?>
        </form>
</div>


<form name="listform" id="listform"  action="<?php 
echo uri();
?>
" method="post">

<div style="float:right;width:190px;overflow:hidden;">
<input type="button" value="添加内容" onClick="javascript:location.href='<?php 
echo $base_url;
?>
/index.php?case=table&act=add&table=archive&admin_dir=<?php 
Пример #8
0
    function show_action() {
        if (!front::get('aid'))
            front::$get['aid'] = front::get('id');
        front::check_type(front::$get['aid']);
        $this->view->aid = trim(front::get('aid'));
        $this->view->archive = archive::getInstance()->getrow(front::get('aid'));
        $this->view->categorys = category::getpositionlink2($this->view->archive['catid']);
        if (!is_array($this->view->archive))
            $this->out('message/error.html');
        if ($this->view->archive['checked'] < 1)
            exit(lang('未审核!<a href="'.front::$from.'">返回</a>'));
        if (!rank::arcget(front::get('aid'), $this->view->usergroupid)) {
            $this->out('message/error.html');
        }
        $this->view->catid = $this->view->archive['catid'];
        $this->view->topid = category::gettopparent($this->view->catid);
        $this->view->parentid = $this->category->getparent($this->view->catid);
        if (!rank::catget($this->view->catid, $this->view->usergroupid))
            $this->out('message/error.html');
        if (!isset($this->category->category[$this->view->catid]) ||
                !isset($this->category->category[$this->view->topid])) {

        }
        $template = @$this->view->archive['template'];
        $linkword = new linkword();
        $linkwords = $linkword->getrows(null, 1000, 'linkorder desc');
        $content = $this->view->archive['content'];
        $contents = preg_split('%<div style="page-break-after(.*?)</div>%si', $content);
        if ($contents) {
            $this->view->pages = count($contents);
            front::$record_count = $this->view->pages * config::get('list_pagesize');
            $content = $contents[$this->view->page - 1];
        }

        //$content = preg_replace("/(<a(.*))(>)(.*)(<)(\/a>)/isU", '\\1-]-\\4-[-\\6', $content);

        foreach ($linkwords as $linkword) {
            $linkword['linktimes'] = (int) $linkword['linktimes'];
            if (trim($linkword['linkurl']) && !preg_match('%^http://$%', trim($linkword['linkurl']))) {
                $link = "<a href='$linkword[linkurl]' target='_blank'>$linkword[linkword]</a>";
            } else {
                $link = "<a href='" . url('archive/search/keyword/' . urlencode($linkword['linkword'])) . "' target='_blank'>$linkword[linkword]</a>";
            }
            $content = _keylinks($content,$linkword['linkword'],$link,$linkword['linktimes']);
        }

        $this->view->likenews = $this->getLike($this->view->archive['tag'], $this->view->archive['keyword']);

        $taghtml = '';
        $tag_table = new tag();
        foreach ($tag_table->urls($this->view->archive['tag']) as $tag => $url) {
            $taghtml.="<a href='$url' target='_blank'>$tag</a>&nbsp;&nbsp;";
        }
        $this->view->archive['tag'] = $taghtml;

        $this->view->archive['special'] = null;
        if ($this->view->archive['spid']) {
            $spurl = special::url($this->view->archive['spid'],special::getishtml($this->view->archive['spid']));
            $sptitle = special::gettitle($this->view->archive['spid']);
            $this->view->archive['special'] = "<a href='$spurl' target='_blank'>$sptitle</a>&nbsp;&nbsp;";
        }
        $this->view->archive['type'] = null;
        if ($this->view->archive['typeid']) {
            $typeurl = type::url($this->view->archive['typeid'],1);
            $typetitle = type::name($this->view->archive['typeid']);
            $this->view->archive['type'] = "<a href='$typeurl' target='_blank'>$typetitle</a>&nbsp;&nbsp;";
        }
        $this->view->archive['area'] = null;
        $this->view->archive['area'] = area::getpositonhtml($this->view->archive['province_id'], $this->view->archive['city_id'], $this->view->archive['section_id']);
        $this->view->archive['content'] = $content;
        $aid = front::$get['aid'];
        $catid = $this->view->catid;
        if(!$this->view->archive['showform']) {
            $this->getshowform($catid);
        }else if($this->view->archive['showform'] && $this->view->archive['showform'] == '1') {
            $this->showform = 1;
        }else {
            $this->showform = $this->view->archive['showform'];
        }
        if(preg_match('/^my_/is',$this->showform)) {
            $this->view->archive['showform'] = $this->showform;
            $o_table = new defind($this->showform);
            front::$get['form'] = $this->showform;
            $this->view->primary_key = $o_table->primary_key;
            $field = $o_table->getFields();
            $fieldlimit = $o_table->getcols('user_modify');
            helper::filterField($field,$fieldlimit);
            $this->view->field = $field;
        }else {
            $this->view->archive['showform'] = '';
        }
        
        $str = "";
        cb_data($this->view->archive);
        foreach( $this->view->archive as $key => $value){
        	if(!preg_match('/^my/',$key) || !$value)
        		continue;
        	$category = category::getInstance();
        	$sonids = $category->sons(setting::$var['archive'][$key]['catid']);
        	if(setting::$var['archive'][$key]['catid'] != $this->view->archive['catid'] && !in_array($this->view->archive['catid'],$sonids) && (setting::$var['archive'][$key]['catid'])){
        		unset($this->view->field[$key]);
        		continue;
        	}
        	$str .= '<p> '.setting::$var['archive'][$key]['cname'].':'. $value.'</p>';
        }
        $this->view->archive['my_fields'] = $str;

        $sql1 = "SELECT aid,title,catid FROM `{$this->archive->name}` WHERE catid = '$catid' AND aid > '$aid' ORDER BY aid ASC LIMIT 0,1";
        $sql2 = "SELECT aid,title,catid FROM `{$this->archive->name}` WHERE catid = '$catid' AND aid < '$aid' ORDER BY aid DESC LIMIT 0,1";
        $n = $this->archive->rec_query_one($sql1);
        $p = $this->archive->rec_query_one($sql2);
        $this->view->archive['p'] = $p;
        $this->view->archive['n'] = $n;
        $this->view->archive['p']['url'] = archive::url($p);
        $this->view->archive['n']['url'] = archive::url($n);

        $this->view->archive['strgrade'] = archive::getgrade($this->view->archive['grade']);
        $prices = getPrices($this->view->archive['attr2']);
        $this->view->archive['attr2'] = $prices['price'];
        $this->view->archive['oldprice'] = $prices['oldprice'];
		$this->view->groupname = $prices['groupname'];
		
		//$this->view->archive['pics'] = unserialize($this->view->archive['pics']);
		if(is_array($this->view->archive['pics']) && !empty($this->view->archive['pics'])){
			foreach ($this->view->archive['pics'] as $k => $v){
				if(strtolower(substr($v,0,7)) == 'http://'){
					$this->view->archive['pics'][$k] = $v;
				}else{
					$this->view->archive['pics'][$k] = $v;
				}
			}
		}
		//$this->view->archive['pics'] = unserialize($this->view->archive['pics']);
		//var_dump($this->view->archive);

        if (front::get('t') == 'wap') {
        	$tpl = category::gettemplate($this->view->catid, 'showtemplatewap');
        	if(!$tpl) $tpl = 'wap/show.html';
            $this->out($tpl);
            return;
        }

        if ($template && file_exists(TEMPLATE . '/' . $this->view->_style . '/' . $template))
            $this->out($template);
        else {
            $tpl = category::gettemplate($this->view->catid, 'showtemplate');
            if (category::getarcishtml($this->view->archive)) {
                $path = ROOT . archive::url($this->view->archive);
                if (!preg_match('/\.[a-zA-Z]+$/', $path))
                    $path = rtrim(rtrim($path, '/'), '\\') . '/index.html';
                $this->cache_path = $path;
            }
            $this->out($tpl);
        }
    }
Пример #9
0
 public function build_mk_cache()
 {
     //获取站点信息
     $this->site = $this->pub_config->get_site_first('*', $this->site_id);
     $css_js_filein_tem = true;
     //获取客户端详细信息
     $this->client = $this->pub_config->get_client_first($this->client_type);
     //设置文件生成方式
     $this->page_info['file_mktype'] = $this->site['produce_format'];
     $this->page_info['filename'] = $this->site['indexname'] ? $this->site['indexname'] : 'index';
     $this->page_info['weburl'] = $this->site['site_info']['url'];
     $this->page_info['dir'] = $this->site['site_dir'];
     $this->page_info['custom_content_dir'] = $this->site['custom_content_dir'];
     $this->page_info['custom_content_dir'] = $this->site['custom_content_dir'];
     $this->page_info['tem_material_dir'] = get_site_temdir($this->site);
     $this->page_info['tem_material_url'] = get_site_temurl($this->site);
     //如果有页面id
     if ($this->page_id) {
         $page_type = common::get_page_manage($this->site_id, $this->page_id, 'id');
         $page_type_detail = $page_type[$this->page_id];
         if ($page_type_detail['sign'] == 'special') {
             //查询专题的生成目录
         } else {
             if ($page_type_detail['sign']) {
                 //设置文件生成方式
                 $this->page_info['file_mktype'] = isset($page_type_detail['maketype']) ? $page_type_detail['maketype'] : 1;
                 $this->page_info['filename'] = isset($page_type_detail['colindex']) ? $page_type_detail['colindex'] : 'index';
                 $this->page_info['weburl'] = $page_type_detail['column_domain'];
                 $this->page_info['dir'] .= $page_type_detail['column_dir'];
             }
         }
         //如果有页面数据id,
         if ($this->page_data_id && $page_type_detail['sign'] != 'special') {
             $page_data = common::get_page_data($this->page_id, '', '', '', $page_type_detail, $this->page_data_id);
             $page_data_detail = $page_data['page_data'][0];
             if (!$page_data_detail) {
                 $this->set_error('未取得page_data_id:' . $this->page_id . '_' . $this->page_data_id . var_export($page_data, true) . '详细信息');
             }
             $this->column = $page_data_detail;
             //设置文件生成方式
             if (in_array($this->content_type, $this->content_type_true)) {
                 $this->page_info['file_mktype'] = $page_data_detail['maketype'];
             } else {
                 $this->page_info['file_mktype'] = $page_data_detail['col_con_maketype'];
                 //表示内容正文(目前生成分页正文全文链接有作用)
                 $this->page_info['page_content_type'] = 1;
             }
             //设置文件生成方式
             $this->page_info['filename'] = $page_data_detail['colindex'];
             $this->page_info['weburl'] = $page_data_detail['column_domain'];
             $this->page_info['dir'] .= $page_data_detail['column_dir'];
             $this->page_info['column_dir'] .= $page_data_detail['column_dir'];
             $this->page_info['relate_dir'] .= $page_data_detail['relate_dir'];
         }
     }
     $this->page_info['suffix'] = $this->page_info['file_mktype'] == 1 ? '.html' : '.php';
     //内容页计算出内容的url
     if (in_array($this->content_type, $this->content_type_true)) {
         $this->is_page_content = false;
     }
     //取单元,设有缓存
     if ($this->page_id_c && $this->page_data_id_c) {
         //专题模块查询出该专题详细信息
         include_once ROOT_PATH . 'lib/class/special.class.php';
         $special_obj = new special();
         $this->special_detail = $special_obj->get_special_by_id($this->page_data_id_c);
         //$cell_ret             = common::get_special_cell_list($this->page_data_id_c, $this->template_sign, 0, $this->page_info['tem_material_url'] . '/' . $this->settings['template_name']);
         $cell_ret = common::getTemplateAndCell(0, 0, $this->page_data_id_c, 0, $this->page_info['tem_material_url'] . '/' . $this->settings['template_name'], $this->template_sign);
         if (is_array($this->special_detail) && $this->special_detail) {
             //$this->page_info['column_dir'] .= $this->special_detail['column_dir'];
             $this->page_info['file_mktype'] = $this->special_detail['maketype'];
             $this->page_info['suffix'] = $this->page_info['file_mktype'] == 1 ? '.html' : '.php';
         }
         //表示内容正文(目前生成分页正文全文链接有作用)
         $this->page_info['page_content_type'] = 0;
     } else {
         if ($page_type_detail['sign'] == 'special') {
             //专题模块查询出该专题详细信息
             include_once ROOT_PATH . 'lib/class/special.class.php';
             $special_obj = new special();
             //根据专题子栏目查询出专题
             $this->special_detail = $special_obj->get_mkspecial('', $this->page_data_id);
             //查询出这个专题的发布目录
             if ($this->special_detail && is_array($this->special_detail)) {
                 $this->special_column = $this->special_detail['special_column'];
                 $this->page_info['column_dir'] .= $this->special_detail['column_dir'];
                 $this->page_info['relate_dir'] = $this->special_detail['relate_dir'];
                 $this->page_info['special_dir'] = $this->special_detail['special_dir'];
                 $this->page_info['file_mktype'] = $this->special_detail['maketype'];
                 $this->page_info['filename'] = $this->special_detail['colindex'];
                 $this->page_info['dir'] .= $this->special_detail['column_dir'];
                 $this->page_info['suffix'] = $this->page_info['file_mktype'] == 1 ? '.html' : '.php';
                 $this->page_info['page_type'] = 'special';
                 $this->template_sign = $this->special_detail['template_sign'];
                 $this->column['name'] = $this->special_detail['title'];
                 $this->column['keywords'] = $this->special_detail['keywords'];
                 $this->column['content'] = $this->special_detail['brief'];
                 $this->page_data_id_s = $this->special_detail['id'];
                 $this->content_type_s = $this->page_data_id . 's';
             } else {
                 $this->set_error('未取到专题信息,专题的栏目id:' . $this->page_data_id . ';专题返回数据(get_mkspecial):' . var_export($this->special_detail, true));
             }
             //$cell_ret = common::get_special_cell_list($this->special_detail['id'], $this->template_sign, $this->page_data_id, $this->page_info['tem_material_url'] . '/' . $this->settings['template_name']);
             $cell_ret = common::getTemplateAndCell(0, 0, $this->special_detail['id'], $this->page_data_id, $this->page_info['tem_material_url'] . '/' . $this->settings['template_name'], $this->template_sign);
         } else {
             //$cell_ret = common::get_cell_list($this->site_id, $this->page_id, $this->page_data_id, $this->content_type, $this->template_sign);
             $cell_ret = common::getTemplateAndCell($this->site_id, $this->page_id, $this->page_data_id, $this->content_type, $this->page_info['tem_material_url'] . '/' . $this->settings['template_name']);
         }
     }
     /**
             foreach($cell_ret['default_cell'] as $k=>$v)
             {
        if($v['layout_id'])
        {
            $cell_ret['default_cell'][$k]['id']=$v['id'].'_'.$v['layout_id'];
        }
             }
     */
     //当前使用中的套系标识
     $template_style = $cell_ret['curr_style'] ? $cell_ret['curr_style'] : 'default';
     //当前模板标识
     $template_sign = $cell_ret['template_sign'];
     //获取模板,设有缓存
     if ($this->page_id_c && $this->page_data_id_c || $page_type_detail['sign'] == 'special') {
         foreach ($cell_ret['default_cell'] as $k => $v) {
             if ($v['layout_id']) {
                 $cell_ret['default_cell'][$k]['id'] = $v['id'] . '_' . $v['layout_id'];
             }
         }
         $this->template_set = $cell_ret['template'];
         //$this->template_set = common::get_template_cache($template_sign, $template_style, $this->settings['special_template']['site_id'], $this->page_info['tem_material_url'] . '/' . $this->settings['template_name']);
     } else {
         $this->template_set = $cell_ret['template'];
         //$this->template_set = common::get_template_cache($template_sign, $template_style, $this->site_id, $this->page_info['tem_material_url'] . '/' . $this->settings['template_name']);
     }
     //页面标题关键字描述的插入到模板中
     if (!$this->is_page_content) {
         $this->template_set = template_process($this->template_set, $this->site, $this->column);
     } else {
         $this->template_set = template_process($this->template_set, $this->site, $this->column, true);
     }
     //取出单元用到的数据源,样式
     $this->cell_process($cell_ret);
     //js加入栏目信息到源码中
     $column_detail_codearr = array('id' => $page_data_detail['id'], 'title' => $page_data_detail['name'], 'keywords' => $page_data_detail['keywords']);
     $column_detail_codestr = "\n" . "<script type=\"text/javascript\">var m2o_column=" . json_encode($column_detail_codearr) . ";";
     $m2o_content_detail_codearr = '<?php 
                     $m2o_content_detail_codearr = array(
                     \'id\' => $__info[\'content\'][\'content_id\'],
                     \'title\' => $__info[\'content\'][\'title\'],
                     \'keywords\' => $__info[\'content\'][\'keywords\'],
                     \'bundle_id\' => $__info[\'content\'][\'bundle_id\'],
                     \'module_id\' => $__info[\'content\'][\'module_id\'],
                     \'content_id\' => $__info[\'content\'][\'content_id\'],
                     \'content_fromid\' => $__info[\'content\'][\'content_fromid\'],
                     \'rid\' => $__info[\'content\'][\'rid\'],
                 );
                 echo json_encode($m2o_content_detail_codearr);
                 ?>';
     $column_detail_codestr .= "var m2o_content = '" . $m2o_content_detail_codearr . "';";
     $column_detail_codestr .= "</script>" . "\n";
     $this->template_set = str_ireplace('</head>', $column_detail_codestr . '</head>', $this->template_set);
     //css加载到模板中
     if (!$this->is_page_content) {
         $this->template_set = str_ireplace('</head>', $this->css . "\n" . '</head>', $this->template_set);
         $this->css = '';
     } else {
         //计算js,css路径,外链到模板head中去
         //页面素材域名
         if ($this->page_id_c && $this->page_data_id_c) {
             $mar_dir = $this->page_id_c . '/' . $this->page_data_id_c . '/' . $this->content_type . '/';
             $css_filename = $this->page_id_c . '_' . $this->page_data_id_c . '_' . $this->content_type . '_' . $this->client_type . '.css';
         } else {
             $mar_dir = $this->page_id . '/' . $this->page_data_id . '/' . $this->content_type . '/';
             $css_filename = $this->page_id . '_' . $this->page_data_id . '_' . $this->content_type . '_' . $this->client_type . '.css';
         }
         //计算css路径
         $this->mar_css['mar_css_dir'] = $this->page_info['tem_material_dir'] . '/' . $this->settings['template_name'] . '/' . $mar_dir;
         $this->mar_css['mar_css_filename'] = $css_filename;
         $css_link = '<link  rel="stylesheet" type="text/css" href="' . $this->page_info['tem_material_url'] . '/' . $this->settings['template_name'] . '/' . $mar_dir . $css_filename . '" />';
         $this->template_set = str_ireplace('</head>', $css_link . "\n" . '</head>', $this->template_set);
     }
     //js添加到</body>之前
     if ($this->js) {
         $this->template_set = str_ireplace('</body>', $this->js . "\n" . '</body>', $this->template_set);
         $this->js = '';
     }
     //生成头部文件
     $this->include_head($cell_ret);
     //生成缓存文件
     $this->set_cache();
     //复制数据源缓存到lib/m2o/include
     if (is_dir(CUR_CONF_PATH . 'cache/datasource')) {
         if (!file_copy(CUR_CONF_PATH . 'cache/datasource', CUR_CONF_PATH . 'lib/m2o/include', array())) {
             $this->set_error('模板服务器:' . realpath(CUR_CONF_PATH . 'lib/m2o/include') . '目录不可写');
         }
     }
 }
Пример #10
0
"><?php 
    echo $sp['title'];
    ?>
</a></li>
<?php 
}
?>
</ul>
<!-- 内容列表结束 -->

<div class="blank30"></div>

<!-- 列表分页开始 -->
<?php 
if (isset($pages)) {
    echo special::pagination($tag);
}
?>
<!-- 列表分页结束 -->

<div class="blank30"></div>
<a title="<?php 
echo lang(gotop);
?>
" href="#" class="clear floatright"><img alt="<?php 
echo lang(gotop);
?>
" src="<?php 
echo $skin_url;
?>
/images/gotop.gif"></a>
    function send()
    {
        $db = JFactory::getDBO();
        ## Making the query for getting the orders
        $sql = 'SELECT  a.*, c.name, c.emailaddress, c.firstname, e.eventname,  t.ticket_size, t.ticket_orientation, t.combine_multitickets
			  FROM #__ticketmaster_orders AS a, #__ticketmaster_clients AS c, #__ticketmaster_events AS e, #__ticketmaster_tickets AS t 
			  WHERE a.userid = c.userid
			  AND a.eventid = e.eventid
			  AND t.ticketid = a.ticketid
			  AND ordercode = ' . (int) $this->eid . '';
        $db->setQuery($sql);
        $info = $db->loadObjectList();
        $k = 0;
        $row =& $info[0];
        if ($row->combine_multitickets && count($info) > 1) {
            $fname = $this->combinetickets($info);
            $attachment[] = $fname;
            $name = $row->name;
            $email = $row->emailaddress;
            $event = $row->eventname;
        } else {
            for ($i = 0, $n = count($info); $i < $n; $i++) {
                $row =& $info[$i];
                ## Tickets are saved as: eTicket-1000
                ## Create attachments the same as saved
                $attachment[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'eTicket-' . $row->orderid . '.pdf';
                $name = $row->name;
                $email = $row->emailaddress;
                $event = $row->eventname;
                $k = 1 - $k;
            }
        }
        ## We do now need to get the mail that wil send the ticket.
        ## Using email ID: #1
        ## We need to select all information.
        $sql = "SELECT * FROM #__ticketmaster_emails WHERE emailid = 1 ";
        $db->setQuery($sql);
        $mail = $db->loadObject();
        #### NEW FOR 3.0.2 - EXTRA DATA IN THE EMAIL FOR TICKETS! ####
        $path_include = JPATH_SITE . DS . 'components' . DS . 'com_ticketmaster' . DS . 'assets' . DS . 'functions.php';
        include_once $path_include;
        ## Loading the configuration table.
        $sql = 'SELECT * FROM #__ticketmaster_config WHERE configid = 1';
        $db->setQuery($sql);
        $configuration = $db->loadObject();
        $sql = 'SELECT  a.*, t.*, e.eventname, c.*, 
			  t.ticketdate, t.starttime, t.location, t.locationinfo, a.paid, e.groupname, t.eventcode
			  FROM #__ticketmaster_orders AS a, #__ticketmaster_clients AS c,
			  #__ticketmaster_events AS e, #__ticketmaster_tickets AS t
			  WHERE a.userid = c.userid
			  AND a.eventid = e.eventid
			  AND a.ticketid = t.ticketid
			  AND ordercode = ' . $this->eid . '
			  GROUP BY a.orderid';
        $db->setQuery($sql);
        $data = $db->loadObjectList();
        include_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'classes' . DS . 'special.tickets.class.php';
        if ($configuration->send_multi_ticket_only == 1) {
            ## Create the new multi ticket.
            $multi = new special((int) $this->eid);
            $multi->create();
            ## Clearing the old fashion PDF:
            unset($attachment);
            ## Send the multi ticket only as attachment: multi-[ordercode]
            $attachment[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'multi-' . (int) $this->eid . '.pdf';
            $attachment_admin[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'multi-' . (int) $this->eid . '.pdf';
        }
        $sql = 'SELECT COUNT(orderid) AS total 
		      FROM #__ticketmaster_orders 
			  WHERE ordercode = ' . (int) $this->eid . '
			  AND paid = 0';
        $ordering_code = $this->eid;
        $db->setQuery($sql);
        $status = $db->loadObjectList();
        if ($status->total > 0) {
            $paymentstatus = '<font color="#FF0000">' . JText::_('COM_TICKETMASTER_ORDERSTATUS_UNPAID') . '</font>';
        } else {
            $paymentstatus = '<font color="#006600">' . JText::_('COM_TICKETMASTER_ORDERSTATUS_PAID') . '</font>';
        }
        $orders = '<ul>';
        $k = 0;
        for ($i = 0, $n = count($data); $i < $n; $i++) {
            $row = $data[$i];
            $price = showprice($configuration->priceformat, $row->ticketprice, $configuration->valuta);
            $ticketdate = date($configuration->dateformat, strtotime($row->ticketdate));
            if ($row->firstname != '') {
                $customer = $row->firstname . ' ' . $row->name;
            } else {
                $customer = $row->name;
            }
            $recipient = $row->emailaddress;
            $userid = $row->userid;
            $orders .= '<li>[ ' . $row->orderid . ' ] - [ ' . $ticketdate . ' ] - <strong>' . $row->ticketname . '</strong> [ ' . $price . ' ]</li>';
            $k = 1 - $k;
        }
        $orders .= '</ul>';
        ## Including required paths to calculator.
        $path_include = JPATH_SITE . DS . 'components' . DS . 'com_ticketmaster' . DS . 'assets' . DS . 'helpers' . DS . 'get.amount.php';
        include_once $path_include;
        ## Get the paid amount:
        $to_be_paid = _getAmount($ordering_code);
        $price = showprice($configuration->priceformat, $to_be_paid, $configuration->valuta);
        $total_tickets = count($data);
        #### END ADDONG FOR EMAIL ####
        $countattachments = count($attachment);
        $message = str_replace('%%NAME%%', $customer, $mail->mailbody);
        $subject = str_replace('%%EVENTNAME%%', $event, $mail->mailsubject);
        $message = str_replace('%%ORDERCODE%%', $this->eid, $message);
        $message = str_replace('%%TICKETS%%', $total_tickets, $message);
        $message = str_replace('%%PRICE%%', $price, $message);
        $message = str_replace('%%ORDERLIST%%', $orders, $message);
        $message = str_replace('%%PAYMENTSTATUS%%', $paymentstatus, $message);
        $message = str_replace('%%COMPANYNAME%%', $configuration->companyname, $message);
        $message = str_replace('%%COMPANYADDRESS%%', $configuration->address1, $message);
        $message = str_replace('%%COMPANYCITY%%', $configuration->city, $message);
        $message = str_replace('%%PHONENUMBER%%', $configuration->phone, $message);
        if ($countattachments > 0) {
            ## Imaport mail functions:
            jimport('joomla.mail.mail');
            ## Set the sender of the email:
            $sender[0] = $mail->from_email;
            $sender[1] = $mail->from_name;
            ## Compile mailer function:
            $obj = JFactory::getMailer();
            $obj->setSender($sender);
            $obj->isHTML(true);
            $obj->setBody($message);
            $obj->addRecipient($email);
            if ($configuration->send_pdf_tickets == 1) {
                $obj->addAttachment($attachment);
            }
            ## Send blind copy to site admin?
            if ($mail->receive_bcc == 1) {
                if ($mail->reply_to_email != '') {
                    $obj->addRecipient($mail->reply_to_email);
                }
            }
            ## Add reply to and subject:
            $obj->addReplyTo($sender);
            $obj->setSubject($subject);
            if ($mail->published == 1) {
                $sent = $obj->Send();
            }
            ## Add the ordercode & userid to $vars
            $vars['ordercode'] = $this->eid;
            $vars['userid'] = $userid;
            ## TRIGGER INVOICING PLUGIN AND RELATED onAfterSendTickets
            JPluginHelper::importPlugin('rdmediahelpers');
            $dispatcher = JDispatcher::getInstance();
            $dispatcher->trigger('OnAfterSentTickets', array($vars));
            if ($configuration->send_multi_ticket_admin == 1) {
                ## Check if the multi ticket is there:
                $attachment = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'multi-' . (int) $this->eid . '.pdf';
                if (!file_exists($attachment)) {
                    ## Create the new multi ticket.
                    $multi = new special((int) $this->eid);
                    $multi->create();
                    ## Send the multi ticket only as attachment: multi-[ordercode]
                    $attachment = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'multi-' . (int) $this->eid . '.pdf';
                }
                ## Now preapre message for the admin:
                $admin = JFactory::getMailer();
                ## Set the sender of the email:
                $sender[0] = $mail->from_email;
                $sender[1] = $mail->from_name;
                ## Compile mailer function:
                $admin->setSender($sender);
                $admin->isHTML(true);
                $admin->setBody($message);
                $admin->addRecipient($configuration->email);
                $admin->addAttachment($attachment);
                $admin->addReplyTo($sender);
                $admin->setSubject($subject);
                $sent = $admin->Send();
            }
        }
        ## Updating the order, PDF sent = 1
        $query = 'UPDATE #__ticketmaster_orders' . ' SET pdfsent = 1' . ' WHERE ordercode = ' . (int) $this->eid . '';
        ## Do the query now
        $db->setQuery($query);
        ## When query goes wrong.. Show message with error.
        if (!$db->query()) {
            exit('Query went wrong in sendonpayment.class.php');
            return false;
        }
        ## Updating the order, PDF sent = 1
        $query = 'UPDATE #__ticketmaster_tickets' . ' SET ticketssent = ticketssent+' . (int) $countattachments . '' . ' WHERE ticketid = ' . (int) $info->ticketid . '';
        ## Do the query now
        $db->setQuery($query);
        ## When query goes wrong.. Show message with error.
        if (!$db->query()) {
            $this->setError($db->getErrorMsg());
            return false;
        }
    }
    function send()
    {
        $db = JFactory::getDBO();
        ## Clearing!
        $this->info = '';
        $this->error = '';
        ## Making the query for getting the orders
        $sql = 'SELECT  a.*, c.name, c.emailaddress, c.firstname, e.eventname,  t.ticket_size, t.ticket_orientation, t.combine_multitickets
			  FROM #__ticketmaster_orders AS a, #__ticketmaster_clients AS c, #__ticketmaster_events AS e, #__ticketmaster_tickets AS t 
			  WHERE a.userid = c.userid
			  AND a.eventid = e.eventid
			  AND t.ticketid = a.ticketid
			  AND ordercode = ' . (int) $this->eid . '';
        $db->setQuery($sql);
        $info = $db->loadObjectList();
        $k = 0;
        $row = $info[0];
        $sql = "SELECT send_multi_ticket_only FROM #__ticketmaster_config WHERE configid = 1";
        $db->setQuery($sql);
        $config = $db->loadObject();
        if ($config->send_multi_ticket_only == 1) {
            $attachment[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'multi-' . $this->eid . '.pdf';
            if (!file_exists($attachment)) {
                ## Create the new multi ticket.
                include_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'classes' . DS . 'special.tickets.class.php';
                $multi = new special((int) $this->eid);
                $multi->create();
                ## Send the multi ticket only as attachment: multi-[ordercode]
                $attachment = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'multi-' . (int) $this->eid . '.pdf';
            }
            $name = $row->name;
            $firstname = $row->firstname;
            $email = $row->emailaddress;
        } else {
            if ($row->combine_multitickets && count($info) > 1) {
                $fname = $this->combinetickets($info);
                $attachment[] = $fname;
                $name = $row->name;
                $firstname = $row->firstname;
                $email = $row->emailaddress;
                $event = $row->eventname;
            } else {
                for ($i = 0, $n = count($info); $i < $n; $i++) {
                    $row =& $info[$i];
                    ## Tickets are saved as: eTicket-1000
                    ## Create attachments the same as saved
                    $attachment[] = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_ticketmaster' . DS . 'tickets' . DS . 'eTicket-' . $row->orderid . '.pdf';
                    $name = $row->name;
                    $firstname = $row->firstname;
                    $email = $row->emailaddress;
                    $event = $row->eventname;
                    $k = 1 - $k;
                }
            }
        }
        ## We do now need to get the mail that wil send the ticket.
        ## Using email ID: #1
        ## We need to select all information.
        $sql = "SELECT * FROM #__ticketmaster_emails WHERE emailid = 8";
        $db->setQuery($sql);
        $mail = $db->loadObject();
        $countattachments = count($attachment);
        $message = str_replace('%%NAME%%', $name, $mail->mailbody);
        $message = str_replace('%%FIRSTNAME%%', $firstname, $message);
        $message = str_replace('%%EVENTNAME%%', $event, $message);
        $subject = str_replace('%%EVENTNAME%%', $event, $mail->mailsubject);
        if ($countattachments > 0) {
            ## Imaport mail functions:
            jimport('joomla.mail.mail');
            ## Set the sender of the email:
            $sender[0] = $mail->from_email;
            $sender[1] = $mail->from_name;
            ## Compile mailer function:
            $obj = JFactory::getMailer();
            $obj->setSender($sender);
            $obj->isHTML(true);
            $obj->setBody($message);
            $obj->addRecipient($email);
            $obj->addAttachment($attachment);
            ## Send blind copy to site admin?
            if ($mail->receive_bcc == 1) {
                if ($mail->reply_to_email != '') {
                    $obj->addRecipient($mail->reply_to_email);
                }
            }
            ## Add reply to and subject:
            $obj->addReplyTo($sender);
            $obj->setSubject($subject);
            if ($mail->published == 1) {
                $sent = $obj->Send();
            }
        }
    }
Пример #13
0
 /**
  * 取专题栏目的路径
  */
 public function get_special_column_path()
 {
     $column_id = $this->input['column_id'];
     if (!$column_id) {
         $this->ReportError('ID为空');
     }
     if (!class_exists('special')) {
         include ROOT_DIR . 'lib/class/special.class.php';
     }
     $special = new special();
     $ret['selected_ids'] = $column_id ? $column_id : '';
     $ret['selected_items'] = $special->get_special_column_byid($ret['selected_ids']);
     if (is_array($ret['selected_items'])) {
         foreach ($ret['selected_items'] as $index => $item) {
             $hg_print_selected[$index] = array();
             $current =& $hg_print_selected[$index];
             $current['showName'] = $item['name'];
             $current['id'] = $item['id'];
             $current['name'] = $item['name'];
             $selected_names[] = $current['name'];
         }
     }
     $ret['selected_items'] = $hg_print_selected;
     $ret['selected_names'] = isset($selected_names) ? implode(',', $selected_names) : '';
     echo json_encode($ret);
     exit;
 }
 */
$tplarray=include(ROOT.'/template/'.config::get('template_dir').'/tpltag/tag.config.php');
$tplarray=$tplarray['content'];
$tag_config=$data['setting'];
?>


        <?php
        echo "<tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">栏目<td width="1%">&nbsp;</td><td width="70%">'.form::select('catid', $tag_config['catid'], category::option());
        echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">子栏目<td width="1%">&nbsp;</td><td width="70%">'.form::select('son', $tag_config['son'], array("否","是"));
		echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">分类<td width="1%">&nbsp;</td><td width="70%">'.form::select('typeid', $tag_config['typeid'], type::option());
         echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">专题<td width="1%">&nbsp;</td><td width="70%">'.form::select('spid', $tag_config['spid'], special::option());
         echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">地区<td width="1%">&nbsp;</td><td width="70%">';
        echo form::select('province_id', $tag_config['province_id'], area::province_option());
        echo form::select('city_id', $tag_config['city_id'], area::city_option());
        echo form::select('section_id', $tag_config['section_id'], area::section_option());
         echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">标题截取字数<td width="1%">&nbsp;</td><td width="70%">';
        echo form::input('length', $tag_config['length'], 'class="input_c"');
		echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
		echo '<td width="19%" align="right">简介截取字数<td width="1%">&nbsp;</td><td width="70%">';
        echo form::input('introduce_length', $tag_config['introduce_length'], 'class="input_c"').'-1:不限制 0:不调用';
        echo "</td></tr><tr onmouseover=this.bgColor='#FFFFF0'; onmouseout=this.bgColor=''; bgcolor=''>";
        echo '<td width="19%" align="right">排序方式<td width="1%">&nbsp;</td><td width="70%">';
        echo form::select('ordertype', $tag_config['ordertype'],
                array(
    <?php 
    } else {
        ?>
    <a href="<?php 
        echo special::url($spid, 0, $p);
        ?>
"><?php 
        echo $p;
        ?>
</a>
    <?php 
    }
    ?>

    <?php 
}
?>
    <?php 
if (pages('down')) {
    ?>
    <a href="<?php 
    echo special::url($spid, 0, pages('down'));
    ?>
"><?php 
    echo lang(downpage);
    ?>
</a>
    <?php 
}
?>
</div>
Пример #16
0
            <?php echo form::select('province_id',
    get('province_id') ? get('province_id') : 0, area::province_option()); ?>
<?php echo form::select('city_id', get('city_id') ? get('scity_id') : 0,
        area::city_option()); ?>
<?php echo form::select('section_id', get('section_id') ? get('section_id') : 0, area::section_option()); ?>
<span class="hotspot" onmouseover="tooltip.show('对内容进行地区划分,可区别不同内容!');" onmouseout="tooltip.hide();">
		<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
		</span>
        </td>
    </tr>
    <tr>
        <td width="19%" align="right">专题</td>
        <td width="1%">&nbsp;</td>
        <td width="70%">
<?php echo form::select('spid',
        $data['spid'], special::option()); ?>
		<span class="hotspot" onmouseover="tooltip.show('将内容划分到不同专题内,可对不同内容进行区分!');" onmouseout="tooltip.hide();">
		<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
		</span>
        </td>
    </tr>
    <tr>
        <td width="19%" align="right">产品价格</td>
        <td width="1%">&nbsp;</td>
        <td width="70%">{form::getform('attr2',$form,$field,$data)}
		<span class="hotspot" onmouseover="tooltip.show('请填写大于0的数字型字符!');" onmouseout="tooltip.hide();">
		<img src="{$skin_path}/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
		</span>
		</td>
    </tr>
    <tr>
Пример #17
0
     $all ? msg($MOD['name'] . '生成成功', $this_forward) : dmsg($MOD['name'] . '生成成功', $this_forward);
 }
 $catid = isset($catid) ? intval($catid) : '';
 $sql = $catid ? " AND catid={$catid}" : '';
 if (!isset($fid)) {
     $r = $db->get_one("SELECT min(itemid) AS fid FROM {$table} WHERE status=3 {$sql}");
     $fid = $r['fid'] ? $r['fid'] : 0;
 }
 isset($sid) or $sid = $fid;
 if (!isset($tid)) {
     $r = $db->get_one("SELECT max(itemid) AS tid FROM {$table} WHERE status=3 {$sql}");
     $tid = $r['tid'] ? $r['tid'] : 0;
 }
 if ($update) {
     require MD_ROOT . '/special.class.php';
     $do = new special($moduleid);
 }
 isset($num) or $num = 100;
 if ($fid <= $tid) {
     $result = $db->query("SELECT itemid FROM {$table} WHERE status=3 AND itemid>={$fid} {$sql} ORDER BY itemid LIMIT 0,{$num} ");
     if ($db->affected_rows($result)) {
         while ($r = $db->fetch_array($result)) {
             $itemid = $r['itemid'];
             $update ? $do->update($itemid) : tohtml('show', $module);
         }
         $itemid += 1;
     } else {
         $itemid = $fid + $num;
     }
 } else {
     if ($update) {
Пример #18
0
 function get_layout_cell($layout_ids)
 {
     if (!$layout_ids) {
         return array();
     }
     $sql = "SELECT * FROM " . DB_PREFIX . "layout_cell WHERE layout_id IN( " . $layout_ids . ")";
     $q = $this->db->query($sql);
     $cell = array();
     while ($row = $this->db->fetch_array($q)) {
         //专题栏目链接处理
         if (strpos($row['more_href'], 'COLURL') !== false) {
             $intColumnId = intval(str_replace('COLURL', '', $row['more_href']));
             if (!class_exists('special')) {
                 include ROOT_PATH . 'lib/class/special.class.php';
             }
             $objSpecial = new special();
             $row['more_href'] = $objSpecial->get_special_col_url($intColumnId);
         }
         $row['param_asso'] = unserialize($row['param_asso']);
         $mode_info = self::get_mode_info($row['cell_mode'], $row['id'], $row['css_id'], $row['js_id'], $row['param_asso']);
         if ($row['data_source']) {
             $data_source_ids[$row['id']] = $row['data_source'];
             $data_source = self::get_datasource_info($row['data_source'], $row['param_asso']);
             $map = self::get_cell_map($mode_info, $data_source, $row['param_asso']);
         } else {
             $map = self::get_mode_map($mode_info);
         }
         $cache_file = $row['id'] . '.php';
         include_once CUR_CONF_PATH . 'lib/parse.class.php';
         $parse = new Parse();
         $content = $mode_info['mode_info']['content'];
         $parse->parse_template($content, $row['id'], $mode_info['mode_info'], $map['relation_map'], $map['mode_variable_map'], $map['variable_function_relation']);
         $parse->built_mode_cache($cache_file);
         $cell[$row['layout_id']][$row['id'] . '_' . $row['cell_name']] = array_merge($row, $mode_info);
         $cell[$row['layout_id']][$row['id'] . '_' . $row['cell_name']]['mode_detail'] = $cell[$row['layout_id']][$row['id']]['mode_info'];
         unset($cell[$row['layout_id']][$row['id'] . '_' . $row['cell_name']]['mode_info']);
         $cell[$row['layout_id']][$row['id'] . '_' . $row['cell_name']]['data_source_info'] = $data_source['info'];
         $cell[$row['layout_id']][$row['id'] . '_' . $row['cell_name']]['input_param'] = $data_source['input_param'];
         $cell[$row['layout_id']][$row['id'] . '_' . $row['cell_name']]['input_param_other'] = $map['data_input_variable'];
     }
     return array('cell' => $cell, 'data_source' => $data_source_ids);
 }
Пример #19
0
echo form::select('section_id', get('section_id') ? get('section_id') : 0, area::section_option());
?>
<span class="hotspot" onmouseover="tooltip.show('对内容进行地区划分,可区别不同内容!');" onmouseout="tooltip.hide();">
<img src="<?php 
echo $skin_path;
?>
/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
        </td>
    </tr>
    <tr>
        <td width="19%" align="right">专题</td>
        <td width="1%">&nbsp;</td>
        <td width="70%">
<?php 
echo form::select('spid', $data['spid'], special::option());
?>
<span class="hotspot" onmouseover="tooltip.show('将内容划分到不同专题内,可对不同内容进行区分!');" onmouseout="tooltip.hide();">
<img src="<?php 
echo $skin_path;
?>
/images/remind.gif" alt="" width="14" height="20"  style="margin-left:10px; margin-right:5px;">
</span>
        </td>
    </tr>
    <tr>
        <td width="19%" align="right">产品价格</td>
        <td width="1%">&nbsp;</td>
        <td width="70%"><?php 
echo form::getform('attr2', $form, $field, $data);
?>
Пример #20
0
     $info['column_id'] = array_keys($info['column_id']);
     $info['column_id'] = implode(',', $info['column_id']);
 }
 if ($info['img_info']) {
     $info['img_info'] = unserialize($info['img_info']);
 }
 if ($info['ori_url']) {
     $info['outlink'] = $this->videoUrlParser($info['ori_url']);
 }
 return $info;
Пример #21
0
<div id="tagscontent" class="right_box">

<form name="typeform" method="post" action="<?php echo front::$uri;?>">
<table border="0" cellspacing="0" cellpadding="0" name="table1" id="table1" width="100%">
<tbody>
<tr>
	<td width="19%" align="right">专题</span></td>
	<td width="1%">&nbsp;</td>
                        <td width="70%"><?php
	$archive=archive::getInstance();
	echo form::select('specialid',get('specialid'),special::option());
	?>
	&nbsp;&nbsp;
	<?php echo form::submit('更新');
	?>
    </td></tr></tbody>
</table>
</form>
</div>
Пример #22
0
 /**
  * 处理单元、生成单元的html
  * 
  * @param array $info 单元详细信息
  * @param boolean $force 是否强制生成单元缓存
  * @param array $arData 数据、有此参数时用该数据生成单元hmtl 用于单元预览
  * @param array 处理过后的单元详细信息
  */
 public function cellProcess($info, $force = false, $arData = array())
 {
     if (!$info['cell_mode']) {
         //return array();
     }
     /**********专题栏目链接处理***************************/
     if (strpos($info['more_href'], 'COLURL') !== false) {
         $intColumnId = intval(str_replace('COLURL', '', $info['more_href']));
         if (!class_exists('special')) {
             include ROOT_PATH . 'lib/class/special.class.php';
         }
         $objSpecial = new special();
         $info['more_href'] = $objSpecial->get_special_col_url($intColumnId);
     }
     /**********专题栏目链接处理***************************/
     $mode_info = common::get_mode_info(intval($info['cell_mode']), $info['id'], intval($info['css_id']), intval($info['js_id']), $info['param_asso']);
     $blBuiltCell = $this->blBuiltCell && $this->blBuiltCell !== 'false' ? 1 : 0;
     if ($info['cell_type'] == 3 && $blBuiltCell) {
         $html = $info['static_html'];
     } else {
         $content = $mode_info['mode_info']['content'];
         $content = str_replace('&nbsp;', ' ', $content);
         $ret_data = array();
         if (!$info['data_source']) {
             $map = common::get_mode_map($mode_info);
             if ($blBuiltCell) {
                 $ret_data = !empty($arData) ? $arData : $mode_info['mode_info']['default_param'];
             }
             $ret_data = $info['using_block'] ? common::getBlockData($info['block_id']) : $ret_data;
         } else {
             $data_source = common::get_datasource_info($info['data_source'], $info['param_asso']);
             if ($info['using_block'] && $blBuiltCell) {
                 $ret_data = !empty($arData) ? $arData : common::getBlockData($info['block_id']);
             } else {
                 $map = common::get_cell_map($mode_info, $data_source, $info['param_asso']);
                 if ($blBuiltCell) {
                     $ret_data = common::get_content_by_datasource($info['data_source'], $map['data_input_variable']);
                     if (isset($ret_data['total'])) {
                         $intTotal = $ret_data['total'];
                         $ret_data = $ret_data['data'];
                     }
                     if (!$info['layout_id']) {
                         //替换已经编辑过的单元数据
                         if (!class_exists('cell')) {
                             include CUR_CONF_PATH . 'lib/cell.class.php';
                         }
                         $objCell = new cell();
                         $arCellData = $objCell->getCellData($info['id']);
                         if (is_array($ret_data) && count($ret_data) > 0) {
                             foreach ($ret_data as $k => $v) {
                                 !empty($arCellData[$v['id']]) && ($arCellData[$v['id']]['id'] = $arCellData[$v['id']]['content_id']);
                                 $ret_data[$k] = !empty($arCellData[$v['id']]) ? $arCellData[$v['id']] : $v;
                                 if (!empty($arData)) {
                                     if ($v['id'] == $arData['content_id']) {
                                         //arData 预览提交的数据
                                         $arData['id'] = $arData['content_id'];
                                         $ret_data[$k] = $arData;
                                     }
                                 }
                             }
                         }
                     }
                     if (isset($intTotal)) {
                         $ret_data = array('total' => $intTotal, 'data' => $ret_data);
                     }
                 }
             }
         }
         $cache_file = $info['layout_id'] ? $info['id'] . '_' . $info['layout_id'] . '.php' : $info['id'] . '.php';
         $cache_filepath = MODE_CACHE_DIR . substr(md5($cache_file), 0, 2) . '/';
         include_once CUR_CONF_PATH . 'lib/parse.class.php';
         $parse = new Parse();
         $parse->parse_template(stripcslashes($content), $info['id'], $mode_info['mode_info'], $map['relation_map'], $map['mode_variable_map'], $map['variable_function_relation']);
         if ($blBuiltCell) {
             if (MAGIC_DEBUG) {
                 $path = CUR_CONF_PATH . 'cache/log/data/';
                 hg_mkdir($path);
                 hg_file_write($path . $info['id'] . '.txt', var_export($map['data_input_variable'], 1) . var_export($ret_data, 1));
             }
             $html = $parse->built_cell_html($ret_data, $cache_file, $mode_info['mode_info'], $this->arNeedPageInfo, $this->arPageSiteInfo, $this->arPageColumnInfo, $this->arPageClientInfo, $this->arPageSpecialInfo, $this->arPageSpecialColumnInfo, $map['data_input_variable'], $force, $cache_filepath);
             if ($info['is_header']) {
                 $find = array('{$header_text}', '{$more_href}', '{$more_text}');
                 $replace = array($info['header_text'], $info['is_more'] ? $info['more_href'] : '#', $info['is_more'] ? '更多>>' : '');
                 $header = str_replace($find, $replace, $this->settings['header_dom']['cell']);
                 $html = $header . $html;
             }
             // if (empty($ret_data)) {
             // $html = '<span>暂无数据</span>' . $html;
             // }
         } else {
             $parse->built_mode_cache($cache_file, $cache_filepath);
         }
     }
     $ret = array();
     $ret = array_merge($info, $mode_info);
     $ret['mode_detail'] = $ret['mode_info'];
     //生成时用
     unset($ret['mode_info']);
     !$ret['using_block'] && $ret['data_source'] && ($ret['can_edit'] = 1);
     //有数据源且不是区块单元时单元数据可编辑
     $ret['rended_html'] = $html;
     $ret['input_param'] = $data_source['input_param'];
     $ret['site_id'] = $this->intSiteId;
     $ret['page_id'] = $this->intPageId;
     $ret['page_data_id'] = $this->intPageDataId;
     $ret['content_type'] = $this->intContentType;
     if ($blBuiltCell) {
         $strNsPre = $ret['layout_id'] ? 'layout_cell' : 'cell';
         $ret['css'] = str_replace('<MATEURL>', ICON_URL, preg_replace('/<NS([0-9a-zA-Z]*)>/', '.' . $strNsPre . '_' . $ret['id'] . '_\\1', $ret['css']));
         $ret['js'] = str_replace('<MATEURL>', ICON_URL, preg_replace('/<NS([0-9a-zA-Z]*)>/', '.' . $strNsPre . '_' . $ret['id'] . '_\\1', $ret['js']));
         $ret['rended_html'] = str_replace('<MATEURL>', ICON_URL, preg_replace('/<NS([0-9a-zA-Z]*)>/', $strNsPre . '_' . $ret['id'] . '_\\1', $ret['rended_html']));
         $ret['css'] = preg_replace('/<NNS([0-9a-zA-Z]*)>/', $strNsPre . '_' . $ret['id'] . '_\\1', $ret['css']);
         $ret['js'] = preg_replace('/<NNS([0-9a-zA-Z]*)>/', $strNsPre . '_' . $ret['id'] . '_\\1', $ret['js']);
         $ret['rended_html'] = preg_replace('/<NNS([0-9a-zA-Z]*)>/', $strNsPre . '_' . $ret['id'] . '_\\1', $ret['rended_html']);
         if ($this->input['data'] == 1 || $this->input['return_data'] == 1) {
             if (is_array($ret_data) && count($ret_data) > 0) {
                 foreach ($ret_data as $k => $v) {
                     $ret['data'][] = array('id' => $v['id'], 'title' => $v['title'], 'brief' => $v['brief'], 'indexpic' => $v['indexpic'], 'content_url' => $v['content_url']);
                 }
             }
         }
     }
     return $ret;
 }
Пример #23
0
function special($spid=0,$tpl=null) {
	$special = special::getInstance();
	$where = '';
	if($spid){
		$where = "spid in($spid)";
	}
	$specials = $special->getrows($where);
	$i = 0;
	foreach ($specials as $v){
		$url = $special->url($v['spid'],$v['ishtml']);
		$specials[$i]['url'] = $url;
		$i++;
	}
	if ($tpl) {
		front::$view->_var->specials=$specials;
		return template($tpl);
	}
	else
		return $specials;
}
Пример #24
0
 public function push_special($data, $content_id, $content_relation_id, $check)
 {
     $content_push = array('content_id' => $content_id, 'content_relation_id' => $content_relation_id, 'type' => 1, 'relation_data' => serialize($data['special']));
     include_once ROOT_PATH . 'lib/class/special.class.php';
     $special_obj = new special();
     $content_data = $data;
     $sql = "SELECT * FROM " . DB_PREFIX . "content_push WHERE type=1 AND content_id={$content_id}";
     $info = $this->db->query_first($sql);
     if ($info && !$content_relation_id) {
         $content_push['content_id'] = $info['content_id'];
         $content_push['content_relation_id'] = $info['content_relation_id'];
     }
     $sql = "SELECT * FROM " . DB_PREFIX . "content_columns WHERE content_id={$content_id}";
     $content_columns = $this->db->query_first($sql);
     $content_columnsarr = $content_columns['column_datas'] ? unserialize($content_columns['column_datas']) : array();
     foreach ($content_columnsarr as $k => $v) {
         $cc[$k] = $v['name'];
     }
     $content_data['publish_content_columns'] = $cc;
     if ($check && !empty($info)) {
         //先判断content_push有没有记录
         $relation_data = unserialize($info['relation_data']);
         $data_special_keys = array_keys($data['special']);
         $relation_special_keys = array_keys($relation_data);
         $insert_relation_idarr = array_diff($data_special_keys, $relation_special_keys);
         $delete_relation_idarr = array_diff($relation_special_keys, $data_special_keys);
         if (!$insert_relation_idarr && !$delete_relation_idarr) {
             //只更新专题内容
             $content_data['content_id'] = $content_push['content_relation_id'];
             $content_data['cid'] = $content_push['content_id'];
             $special_obj->update_special_content($content_data);
             return true;
         } else {
             if ($insert_relation_idarr) {
                 //插入专题内容
                 $content_data['special_id'] = implode(',', $insert_relation_idarr);
                 $content_data['content_id'] = $content_push['content_relation_id'];
                 $content_data['cid'] = $content_push['content_id'];
                 $special_obj->insert_special_content($content_data);
             } else {
                 if ($delete_relation_idarr) {
                     //通知专题删除内容
                     $special_obj->delete_special_content(implode(',', $delete_relation_idarr), $content_push['content_id'], $data);
                 }
             }
         }
         //更新content_push
         if ($data['special']) {
             if (!$content_push['content_relation_id']) {
                 unset($content_push['content_relation_id']);
             }
             self::update('content_push', ' id=' . $info['id'], $content_push);
         } else {
             self::delete_expand('content_push', $info['id']);
         }
     } else {
         if ($data['special']) {
             //插入content_push
             self::insert('content_push', $content_push);
             //插入专题内容
             $content_data['special_id'] = implode(',', array_keys($data['special']));
             $content_data['content_id'] = $content_push['content_relation_id'];
             $content_data['cid'] = $content_push['content_id'];
             $special_obj->insert_special_content($content_data);
         }
     }
 }
Пример #25
0
 public function show()
 {
     /*模板 权限验证预处理 start*/
     $need_auth = 0;
     //$auth_page_self存储授权页面本身、$auth_page_parents存储授权栏目父级页面
     $auth_site = $auth_site_self = $auth_page = $auth_column = $auth_page_self = $auth_page_parents = array();
     if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
         $need_auth = 1;
         $auth_node = $this->user['prms']['app_prms'][APP_UNIQUEID]['nodes'];
         if ((is_array($auth_node) ? implode(',', $auth_node) : $auth_node) == 1) {
             $need_auth = 0;
             //1表示全选  不需要验证权限
         }
         $auth_node = is_array($auth_node) ? $auth_node : explode(',', $auth_node);
         if ($need_auth) {
             foreach ((array) $auth_node as $k => $v) {
                 switch ($v) {
                     case strstr($v, "site") !== false:
                         $v = str_replace("site", "", $v);
                         $v = explode($this->settings['separator'], $v);
                         $auth_site[] = $auth_site_self[] = $v[0];
                         break;
                     case strstr($v, "page_id") !== false:
                         $v = str_replace("page_id", "", $v);
                         $v = explode($this->settings['separator'], $v);
                         $auth_site[] = $v[0];
                         $auth_page[] = $auth_page_self[] = $v[1];
                         break;
                     case strstr($v, "page_data_id") !== false:
                         $v = str_replace("page_data_id", "", $v);
                         $v = explode($this->settings['separator'], $v);
                         $auth_site[] = $v[0];
                         $auth_page[] = $auth_page_parents[] = $v[1];
                         $auth_column[$v[1]][] = $v[2];
                         break;
                     default:
                         break;
                 }
             }
         }
     }
     /*模板 权限验证预处理 end*/
     $through_auth = 0;
     $fid = $this->input['_id'];
     if (strstr($fid, "site") !== false) {
         $fid = str_replace('site', '', $fid);
         $fid = explode($this->settings['separator'], $fid);
         $site_id = $fid[0];
         if ($need_auth) {
             //授权节点
             if (in_array($site_id, $auth_site_self)) {
                 $through_auth = 1;
             }
         }
     } else {
         if (strstr($fid, "page_id") !== false) {
             $fid = str_replace('page_id', '', $fid);
             $fid = explode($this->settings['separator'], $fid);
             $site_id = $fid[0];
             $page_id = $fid[1];
             if ($need_auth) {
                 if (in_array($page_id, $auth_page_self) || in_array($site_id, $auth_site_self)) {
                     $through_auth = 1;
                 }
             }
         } else {
             if (strstr($fid, "page_data_id") !== false) {
                 $fid = str_replace('page_data_id', '', $fid);
                 $fid = explode($this->settings['separator'], $fid);
                 $site_id = $fid[0];
                 $page_id = $fid[1];
                 $page_data_id = $fid[2];
                 if ($need_auth) {
                     $auth_column = isset($auth_column[$page_id]) ? $auth_column[$page_id] : array();
                     //授权节点本身或者孩子节点 显示
                     if (in_array($page_data_id, $auth_column) || in_array($page_id, $auth_page_self) || in_array($site_id, $auth_site_self)) {
                         $through_auth = 1;
                     } else {
                         $page_data = common::get_page_data($page_id, 0, 1, 0, '', $page_data_id);
                         foreach ((array) $page_data['page_data'] as $k => $v) {
                             $auth_column_parents[$v['id']] = $v['parents'];
                         }
                         //栏目孩子节点显示
                         if (array_intersect(explode(',', $auth_column_parents[$page_data_id]), $auth_column)) {
                             $through_auth = 1;
                         }
                     }
                 }
             }
         }
     }
     $set_type = array();
     if ($through_auth || !$need_auth) {
         $set_type = $this->settings['site_col_template'];
         include_once ROOT_PATH . 'lib/class/publishcontent.class.php';
         $this->publishcontent = new publishcontent();
         if ($site_id && !$page_id && !$page_data_id) {
             //有内容,查出内容类型
             $content_type = $this->publishcontent->get_all_content_type();
             foreach ($content_type as $k => $v) {
                 $set_type[$v['id']] = $v['content_type'];
             }
         } else {
             if ($page_id && !$page_data_id) {
                 $page_info = common::get_page_by_id($page_id);
                 $site_id = $page_info['site_id'];
                 if ($page_info['has_content']) {
                     //有内容,查出内容类型
                     $content_type = $this->publishcontent->get_all_content_type();
                     foreach ($content_type as $k => $v) {
                         $set_type[$v['id']] = $v['content_type'];
                     }
                 }
             } else {
                 if ($page_data_id) {
                     if (strstr($page_data_id, 'sort') !== false) {
                         $page_data_id = str_replace('sort', '', $page_data_id);
                         $set_type = array();
                     } else {
                         if (strstr($page_data_id, 'spe') !== false) {
                             $page_data_id = str_replace('spe', '', $page_data_id);
                             if (!class_exists('special')) {
                                 include ROOT_PATH . 'lib/class/special.class.php';
                             }
                             $special = new special();
                             $specail_info = $special->detail($page_data_id);
                             $template_id = $specail_info['template_sign'];
                             $set_type = array('0' => '首页');
                         } else {
                             if (strstr($page_data_id, 'col') !== false) {
                                 $content_type = str_replace('col', '', $page_data_id);
                                 if (!class_exists('special')) {
                                     include ROOT_PATH . 'lib/class/special.class.php';
                                 }
                                 $special = new special();
                                 $special_column_info = $special->special_column_info($content_type);
                                 $page_data_id = $special_column_info['special_id'];
                                 $specail_info = $special->detail($page_data_id);
                                 $template_id = $specail_info['template_sign'];
                                 $set_type = array($content_type => '首页');
                             } else {
                                 $page_info = common::get_page_by_id($page_id);
                                 $site_id = $page_info['site_id'];
                                 if ($page_info['has_content']) {
                                     //有内容,查出内容类型
                                     $content_type = $this->publishcontent->get_all_content_type();
                                     foreach ($content_type as $k => $v) {
                                         $set_type[$v['id']] = $v['content_type'];
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     $result['set_type'] = $site_id ? $set_type : array();
     $result['site_id'] = $site_id;
     $result['page_id'] = $page_id;
     $result['page_data_id'] = $page_data_id;
     $result['template_id'] = $template_id;
     $this->addItem($result);
     $this->output();
 }
Пример #26
0
<?php

defined('DT_ADMIN') or exit('Access Denied');
require MD_ROOT . '/special.class.php';
$do = new special($moduleid);
$menus = array(array('添加' . $MOD['name'], '?moduleid=' . $moduleid . '&action=add'), array($MOD['name'] . '列表', '?moduleid=' . $moduleid), array('审核' . $MOD['name'], '?moduleid=' . $moduleid . '&action=check'), array('未通过' . $MOD['name'], '?moduleid=' . $moduleid . '&action=reject'), array('回收站', '?moduleid=' . $moduleid . '&action=recycle'), array('移动分类', '?moduleid=' . $moduleid . '&action=move'));
if (in_array($action, array('add', 'edit'))) {
    $FD = cache_read('fields-' . substr($table, strlen($DT_PRE)) . '.php');
    if ($FD) {
        require DT_ROOT . '/include/fields.func.php';
    }
    isset($post_fields) or $post_fields = array();
    $CP = $MOD['cat_property'];
    if ($CP) {
        require DT_ROOT . '/include/property.func.php';
    }
    isset($post_ppt) or $post_ppt = array();
}
if ($_catids || $_areaids) {
    require DT_ROOT . '/admin/admin_check.inc.php';
}
if (in_array($action, array('', 'check', 'reject', 'recycle'))) {
    $sfields = array('模糊', '标题', '简介', '会员名', '编辑', 'IP', '文件路径', '内容模板');
    $dfields = array('keyword', 'title', 'introduce', 'username', 'editor', 'ip', 'filepath', 'template');
    $sorder = array('结果排序方式', '添加时间降序', '添加时间升序', '更新时间降序', '更新时间升序', '浏览次数降序', '浏览次数升序', '信息ID降序', '信息ID升序');
    $dorder = array($MOD['order'], 'addtime DESC', 'addtime ASC', 'edittime DESC', 'edittime ASC', 'hits DESC', 'hits ASC', 'itemid DESC', 'itemid ASC');
    isset($fields) && isset($dfields[$fields]) or $fields = 0;
    isset($order) && isset($dorder[$order]) or $order = 0;
    $level = isset($level) ? intval($level) : 0;
    isset($datetype) && in_array($datetype, array('edittime', 'addtime', 'totime')) or $datetype = 'addtime';
    $fromdate = isset($fromdate) && is_date($fromdate) ? $fromdate : '';