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


PHP common::get_page_manage方法代码示例

本文整理汇总了PHP中common::get_page_manage方法的典型用法代码示例。如果您正苦于以下问题:PHP common::get_page_manage方法的具体用法?PHP common::get_page_manage怎么用?PHP common::get_page_manage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在common的用法示例。


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

示例1: show

 /**
  * 查看内容类型
  * @name show
  * @access public
  */
 public function show()
 {
     $site_id = intval($this->input['site_id']) ? intval($this->input['site_id']) : 1;
     $page_id = intval($this->input['page_id']);
     $page_data_id = intval($this->input['page_id']);
     $fid = intval($this->input['fid']);
     if ($site_id && !$page_id) {
         $page = common::get_page_manage($site_id);
         if (is_array($page) && count($page) > 0) {
             foreach ($page as $k => $v) {
                 $this->addItem($v);
             }
             $this->output();
         }
     } else {
         if ($site_id && $page_id) {
             $page_data = common::get_page_data($page_id, 0, 1000, $fid);
             if (is_array($page_data['page_data']) && count($page_data['page_data']) > 0) {
                 foreach ($page_data['page_data'] as $k => $v) {
                     $v['page_id'] = $page_id;
                     $v['page_data_id'] = $v['id'];
                     $this->addItem($v);
                 }
                 $this->output();
             }
         } else {
             $this->output();
         }
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:35,代码来源:cell.php

示例2: show

 public function show()
 {
     $fid = $this->input['fid'];
     include_once CUR_CONF_PATH . 'lib/common.php';
     if (empty($fid)) {
         $sites = $this->pub_config->get_site(' id,site_name ');
         foreach ($sites as $k => $v) {
             $m = array('id' => 'site' . $v['id'] . $this->settings['separator'] . $v['site_name'], "name" => $v['site_name'], "fid" => 0, "depth" => 1);
             //获取页面类型
             $page_type = common::get_page_manage($v['id']);
             if (empty($page_type)) {
                 $m['is_last'] = 1;
             }
             $this->addItem($m);
         }
     } else {
         if (strstr($fid, "site") !== false) {
             //点击的站点
             $site_id = str_replace('site', '', $fid);
             $get_page = explode($this->settings['separator'], $site_id);
             $page_type = common::get_page_manage($get_page[0]);
             foreach ($page_type as $k => $v) {
                 $m = array('id' => 'page_id' . $v['id'] . $this->settings['separator'] . $v['title'], "name" => $v['title'], "fid" => 'page_id' . $v['id'] . $this->settings['separator'] . $v['title'], "depth" => 1);
                 $page_data = common::get_page_data($v['id'], 0, 1);
                 if (empty($page_data['page_data'])) {
                     $m['is_last'] = 1;
                 }
                 $this->addItem($m);
             }
         } else {
             if (strstr($fid, "page_id") !== false) {
                 //点击的页面类型
                 $page_id = str_replace('page_id', '', $fid);
                 $get_page = explode($this->settings['separator'], $page_id);
                 $page_data = common::get_page_data($get_page[0], 0, 100);
                 foreach ($page_data['page_data'] as $k => $v) {
                     $m_id = 'page_data_id' . $page_data['page_info']['id'] . $this->settings['separator'] . $v[$page_data['page_info']['field']] . $this->settings['separator'] . $v[$page_data['page_info']['name_field']];
                     $m = array('id' => $m_id, "name" => $v[$page_data['page_info']['name_field']], "fid" => $m_id, "depth" => 1);
                     $m['is_last'] = $v[$page_data['page_info']['last_field']];
                     $this->addItem($m);
                 }
             } else {
                 if (strstr($fid, "page_data_id") !== false) {
                     //点击的页面数据
                     $page_data_id = str_replace('page_data_id', '', $fid);
                     $get_page = explode($this->settings['separator'], $page_data_id);
                     $page_data = common::get_page_data($get_page[0], '', '', $get_page[1]);
                     foreach ($page_data['page_data'] as $k => $v) {
                         $m_id = 'page_data_id' . $page_data['page_info']['id'] . $this->settings['separator'] . $v[$page_data['page_info']['field']] . $this->settings['separator'] . $v[$page_data['page_info']['name_field']];
                         $m = array('id' => $m_id, "name" => $v[$page_data['page_info']['name_field']], "fid" => $m_id, "depth" => 1);
                         $m['is_last'] = $v[$page_data['page_info']['last_field']];
                         $this->addItem($m);
                     }
                 }
             }
         }
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:59,代码来源:block_node.php

示例3: changeColumn

 /**
  * 魔力视图中切换页面
  */
 public function changeColumn()
 {
     $site_id = $this->input['site_id'];
     $page_id = $this->input['page_id'];
     $page_data_id = $this->input['page_data_id'];
     if (!$site_id) {
         $this->errorOutput('站点id为空');
     }
     include_once ROOT_PATH . 'lib/class/publishcontent.class.php';
     $this->publishcontent = new publishcontent();
     $set_type = $this->settings['site_col_template'];
     //有页面类型则取页面下栏目,没有取此站点下页面####
     if ($page_id) {
         $page_data = common::get_page_data($page_id, 0, 300, $page_data_id);
         if (is_array($page_data['page_data']) && count($page_data['page_data']) > 0) {
             ####取出此页面的内容类型####
             if ($page_data['page_info']['has_content']) {
                 $types = $this->publishcontent->get_all_content_type();
                 if (is_array($types) && count($types) > 0) {
                     foreach ($types as $kk => $vv) {
                         $set_type[$vv['id']] = $vv['content_type'];
                     }
                 }
             }
             foreach ($page_data['page_data'] as $k => $v) {
                 $m = array('id' => $v['id'], 'title' => $v['name'], 'site_id' => $page_data['page_info']['site_id'], 'page_id' => $page_data['page_info']['id'], 'page_data_id' => $v['id'], 'content_types' => $set_type, 'is_last' => $v[$page_data['page_info']['last_field']]);
                 $this->addItem($m);
             }
         }
     } else {
         $pages = common::get_page_manage($site_id);
         if (is_array($pages) && count($pages) > 0) {
             //内容类型
             foreach ($pages as $k => $v) {
                 if ($v['has_content']) {
                     //有内容,查出内容类型
                     $types = $this->publishcontent->get_all_content_type();
                     if (is_array($types) && count($types) > 0) {
                         foreach ($types as $kk => $vv) {
                             $set_type[$vv['id']] = $vv['content_type'];
                         }
                     }
                     $v['content_types'] = $set_type;
                 }
                 $m = array('id' => $v['id'], 'title' => $v['title'], 'site_id' => $v['site_id'], 'page_id' => $v['page_id'], 'page_data_id' => $v['page_data_id'], 'content_types' => $set_type, 'is_last' => 0);
                 $page_data = common::get_page_data($v['id'], 0, 1);
                 if (empty($page_data['page_data'])) {
                     $m['is_last'] = 1;
                 }
                 $this->addItem($m);
             }
         }
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:58,代码来源:magic.php

示例4: pageNode

 public function pageNode()
 {
     include_once ROOT_PATH . 'lib/class/publishconfig.class.php';
     $this->pub_config = new publishconfig();
     include_once CUR_CONF_PATH . 'lib/common.php';
     $data = array();
     $fid = $this->input['fid'] ? $this->input['fid'] : '';
     $offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
     $count = $this->input['count'] ? intval($this->input['count']) : 1000;
     $data['item'] = $total = array();
     if (strstr($fid, "page_id") !== false) {
         //点击的页面类型
         $page_id = str_replace('page_id', '', $fid);
         $get_page = explode($this->settings['separator'], $page_id);
         $page_data = common::get_page_data($get_page[1], $offset, $count);
         foreach ($page_data['page_data'] as $k => $v) {
             $m_id = 'page_data_id' . $get_page[0] . $this->settings['separator'] . $page_data['page_info']['id'] . $this->settings['separator'] . $v['id'] . $this->settings['separator'] . $v['name'];
             $page = array('id' => $m_id, "name" => $v['name'], "fid" => 'page_data_id' . $page_data['page_info']['id'], "depth" => 1);
             $page['is_last'] = $v['is_last'];
             $data['item'][] = $page;
         }
     } else {
         if (strstr($fid, "page_data_id") !== false) {
             //点击的页面数据
             $page_data_id = str_replace('page_data_id', '', $fid);
             $get_page = explode($this->settings['separator'], $page_data_id);
             $page_data = common::get_page_data($get_page[1], $offset, $count, $get_page[2]);
             foreach ($page_data['page_data'] as $k => $v) {
                 $m_id = 'page_data_id' . $get_page[0] . $this->settings['separator'] . $page_data['page_info']['id'] . $this->settings['separator'] . $v['id'] . $this->settings['separator'] . $v['name'];
                 $column = array('id' => $m_id, "name" => $v['name'], "fid" => 'page_data_id' . $page_data['page_info']['id'], "depth" => 1);
                 $column['is_last'] = $v['is_last'];
                 $data['item'][] = $column;
             }
         } else {
             if ($fid) {
                 //点击的站点
                 $site_id = intval(str_replace('site', '', $fid));
                 if (!$site_id) {
                     $this->errorOutput('NO_SITE_ID');
                 }
                 $get_page = explode($this->settings['separator'], $site_id);
                 $page_type = common::get_page_manage($get_page[0]);
                 foreach ($page_type as $k => $v) {
                     //                if ($v['sign'] == 'special')
                     //                {
                     //                    continue;
                     //                }
                     $page = array('id' => 'page_id' . $site_id . $this->settings['separator'] . $v['id'] . $this->settings['separator'] . $v['title'], "name" => $v['title'], "fid" => 'page_id' . $v['id'], "depth" => 1);
                     $page_data = common::get_page_data($v['id'], 0, 1);
                     if (empty($page_data['page_data'])) {
                         $page['is_last'] = 1;
                     } else {
                         $page['is_last'] = 0;
                     }
                     $data['item'][] = $page;
                 }
             } else {
                 $sites = $this->pub_config->get_site(' id,site_name ', $offset, $count, '', $this->input['key']);
                 if (is_array($sites) && count($sites) > 0) {
                     foreach ((array) $sites as $k => $v) {
                         $site = array('id' => 'site' . $v['id'] . $this->settings['separator'] . $v['site_name'], "name" => $v['site_name'], "fid" => 0, "depth" => 1);
                         //获取页面类型
                         $page_type = common::get_page_manage($v['id']);
                         if (empty($page_type)) {
                             $site['is_last'] = 1;
                         } else {
                             $site['is_last'] = 0;
                         }
                         $data['item'][] = $site;
                     }
                 }
                 $total = $this->pub_config->get_site_count($this->input['key']);
             }
         }
     }
     if ($total) {
         $pagearr = array();
         $pagearr['total'] = isset($total['total']) ? $total['total'] : 0;
         $pagearr['page_num'] = $count;
         $pagearr['total_num'] = $pagearr['total'];
         $pagearr['total_page'] = ceil($pagearr['total'] / $count);
         $pagearr['current_page'] = floor($offset / $count) + 1;
         $data['page'] = $pagearr;
     }
     $this->addItem($data);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:87,代码来源:publishsys.php

示例5: build_mk_cache

 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 {
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:mk.php

示例6: get_node

 public function get_node()
 {
     $offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
     $count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 5000;
     $siteid = intval($this->input['siteid']);
     if (!($fid = $this->input['fid'])) {
         if ($siteid) {
             $fid = 'site' . $siteid;
         }
     }
     if (empty($fid)) {
         $fid = 'site1';
     }
     if (empty($fid)) {
         $sites = $this->pub_config->get_site(' id,site_name ');
         foreach ($sites as $k => $v) {
             $m = array('id' => 'site' . $v['id'] . $this->settings['separator'] . $v['site_name'], "name" => $v['site_name'], "fid" => 0, "depth" => 1);
             //获取页面类型
             $page_type = common::get_page_manage($v['id']);
             $page_type = $this->pub_sys->get_page_manage($v['id']);
             if (empty($page_type)) {
                 $m['is_last'] = 1;
             } else {
                 $m['is_last'] = 0;
             }
             $this->addItem($m);
         }
     } else {
         if (strstr($fid, "site") !== false) {
             //点击的站点
             $site_id = str_replace('site', '', $fid);
             $get_page = explode($this->settings['separator'], $site_id);
             $page_type = $this->pub_sys->get_page_manage($get_page[0]);
             foreach ($page_type as $k => $v) {
                 $m = array('id' => 'page_id' . $v['id'] . $this->settings['separator'] . $v['title'], "name" => $v['title'], "fid" => 'page_id' . $v['id'], "depth" => 1);
                 $page_data = $this->pub_sys->get_page_data($v['id'], 0, 1);
                 if (empty($page_data['page_data'])) {
                     $m['is_last'] = 1;
                 } else {
                     $m['is_last'] = 0;
                 }
                 if ($v['sign'] != 'column') {
                     $m['can_select'] = 1;
                 }
                 $this->addItem($m);
             }
         } else {
             if (strstr($fid, "page_id") !== false) {
                 //点击的页面类型
                 $page_id = str_replace('page_id', '', $fid);
                 $get_page = explode($this->settings['separator'], $page_id);
                 $page_data = $this->pub_sys->get_page_data($get_page[0], $offset, $count);
                 foreach ($page_data['page_data'] as $k => $v) {
                     $m_id = 'page_data_id' . $page_data['page_info']['id'] . $this->settings['separator'] . $v['id'] . $this->settings['separator'] . $v['name'];
                     $m = array('id' => $m_id, "name" => $v['name'], "fid" => 'page_data_id' . $page_data['page_info']['id'], "depth" => 1, "can_select" => $v['can_select']);
                     $m['is_last'] = $v['is_last'];
                     if (is_array($page_data['page_info'])) {
                         if ($page_data['page_info']['sign'] != 'column') {
                             $m['can_select'] = 1;
                         }
                     }
                     $this->addItem($m);
                 }
             } else {
                 if (strstr($fid, "page_data_id") !== false) {
                     //点击的页面数据
                     $page_data_id = str_replace('page_data_id', '', $fid);
                     $get_page = explode($this->settings['separator'], $page_data_id);
                     $page_data = $this->pub_sys->get_page_data($get_page[0], $offset, $count, $get_page[1]);
                     foreach ($page_data['page_data'] as $k => $v) {
                         $m_id = 'page_data_id' . $page_data['page_info']['id'] . $this->settings['separator'] . $v['id'] . $this->settings['separator'] . $v['name'];
                         $m = array('id' => $m_id, "name" => $v['name'], "fid" => 'page_data_id' . $page_data['page_info']['id'], "depth" => 1, "can_select" => $v['can_select']);
                         $m['is_last'] = $v['is_last'];
                         $this->addItem($m);
                     }
                 }
             }
         }
     }
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:81,代码来源:mkpublish.php

示例7: rebuild_deploy

 public function rebuild_deploy($site_id, $page_id, $page_data_id, $site_detail = array())
 {
     if (!$site_id && !$page_id) {
         return false;
     }
     if (!$site_detail) {
         //查出这个站点使用的套系
         $site_detail = $this->pub_config->get_site_first('id,site_name,tem_style,support_client', $site_id);
         $support_client = explode(',', $site_detail['support_client']);
         if (!$support_client) {
             return false;
         }
     } else {
         $support_client = explode(',', $site_detail['support_client']);
     }
     $set_type_content = array();
     //默认的模板类型
     $set_type_default = $this->settings['site_col_template'];
     //有内容,查出内容类型
     $content_type = $this->get_content_type();
     include_once CUR_CONF_PATH . 'lib/cache.class.php';
     $this->cache = new cache();
     if ($site_id && !$page_id) {
         //先查出这个站点的部署信息
         $site_deploy_tem = $this->obj->get_deploy_template($site_id, $this->settings['tem_style_default'], 0, 0);
         $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
         $this->cache->set($site_id, $site_deploy_tem[$site_id][0][0]);
         //取出站点下面的页面
         $page_manage = common::get_page_manage($site_id);
         //取出所有页面类型的模板部署
         $page_deploy_tems = $this->obj->get_deploy_template_all($site_id, "'" . $site_detail['tem_style'] . "'");
         foreach ($page_manage as $k => $v) {
             $set_type_use = array();
             //给页面类型部署(如果没有,则继承站点部署)
             $set_type_use = $v['has_content'] ? $set_type_default + $content_type : $set_type_default;
             foreach ($support_client as $k1 => $v1) {
                 foreach ($set_type_use as $k2 => $v2) {
                     //页面类型部署
                     if (empty($page_deploy_tems[$site_id][$v['id']][0][$v1][$k2])) {
                         if (!empty($site_deploy_tem[$site_id][0][0][$v1][$k2])) {
                             $page_deploy_tems[$site_id][$v['id']][0][$v1][$k2] = $site_deploy_tem[$site_id][0][0][$v1][$k2];
                         } else {
                             $page_deploy_tems[$site_id][$v['id']][0][$v1][$k2] = array();
                         }
                     }
                 }
             }
             $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
             $this->cache->set($site_id . '_' . $v['id'], $page_deploy_tems[$site_id][$v['id']][0]);
             //给页面数据部署
             $this->rebuild_page_data($support_client, $set_type_use, $site_id, $v, $page_deploy_tems, $page_deploy_tems[$site_id][$v['id']][0], $site_detail, 0, 0, 1000);
         }
     } else {
         if ($page_id && !$page_data_id) {
             $father_deploy_tem = array();
             //查询出页面类型详情
             $page_info = common::get_page_by_id($page_id);
             $set_type_use = $page_info['has_content'] ? $set_type_default + $content_type : $set_type_default;
             //取出所有页面类型的模板部署
             $page_deploy_tems = $this->obj->get_deploy_template_all($site_id, "'" . $site_detail['tem_style'] . "'", $page_id);
             //当前页面类型的模板部署
             $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
             $page_type_deploy_tem_cache = $this->cache->get($site_id . '_' . $page_id);
             $page_deploy_tems[$site_id][$page_id][0] = $page_deploy_tems[$site_id][$page_id][0] ? $page_deploy_tems[$site_id][$page_id][0] : array();
             if (empty($page_type_deploy_tem_cache) && empty($page_deploy_tems[$site_id][$page_id][0])) {
                 //取站点缓存部署
                 $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
                 $site_deploy_tem_cache = $this->cache->get($site_id);
                 if (!empty($site_deploy_tem_cache)) {
                     $page_deploy_tems[$site_id][$page_id][0] = $site_deploy_tem_cache;
                 }
             }
             $father_deploy_tem = multi_array_merge($page_type_deploy_tem_cache, $page_deploy_tems[$site_id][$page_id][0]);
             $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
             $this->cache->set($site_id . '_' . $page_id, $father_deploy_tem);
             //给页面数据部署
             $this->rebuild_page_data($support_client, $set_type_use, $site_id, $page_info, $page_deploy_tems, $father_deploy_tem, $site_detail, 0, 0, 1000);
         } else {
             if ($page_data_id) {
                 $father_deploy_tem = array();
                 //查询出页面类型详情
                 $page_info = common::get_page_by_id($page_id);
                 $set_type_use = $page_info['has_content'] ? $set_type_default + $content_type : $set_type_default;
                 //取出所有页面类型的模板部署
                 if (!is_numeric($page_data_id)) {
                     return;
                 }
                 $page_deploy_tems = $this->obj->get_deploy_template_all($site_id, "'" . $site_detail['tem_style'] . "'", $page_id, $page_data_id);
                 //当前页面类型的模板部署
                 $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
                 $page_data_deploy_tem_cache = $this->cache->get($site_id . '_' . $page_id . '_' . $page_data_id);
                 $page_data_deploy_tem_cache = empty($page_data_deploy_tem_cache) ? array() : $page_data_deploy_tem_cache;
                 $page_deploy_tems[$site_id][$page_id][$page_data_id] = $page_deploy_tems[$site_id][$page_id][$page_data_id] ? $page_deploy_tems[$site_id][$page_id][$page_data_id] : array();
                 if (empty($page_data_deploy_tem_cache) && empty($page_deploy_tems[$site_id][$page_id][$page_data_id])) {
                     $this->rebuild_deploy($site_id, $page_id, 0, $site_detail);
                     $this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
                     $page_data_deploy_tem_cache = $this->cache->get($site_id . '_' . $page_id . '_' . $page_data_id);
                     $page_data_deploy_tem_cache = empty($page_data_deploy_tem_cache) ? array() : $page_data_deploy_tem_cache;
                     $page_deploy_tems[$site_id][$page_id][$page_data_id] = $page_deploy_tems[$site_id][$page_id][$page_data_id] ? $page_deploy_tems[$site_id][$page_id][$page_data_id] : array();
                 }
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:rebuild_deploy.class.php

示例8: setPaginationInfo

 /**
  * 设置分页、站点、页面、栏目、专题、专题栏目信息
  */
 private function setPaginationInfo()
 {
     if (!$this->arSiteInfo && $this->intSiteId) {
         include_once ROOT_PATH . 'lib/class/publishconfig.class.php';
         $this->objPub = new publishconfig();
         $this->arSiteInfo = $this->objPub->get_site_first('*', $this->intSiteId);
     }
     //设置文件生成方式
     if ($this->intSiteId) {
         $needPageInfo['file_mktype'] = $this->arSiteInfo['produce_format'];
         $needPageInfo['page_filename'] = $this->arSiteInfo['indexname'];
         $needPageInfo['page_url'] = $this->arSiteInfo['site_info']['url'];
         $needPageInfo['dir'] = $this->arSiteInfo['site_dir'];
     }
     if ($this->intPageId) {
         $arPageType = common::get_page_manage($this->intSiteId, $this->intPageId, 'id');
         $arPageTypeDetail = $arPageType[$this->intPageId];
         //设置文件生成方式
         $needPageInfo['file_mktype'] = $arPageTypeDetail['maketype'];
         $needPageInfo['page_filename'] = $arPageTypeDetail['colindex'];
         $needPageInfo['page_url'] = $arPageTypeDetail['column_domain'];
         $needPageInfo['dir'] .= $arPageTypeDetail['column_dir'];
     }
     if ($this->intPageDataId) {
         empty($this->arPageInfo) && ($this->arPageInfo = common::getPageBySign('special', 'id'));
         if ($this->intPageId == $this->arPageInfo['id']) {
             //专题信息
             $arSpecialInfo = common::get_special_info($this->intPageDataId);
             if ($this->intContentType) {
                 $arSpecialColumnInfo = common::get_special_column_info($this->intContentType);
             }
         } else {
             $arPageData = common::get_page_data($this->intPageId, '', '', '', '', $this->intPageDataId);
             $arColumnInfo = $arPageData['page_data'][0];
             //设置文件生成方式
             $needPageInfo['file_mktype'] = $arColumnInfo['maketype'];
             $needPageInfo['page_filename'] = $arColumnInfo['colindex'];
             $needPageInfo['page_url'] = $arColumnInfo['column_domain'];
             $needPageInfo['dir'] .= $arColumnInfo['column_dir'];
         }
     }
     if ($this->intClientType) {
         if (!class_exists('publishconfig')) {
             include_once ROOT_PATH . 'lib/class/publishconfig.class.php';
         }
         $this->objPub = new publishconfig();
         $this->arPageClientInfo = $this->objPub->get_client_first($this->intClientType);
     }
     $this->arNeedPageInfo = $needPageInfo;
     $this->arPageSiteInfo = $this->arSiteInfo;
     $this->arPageColumnInfo = $arColumnInfo;
     $this->arPageSpecialInfo = $arSpecialInfo;
     $this->arPageSpecialColumnInfo = $arSpecialColumnInfo;
 }
开发者ID:h3len,项目名称:Project,代码行数:57,代码来源:magic.class.php

示例9: show

 public function show($plan, $content_data = array(), $is_from_sys = false)
 {
     $html = '';
     $this->setPlan($plan);
     if (!in_array($plan['content_type'], $this->content_type_true) && !$is_from_sys) {
         if ($plan['count'] === 0) {
             echo "所取内容条数为0条,不生成";
             exit;
         } else {
             if ($plan['count']) {
                 $count = $plan['count'] <= $this->settings['content_num_time'] ? $plan['count'] : $this->settings['content_num_time'];
                 $this->setTimecount($count);
                 $nextcount = $plan['count'] - $count;
                 $is_copy_plan = $nextcount > 0 ? true : false;
                 $offset = $plan['offset'] + $count;
             } else {
                 $offset = $plan['offset'] + $this->settings['content_num_time'];
                 //表示全部生成
                 $this->setTimecount($this->settings['content_num_time']);
                 $is_copy_plan = true;
             }
         }
     }
     //获取站点信息
     $site = $this->pub_config->get_site_first('*', $plan['site_id']);
     $this->setSite($site);
     if (!$site['tem_material_url']) {
         $site['tem_material_url'] = rtrim($site['sub_weburl'], '/') . '.' . $site['weburl'];
     }
     $this->setPagedir($site['site_dir']);
     $this->setMktype($site['produce_format']);
     $this->setFilename($site['indexname']);
     /**页面生成方式  1为静态生成 2为动态生成   
     			$page_mk_type页面生成方式  $page_content_mk_type内容生成方式
     			$dir 该页面生成的目录
     		*/
     if ($plan['page_id']) {
         $page_type = common::get_page_manage($plan['site_id'], $plan['page_id'], 'id');
         $page_type_detail = $page_type[$plan['page_id']];
         if ($page_type_detail['sign'] != 'column') {
             $this->setPagedir($page_type_detail['sign']);
         }
     }
     if ($plan['page_data_id']) {
         $page_data = common::get_page_data($plan['page_id'], '', '', '', $page_type_detail, $plan['page_data_id']);
         $page_data_detail = $page_data['page_data'][0];
         $this->setFilename($page_data_detail['colindex']);
         $this->setPagedir($page_data_detail['column_dir']);
         $this->setColumn($page_data_detail);
         if (in_array($plan['content_type'], $this->content_type_true)) {
             $this->setMktype($page_data_detail['maketype']);
         } else {
             $this->setMktype($page_data_detail['col_con_maketype']);
         }
     }
     $this->setWeburl();
     //获取对应模板,单元
     $cell_ret = common::merge_cell($plan['site_id'], $plan['page_id'], $plan['page_data_id'], $plan['content_type'], $site);
     if (MK_DEBUG) {
         file_in('../cache/log/', '处理前所有单元.txt', var_export($cell_ret, 1), true, true);
     }
     $template_style = $cell_ret['curr_style'];
     //当前使用中的套系标识
     $template_sign = $cell_ret['template_sign'];
     //当前模板标识
     //获取模板
     //		$site['tem_material_url'] = $site['tem_material_url']?$site['tem_material_url']:(rtrim($site['sub_weburl'],'/').'/'.rtrim($site['weburl'],'/').'/'.'templates');
     $template = common::get_template_cache($template_sign, $template_style, $plan['site_id'], $site['tem_material_url'] . '/t');
     if (MK_DEBUG) {
         file_in('../cache/log/', '处理前的模板.txt', $template, true, true);
     }
     //页面标题关键字描述的插入到模板中
     $template = template_process($template, $this->site, $this->column);
     if (MK_DEBUG) {
         file_in('../cache/log/', '处理head后模板.txt', $template, true, true);
     }
     if (empty($template)) {
         echo "没有部署模板";
         exit;
     }
     if (is_array($cell_ret['default_cell'])) {
         //			print_r($cell_ret['default_cell']);exit;
         //获取所有样式
         foreach ($cell_ret['default_cell'] as $k => $v) {
             if ($v['cell_mode']) {
                 $mode_idarr[$v['cell_mode']] = $v['cell_mode'];
             }
             if ($v['data_source']) {
                 $datasourceid[$v['data_source']] = $v['data_source'];
             }
         }
         //取样式的详细信息
         if ($mode_idarr) {
             $mode_id_str = implode(',', $mode_idarr);
             $mode_data = common::get_mode_infos($mode_id_str, '', 'id');
             //获取样式参数
             $mode_variables = common::get_mode_variable($mode_id_str);
             //加载css
             $cssstr = '<style type="text/css">';
             foreach ($mode_data as $k => $v) {
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:mkhtml.class.php

示例10: show

 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*/
     $fid = $this->input['fid'];
     include_once CUR_CONF_PATH . 'lib/common.php';
     if (empty($fid)) {
         if ($need_auth) {
             $auth_site_str = implode(',', array_unique($auth_site));
         }
         $sites = $this->pub_config->get_site(' id,site_name ', '', '', $auth_site_str);
         foreach ($sites as $k => $v) {
             $m = array('id' => 'site' . $v['id'] . $this->settings['separator'] . $v['site_name'], "name" => $v['site_name'], "fid" => 0, "depth" => 1);
             //获取页面类型
             $page_type = common::get_page_manage($v['id']);
             if (empty($page_type)) {
                 $m['is_last'] = 1;
             }
             $this->addItem($m);
         }
     } else {
         if (strstr($fid, "site") !== false) {
             //点击的站点
             $site_id = str_replace('site', '', $fid);
             $get_page = explode($this->settings['separator'], $site_id);
             $page_type = common::get_page_manage($get_page[0]);
             foreach ((array) $page_type as $k => $v) {
                 if ($need_auth) {
                     $v['is_auth'] = 0;
                     $v['is_auth'] = $need_auth ? 0 : 1;
                     //授权页面本身 显示
                     if (in_array($v['id'], $auth_page_self)) {
                         $v['is_auth'] = 1;
                     }
                     if (!$v['is_auth']) {
                         //授权栏目父级页面 显示
                         if (in_array($v['id'], array_diff($auth_page_parents, $auth_page_self))) {
                             $v['is_auth'] = 2;
                         }
                         //授权站点子集页面 显示
                         if (in_array($v['site_id'], $auth_site_self)) {
                             $v['is_auth'] = 3;
                         }
                     }
                 }
                 if ($v['is_auth'] || !$need_auth) {
                     $m = array('id' => 'page_id' . $v['site_id'] . $this->settings['separator'] . $v['id'] . $this->settings['separator'] . $v['title'], "name" => $v['title'], "fid" => 'page_id' . $v['id'] . $this->settings['separator'] . $v['title'], "depth" => 1);
                     $page_data = common::get_page_data($v['id'], 0, 1);
                     if (empty($page_data['page_data'])) {
                         $m['is_last'] = 1;
                     }
                     $this->addItem($m);
                 }
             }
         } else {
             if (($has_page_id = strstr($fid, "page_id")) !== false || ($has_page_data_id = strstr($fid, "page_data_id")) !== false) {
                 //点击的页面类型
                 $id = str_replace(array('page_id', 'page_data_id'), array('', ''), $fid);
                 $get_page = explode($this->settings['separator'], $id);
                 $page_data = common::get_page_data($get_page[1], 0, 1000, $get_page[2]);
                 //                print_r($page_data);exit;
                 if ($auth_column) {
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:magic_node.php

示例11: get_page_manage

 public function get_page_manage()
 {
     $site_id = intval($this->input['site_id']);
     include_once CUR_CONF_PATH . 'lib/common.php';
     $page_type = common::get_page_manage($site_id);
     $this->addItem($page_type);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:8,代码来源:page_manage.php

示例12: create

 public function create()
 {
     $site_id = intval($this->input['site_id']);
     $page_id = intval($this->input['page_id']);
     $page_data_id = intval($this->input['page_data_id']);
     $content_type = $this->input['content_type'];
     $content_mk_num = intval($this->input['content_mk_num']);
     $page_data_idarr = $page_data_id ? explode(',', $page_data_id) : array();
     $is_contain_child = intval($this->input['is_contain_child']);
     //0不支持 1支持
     $this->set_content_mk_num($content_mk_num);
     $this->set_publish_user(trim($this->input['publish_user']));
     $this->set_publish_time($this->input['publish_time']);
     //内容参数
     $content_param = array();
     foreach ($this->input as $k => $v) {
         if (strpos($k, 'mkcontent_') !== 0) {
             continue;
         }
         $content_param[str_replace('mkcontent_', '', $k)] = $v;
     }
     if ($content_param) {
         $this->set_content_param(serialize($content_param));
     }
     if (!$content_type) {
         $this->errorOutput('请选择需要生成发布的内容类型');
     }
     if ($site_id && !$page_id) {
         if ($is_contain_child) {
             /**发布子级*/
             //查出站点下的页面类型
             $page_type = common::get_page_manage($site_id);
             if (is_array($page_type) && $page_type) {
                 $this->mk_plan_page_type($content_type, $page_type, $is_contain_child);
             }
         } else {
             /**不发布子级*/
             foreach ($content_type as $k => $v) {
                 $this->set_sqlarr($site_id, 0, 0, $v);
             }
         }
     }
     if ($page_id && !$page_data_idarr) {
         //判断站点有没有,如有,是不是站点包含子级生成发布过了
         if ($site_id && $is_contain_child) {
             break;
         }
         $page_type = common::get_page_by_id($page_id, true);
         if (is_array($page_type) && $page_type) {
             $this->mk_plan_page_type($content_type, $page_type, $is_contain_child);
         }
     }
     if ($page_data_idarr) {
         //判断站点有没有,如有,是不是站点包含子级生成发布过了
         if ($site_id && $is_contain_child) {
             break;
         }
         $page_type = common::get_page_by_id($page_id, true, 'id');
         if ($page_type && is_array($page_type)) {
             foreach ($page_data_idarr as $k => $v) {
                 //					$page_id;#!!!!!
                 $page_data_id = $v;
                 #!!!!!
                 foreach ($content_type as $kk => $vv) {
                     $this->set_sqlarr($page_type[$page_id]['site_id'], $page_id, $page_data_id, $vv);
                 }
                 if ($is_contain_child) {
                     $this->mk_plan_page_data($content_type, $page_type[$page_id], $page_data_id, $is_contain_child);
                 }
             }
         }
     }
     //入库
     if ($this->sqlarr) {
         $this->obj->insert_plan($this->sqlarr);
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:77,代码来源:mkpublish_update.php


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