本文整理汇总了PHP中common::get_page_data方法的典型用法代码示例。如果您正苦于以下问题:PHP common::get_page_data方法的具体用法?PHP common::get_page_data怎么用?PHP common::get_page_data使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类common
的用法示例。
在下文中一共展示了common::get_page_data方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
}
}
}
示例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();
}
示例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();
}
示例4: update
function update($site_id = 0, $page_id = 0, $page_data_id = 0, $content_type = 0, $template_sign = '', $title = '', $full_title = '', $group_id)
{
$client_type = $this->input['client_type'] ? $this->input['client_type'] : 2;
$same_level_tem = intval($this->input['same_level_tem']);
if (!$site_id) {
$this->errorOutput('缺少对应信息');
}
$site = $this->pub_config->get_site_first(' * ', $site_id);
if (!$site['tem_style']) {
return;
}
//查询模板信息
$sql = "SELECT * FROM " . DB_PREFIX . "templates WHERE sign='" . $template_sign . "' and template_style='" . $site['tem_style'] . "'";
$t = $this->db->query_first($sql);
if (!$t) {
return;
}
$template_sign = $t['sign'];
$template_name = $t['title'];
$dep_tem = $this->obj->get_deploy_template($site_id, $site['tem_style'], $page_id, $page_data_id);
$data['site_id'] = $site_id;
$data['page_id'] = $page_id;
$data['page_data_id'] = $page_data_id;
$data['client_id'] = $client_type;
$data['content_type'] = $content_type;
$data['template_sign'] = $template_sign;
$data['template_name'] = $template_name;
$data['title'] = $title;
$data['full_title'] = $full_title;
if (!$group_id) {
$sql = "select group_id from " . DB_PREFIX . "deploy_template order by group_id DESC limit 1";
$groupdetail = $this->db->query_first($sql);
$group_id = intval($groupdetail['group_id']);
$group_id = $this->input['group_id'] = $group_id + 1;
}
if (empty($dep_tem[$site_id][$page_id][$page_data_id][$client_type][$content_type])) {
$data['group_id'] = $group_id;
$this->obj->insert_col_tem($data);
} else {
$update_data = array('group_id' => $group_id, 'template_sign' => $data['template_sign'], 'title' => $title, 'full_title' => $full_title, 'template_name' => $data['template_name']);
$dep_tem_id = $dep_tem[$site_id][$page_id][$page_data_id][$client_type][$content_type]['id'];
$this->obj->update('deploy_template', $dep_tem_id, $update_data);
}
if ($same_level_tem) {
$page_data = common::get_page_data($page_id, 0, 10, '', array(), $page_data_id);
if (!$page_data[$page_data_id]) {
exit;
}
$page_data_detail = $page_data[$page_data_id];
$lve_page_data = common::get_page_data($page_id, 0, 500, $page_data_detail['fid'], array(), '');
if (!$lve_page_data || !is_array($lve_page_data)) {
exit;
}
foreach ($lve_page_data as $k => $v) {
if ($k == $page_data_id) {
continue;
}
$dep_tem = $this->obj->get_deploy_template($site_id, $site['tem_style'], $page_id, $page_data_id);
$data['site_id'] = $site_id;
$data['page_id'] = $page_id;
$data['page_data_id'] = $page_data_id;
$data['client_type'] = $client_type;
$data['content_type'] = $content_type;
$data['template_sign'] = $template_sign;
$data['template_name'] = $template_name;
$data['title'] = $title;
if (empty($dep_tem[$site_id][$page_id][$page_data_id][$client_type][$content_type])) {
$this->obj->insert_col_tem($data);
} else {
$update_data = array('template_sign' => $data['template_sign'], 'title' => $title);
$dep_tem_id = $dep_tem[$site_id][$page_id][$page_data_id][$client_type][$content_type]['id'];
$this->obj->update('deploy_template', $dep_tem_id, $update_data);
}
}
}
}
示例5: 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();
}
示例6: 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 {
//.........这里部分代码省略.........
示例7: deploy_form
public function deploy_form()
{
$id = $this->input['id'];
if (!$id) {
$this->errorOutput('NO_ID');
}
//siteid1_pageid0_pagedataid0
$idarr = explode('_', $id);
if (!$idarr[0] || !$idarr[1] || !$idarr[2]) {
$this->errorOutput('NO_ID');
}
$site_id = intval(str_replace('siteid', '', $idarr[0]));
$page_id = intval(str_replace('pageid', '', $idarr[1]));
$page_data_id = intval(str_replace('pagedataid', '', $idarr[2]));
$offset = $this->input['offset'] ? intval($this->input['offset']) : 0;
$count = $this->input['count'] ? intval($this->input['count']) : 500;
if ($site_id && !$page_id && !$page_data_id) {
} else {
if ($site_id && $page_id && !$page_data_id) {
$data = common::get_page_data($page_id, $offset, $count, 0);
foreach ($data['page_data'] as $k => $v) {
$data['page_data'][$k]['id'] = 'siteid' . $site_id . '_pageid' . $page_id . '_pagedataid=' . $v['id'];
}
} else {
if ($site_id && $page_id && $page_data_id) {
$data = common::get_page_data($page_id, $offset, $count, $page_data_id);
foreach ($data['page_data'] as $k => $v) {
$data['page_data'][$k]['id'] = 'siteid' . $site_id . '_pageid' . $page_id . '_pagedataid=' . $v['id'];
}
}
}
}
$this->addItem($data['page_data']);
$this->output();
}
示例8: open_url
public function open_url()
{
$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 = intval($this->input['content_type']);
$site = $this->pub_config->get_site_first('*', $site_id);
$sub_weburl = $site['sub_weburl'];
$web_url = $site['weburl'];
$web_dir = '';
$indexname = $site['indexname'] . ($site['produce_format'] == 1 ? '.html' : '.php');
if ($page_id) {
$page_data = common::get_page_by_id($page_id);
if ($page_data['next_domain'] || $page_data['domain']) {
$sub_weburl = $page_data['next_domain'];
$web_url = $page_data['domain'];
$web_dir = '';
} else {
$web_dir .= $page_data['sign'];
}
}
if ($page_data_id) {
$page_datas = common::get_page_data($page_id, '', '', 0, $page_data, $page_data_id);
$page_data_detail = $page_datas['page_data'][0];
if ($page_data_detail['father_domain']) {
$sub_weburl = $page_data_detail['father_domain'];
}
$web_dir .= $page_data_detail['relate_dir'];
$indexname = $page_data_detail['colindex'] . $page_data_detail['suffix'];
}
$url = $sub_weburl;
if ($web_url) {
$url .= rtrim($web_url, '/');
}
if ($web_dir) {
$url .= '/' . rtrim($web_dir, '/');
}
$url .= '/' . $indexname;
echo $url;
exit;
$result['url'] = $url;
$this->addItem($result);
$this->output();
}
示例9: rebuild_page_data
public function rebuild_page_data($support_client, $set_type_use, $site_id, $page_info, $page_deploy_tems, $father_deploy_tem, $site_detail, $fid = 0, $offset = 0, $count = 1000)
{
$page_data = common::get_page_data($page_info['id'], $offset, $count, $fid);
if (!is_array($page_data['page_data'])) {
return false;
}
foreach ($page_data['page_data'] as $kk => $vv) {
if (!isset($vv[$page_info['field']]) || !is_numeric($vv[$page_info['field']])) {
break;
}
//取出所有页面类型的模板部署
$page_deploy_tems = $this->obj->get_deploy_template_all($site_id, "'" . $site_detail['tem_style'] . "'", $page_info['id'], $vv[$page_info['field']]);
foreach ($support_client as $k1 => $v1) {
foreach ($set_type_use as $k2 => $v2) {
//页面类型部署
if (empty($page_deploy_tems[$site_id][$page_info['id']][$vv[$page_info['field']]][$v1][$k2])) {
if (!empty($father_deploy_tem[$v1][$k2])) {
$page_deploy_tems[$site_id][$page_info['id']][$vv[$page_info['field']]][$v1][$k2] = $father_deploy_tem[$v1][$k2];
} else {
$page_deploy_tems[$site_id][$page_info['id']][$vv[$page_info['field']]][$v1][$k2] = array();
}
}
}
}
//判断有无子级,有则递归
if ($page_info['has_child']) {
if (!$vv[$page_info['last_field']]) {
$this->rebuild_page_data($support_client, $set_type_use, $site_id, $page_info, $page_deploy_tems, $page_deploy_tems[$site_id][$page_info['id']][$vv[$page_info['field']]], $site_detail, $vv[$page_info['field']]);
}
}
$this->cache->initialize(CUR_CONF_PATH . 'cache/deploy');
$this->cache->set($site_id . '_' . $page_info['id'] . '_' . $vv[$page_info['field']], $page_deploy_tems[$site_id][$page_info['id']][$vv[$page_info['field']]]);
}
}
示例10: 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;
}
示例11: 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) {
//.........这里部分代码省略.........
示例12: 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) {
//.........这里部分代码省略.........
示例13: get_page_data
public function get_page_data()
{
$offset = $this->input['offset'] ? intval(urldecode($this->input['offset'])) : 0;
$count = $this->input['count'] ? intval(urldecode($this->input['count'])) : 500;
$page_id = intval($this->input['page_id']);
$fid = intval($this->input['fid']);
include_once CUR_CONF_PATH . 'lib/common.php';
$data = common::get_page_data($page_id, $offset, $count, $fid);
$this->addItem($data);
$this->output();
}
示例14: mk_plan_page_data
public function mk_plan_page_data($content_type, $page_info, $fid, $is_contain_child)
{
$page_data = common::get_page_data($page_info['id'], 0, 1000, $fid, $page_info);
if (is_array($page_data['page_data']) && $page_data['page_data']) {
foreach ($page_data['page_data'] as $kkk => $vvv) {
foreach ($content_type as $k => $v) {
$this->set_sqlarr($page_info['site_id'], $page_info['id'], $vvv['id'], $v);
if (!$vvv['is_last'] && $is_contain_child) {
$this->mk_plan_page_data($content_type, $page_info, $vvv['id'], $is_contain_child);
}
}
}
}
}