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


PHP common::insert_domain方法代码示例

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


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

示例1: update_domain

 public function update_domain($data)
 {
     $sql = "SELECT id FROM " . DB_PREFIX . "domain WHERE type=" . $data['type'] . " AND from_id=" . $data['from_id'];
     $info = $this->db->query_first($sql);
     if (empty($info)) {
         common::insert_domain($data);
     } else {
         if ($data['path']) {
             hg_mkdir($data['path']);
         }
         $update_data = array('sub_domain' => $data['sub_domain'], 'domain' => $data['domain'], 'path' => $data['path'] ? realpath($data['path']) : '');
         $sql = "UPDATE " . DB_PREFIX . "domain SET";
         $sql_extra = $space = ' ';
         foreach ($update_data as $k => $v) {
             $sql_extra .= $space . $k . "='" . $v . "'";
             $space = ',';
         }
         $sql .= $sql_extra . " WHERE type=" . $data['type'] . " AND from_id=" . $data['from_id'];
         $this->db->query($sql);
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:21,代码来源:common.php

示例2: operate_syn


//.........这里部分代码省略.........
         if ($coldetail['fid'] != $column_fid) {
             $this->col_node->update_node($column_id, $column_fid);
         }
         //计算出栏目的目录
         if ($column_fid) {
             $oth_coldetail = $this->obj->get_column_first(' column_dir,column_url,relate_dir ', $column_fid);
         }
         $column_self_dir = $data['column_dir'] ? $data['column_dir'] : $this->settings['defalult_column_dir'] . $column_id;
         $col_dir = (empty($oth_coldetail['column_dir']) ? '' : $oth_coldetail['column_dir']) . '/' . $column_self_dir;
         $this->obj->update_column($column_id, array('column_dir' => $col_dir));
         $now = $this->obj->get_column_first(' * ', $column_id);
         $this->change_dir($old_coldetail, $now, $column_id, $column_self_dir);
         //更新服务器生成页面栏目目录
         if ($old_coldetail['column_dir'] != $col_dir) {
             include ROOT_PATH . 'lib/class/mkpublish.class.php';
             $this->mkpublish = new mkpublish();
             $this->mkpublish->rename_folder(rtrim($site_detail['site_dir'], '/') . $old_coldetail['column_dir'], rtrim($site_detail['site_dir'], '/') . $col_dir);
         }
         //更新domain
         if ($data['childdomain']) {
             $domain_data['path'] = $col_dir;
             common::update_domain($domain_data);
         }
         if ($old_coldetail['childs']) {
             $childs_data = $this->obj->get_column_by_id(' * ', $old_coldetail['childs'], 'id');
             foreach (explode(',', $old_coldetail['childs']) as $cms_column_id) {
                 if ($cms_column_id) {
                     //栏目插入到cms并保存cms栏目id
                     $cms_column_data = array('column_id' => $cms_column_id, 'name' => $childs_data[$cms_column_id]['name'], 'brief' => $childs_data[$cms_column_id]['content'], 'cms_fid' => $childs_data[$cms_column_id]['fid'], 'cms_siteid' => $childs_data[$cms_column_id]['site_id'], 'column_dir' => $childs_data[$cms_column_id]['column_dir'], 'relate_dir' => $childs_data[$cms_column_id]['relate_dir'], 'linkurl' => $childs_data[$cms_column_id]['linkurl'], 'childdomain' => $childs_data[$cms_column_id]['childdomain'], 'colindex' => $childs_data[$cms_column_id]['colindex']);
                     $this->pub_cms->update_cms_column($cms_column_data);
                 }
             }
         }
         $new_coldetail = $this->obj->get_column_first(' * ', $column_id);
         $this->addLogs('更新栏目', $old_coldetail, $new_coldetail, $column_name);
     } else {
         if ($column_fid) {
             $oth_coldetail = $this->obj->get_column_first(' column_dir,column_url,relate_dir,father_domain ', $column_fid);
         }
         //先插入节点
         $data['content_update_time'] = TIMENOW;
         $id = $this->col_node->insert_node($column_name, $column_fid, $data);
         //更新order_id 排序id
         $this->obj->update_column($id, array('order_id' => $id, 'father_domain' => $oth_coldetail['father_domain']));
         //计算出栏目的目录
         $column_self_dir = $data['column_dir'] ? $data['column_dir'] : $this->settings['defalult_column_dir'] . $id;
         $col_dir = (empty($oth_coldetail['column_dir']) ? '' : $oth_coldetail['column_dir']) . '/' . $column_self_dir;
         //插入子域名
         if ($data['childdomain']) {
             $domain_data['path'] = $col_dir;
             common::insert_domain($domain_data + array('from_id' => $id));
         }
         //计算出栏目的相对路径
         if ($data['childdomain']) {
             $relate_dir = '';
         } else {
             $relate_dir = (empty($oth_coldetail['relate_dir']) ? '' : $oth_coldetail['relate_dir']) . '/' . $column_self_dir;
         }
         $this->obj->update_column($id, array('column_dir' => $col_dir, 'relate_dir' => $relate_dir));
         //栏目插入到cms并保存cms栏目id
         $cms_column_data = array('cms_columnid' => $id, 'name' => $column_name, 'brief' => $data['content'], 'cms_fid' => $column_fid, 'cms_siteid' => $site_id, 'column_dir' => $col_dir, 'linkurl' => $data['linkurl'], 'orderid' => $id, 'relate_dir' => $relate_dir, 'childdomain' => $data['childdomain'], 'colindex' => $data['colindex']);
         $cms_column_id = $this->pub_cms->insert_cms_column($cms_column_data);
         $new_coldetail = $this->obj->get_column_first(' * ', $id);
         $this->addLogs('新增栏目', '', $new_coldetail, $column_name);
         //插入图片
         //$this->insert_pic($id, $data['support_client']);
     }
     $data['site_id'] = $data['site_id'];
     $data['column_id'] = $column_id;
     $data['column_fid'] = $column_fid;
     $data['id'] = $id;
     $data['column_name'] = $column_name;
     //获取栏目支持的模块 from table app
     //		$data['module'] = common::get_module();
     if ($this->settings['is_syn_clouds']) {
         if (!$column_id) {
             if ($column_fid) {
                 $father_column = $this->obj->get_column_first(' syn_id ', $column_fid);
                 $syn_data['column_fid'] = $father_column['syn_id'];
             }
             $syn_data['column_name'] = $column_name;
             $syn_data['site_id'] = $site_detail['syn_id'];
         } else {
             $sql = "select c.name,c.syn_id,cc.syn_id as f_syn_id from " . DB_PREFIX . "column c left join " . DB_PREFIX . "column cc on c.fid=cc.id where c.id=" . $column_id;
             $newcolumn = $this->db->query_first($sql);
             $syn_data = $newcolumn;
             $syn_data['column_id'] = $newcolumn['syn_id'];
             $syn_data['column_fid'] = intval($newcolumn['f_syn_id']);
             $syn_data['column_name'] = $newcolumn['name'];
             $syn_data['site_id'] = $site_detail['syn_id'];
         }
         $this->syn_column($syn_data, $id);
     }
     if ($fast_add_column) {
         $this->addItem($id);
         $this->output();
     }
     $this->addItem($data);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:column.php

示例3: operate

 public function operate()
 {
     /*         * 权限判断 */
     if ($this->user['group_type'] > MAX_ADMIN_TYPE) {
         if (empty($this->user['prms']['app_prms'][APP_UNIQUEID]['setting'])) {
             $this->errorOutput(NO_PRIVILEGE);
         }
     }
     $site_id = intval($this->input['site_id']);
     $data = array('support_client' => $this->input['client'], 'site_name' => $this->input['site_name'], 'site_keywords' => str_replace(' ', ',', trim($this->input['keywords'])), 'content' => urldecode($this->input['content']), 'sub_weburl' => trim(urldecode($this->input['sub_weburl']), '/'), 'sub_wdir' => urldecode($this->input['sub_wdir']), 'weburl' => trim(urldecode($this->input['weburl']), '/'), 'site_dir' => urldecode(trim($this->input['site_dir'])), 'produce_format' => urldecode($this->input['produce_format']), 'indexname' => urldecode($this->input['indexname']), 'suffix' => urldecode($this->input['suffix']), 'tem_material_url' => urldecode($this->input['tem_material_url']), 'tem_material_dir' => urldecode($this->input['tem_material_dir']), 'program_dir' => $this->input['program_dir'] ? $this->input['program_dir'] : 'm2o', 'program_url' => urldecode($this->input['program_url']), 'jsphpdir' => urldecode($this->input['jsphpdir']), 'jsphpurl' => urldecode($this->input['jsphpurl']), 'support_module' => empty($this->input['support_module']) ? '' : implode(',', $this->input['support_module']), 'support_content_type' => empty($this->input['support_content_type']) ? '' : implode(',', $this->input['support_content_type']), 'is_video_record' => intval($this->input['is_video_record']), 'user_email' => $this->input['user_email'], 'custom_content_dir' => $this->input['custom_content_dir'] ? trim($this->input['custom_content_dir'], '/') . '/' : '', 'custom_content_url' => trim($this->input['custom_content_url']));
     if (empty($data['site_name'])) {
         $this->errorOutput("填写信息不全,请检测站点名称,站点域名,站点子域名是否填写");
     }
     if ($site_id) {
         $old_site_detail = $this->obj->get_site_by_id($site_id);
     }
     //先查询这个站点跟目录是否被应用
     if ($data['domain']) {
         $domain_data = array('type' => $this->settings['domain_type']['site'], 'from_id' => $site_id, 'sub_domain' => $data['sub_weburl'], 'domain' => $data['weburl'], 'path' => $data['site_dir']);
         if (!common::check_domain($domain_data)) {
             $this->errorOutput("域名子域名已存在,请重新输入!");
         }
     } else {
         if ($old_site_detail['domain']) {
             //删除这个栏目域名
             common::delete_domain($this->settings['domain_type']['site'], $site_id);
         }
     }
     if (empty($data['support_client'])) {
         $allclient = $this->obj->get_client();
         foreach ($allclient as $k => $v) {
             $client_ids .= $v['id'] . ',';
         }
         $client_ids = trim($client_ids, ',');
         $data['support_client'] = $client_ids;
     } else {
         $data['support_client'] = implode(',', $data['support_client']);
     }
     //站点百度视频收录处理
     if ($data['is_video_record']) {
         $data['is_video_record'] = 1;
         $data['video_record_count'] = empty($this->input['video_record_count']) ? 500 : intval($this->input['video_record_count']);
         //建立视频收录目录
         //			if($data['video_record_url'])
         //			{
         //				hg_mkdir($data['video_record_url']);
         //			}
         $data['video_record_url'] = $this->input['video_record_url'];
         $data['video_update_peri'] = intval($this->input['video_update_peri']);
         $data['video_record_filename'] = $this->input['video_record_filename'];
     }
     if ($site_id) {
         //更新
         if (!($site = $this->obj->update_site($site_id, $data))) {
             $this->errorOutput("更新失败!");
         }
         //更新domain
         if ($data['domain']) {
             common::update_domain($domain_data);
         }
         //查询出站点详细信息
         //$site_detail = $this->obj->get_site_by_id($site_id);
         //站点插入到cms并保存cms站点id
         $cms_site_data = array('cms_siteid' => $site_id, 'site_name' => $data['site_name'], 'content' => $data['content'], 'sitedir' => $data['site_dir'], 'weburl' => 'http://' . ($data['sub_weburl'] ? $data['sub_weburl'] . '.' : '') . rtrim($data['weburl'], '/') . '/', 'site_keywords' => $data['site_keywords'], 'produce_format' => $data['produce_format'], 'indexname' => $data['indexname'], 'suffix' => $data['suffix'], 'material_fmt' => $data['material_fmt'], 'material_url' => $data['material_url'], 'tem_material_url' => $data['tem_material_url'], 'tem_material_dir' => $data['tem_material_dir'], 'program_dir' => $data['program_dir'], 'program_url' => $data['program_url'], 'jsphpdir' => $data['jsphpdir']);
         $cms_site_id = $this->pub_cms->update_cms_site($cms_site_data);
         $allclient = $this->obj->get_client();
         //获取所有模块
         //$data['module'] = common::get_module();
         //获取站点可以支持的内容类型
         //$data['content_type'] = $this->pub_content->get_content_type_by_colid($site_id,'','1');
         $data['site'] = $site;
         $data['client'] = $allclient;
         $this->addLogs('更新站点', $old_site_detail, $data, $old_site_detail['site_name']);
     } else {
         $data['create_time'] = TIMENOW;
         $data['user_id'] = $this->user['user_id'];
         $data['user_name'] = $this->user['user_name'];
         //插入
         if ($site_id = $this->obj->insert_site($data)) {
             common::insert_domain($data + array('type' => $this->settings['domain_type']['site'], 'from_id' => $site_id, 'path' => $data['site_dir']));
             //站点插入到cms并保存cms站点id
             $cms_site_data = array('site_id' => $site_id, 'site_name' => $data['site_name'], 'content' => $data['content'], 'sitedir' => $data['site_dir'], 'weburl' => 'http://' . ($data['sub_weburl'] ? $data['sub_weburl'] . '.' : '') . rtrim($data['weburl'], '/') . '/', 'site_keywords' => $data['site_keywords'], 'material_fmt' => $data['material_fmt'], 'material_url' => $data['material_url'], 'tem_material_url' => $data['tem_material_url'], 'program_dir' => $data['program_dir'], 'program_url' => $data['program_url'], 'jsphpdir' => $data['jsphpdir']);
             $cms_site_id = $this->pub_cms->insert_cms_site($cms_site_data);
             //$this->obj->update_site($site_id,array('cms_site_id'=>$cms_site_id));
             $this->addLogs('新增站点', '', $data, $data['name']);
         } else {
             $this->errorOutput("添加失败!");
         }
         $allclient = $this->obj->get_client();
         $data['client'] = $allclient;
         $data['site_id'] = $site_id;
     }
     if ($this->settings['is_syn_clouds']) {
         if (!$this->input['site_id']) {
             $syn_data['site_name'] = $data['site_name'];
         } else {
             $syn_data = $this->obj->get_site_by_id($site_id, ' id,syn_id,site_name ');
             $syn_data = $syn_data + $data;
             $syn_data['id'] = $syn_data['syn_id'];
             $syn_data['site_id'] = $syn_data['syn_id'];
//.........这里部分代码省略.........
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:site.php

示例4: create_update

 public function create_update()
 {
     $site_id = intval($this->input['site_id']);
     $data = array('site_name' => urldecode($this->input['site_name']), 'site_keywords' => urldecode($this->input['site_keywords']), 'content' => urldecode($this->input['content']), 'weburl' => urldecode($this->input['weburl']), 'site_dir' => urldecode($this->input['site_dir']), 'produce_format' => urldecode($this->input['produce_format']), 'indexname' => urldecode($this->input['indexname']), 'suffix' => urldecode($this->input['suffix']), 'material_fmt' => urldecode($this->input['material_fmt']), 'material_url' => urldecode($this->input['material_url']), 'tem_material_url' => urldecode($this->input['tem_material_url']), 'tem_material_dir' => urldecode($this->input['tem_material_dir']), 'program_dir' => urldecode($this->input['program_dir']), 'jsphpdir' => urldecode($this->input['jsphpdir']), 'imagewidth' => intval($this->input['imagewidth']), 'imageheight' => intval($this->input['imageheight']), 'pro_page_num' => intval($this->input['pro_page_num']));
     if (empty($data['site_name']) || empty($data['weburl'])) {
         $this->errorOutput("填写信息不全");
     }
     if ($site_id) {
         //先查询这个站点跟目录是否被应用
         if (!common::check_domain($data['weburl'], $data['site_dir'], $this->settings['domain_type']['site'], $site_id)) {
             $this->errorOutput("域名或对应目录存在,请重新输入!");
         }
         //更新
         if (!($site = $this->obj->update_site($site_id, $data))) {
             $this->errorOutput("更新失败!");
         }
         $this->addItem($site);
         $this->output();
     } else {
         //先查询这个站点跟目录是否被应用
         if (!common::check_domain($data['weburl'], $data['site_dir'])) {
             $this->errorOutput("域名或对应目录存在,请重新输入!");
         }
         //插入
         if ($site_id = $this->obj->insert_site($data)) {
             common::insert_domain($data['weburl'], $data['site_dir'], $this->settings['domain_type']['site'], $site_id);
         } else {
             $this->errorOutput("添加失败!");
         }
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:31,代码来源:site.php

示例5: operate

 public function operate()
 {
     if ($this->mNeedCheckIn && !$this->prms['create_update']) {
         $this->errorOutput(NO_OPRATION_PRIVILEGE);
     }
     $site_id = intval($this->input['site_id']);
     $data = array('support_client' => $this->input['client'], 'site_name' => $this->input['site_name'], 'site_keywords' => urldecode($this->input['site_keywords']), 'content' => urldecode($this->input['content']), 'sub_weburl' => trim(urldecode($this->input['sub_weburl']), '/'), 'weburl' => trim(urldecode($this->input['weburl']), '/'), 'site_dir' => urldecode($this->input['site_dir']), 'produce_format' => urldecode($this->input['produce_format']), 'indexname' => urldecode($this->input['indexname']), 'suffix' => urldecode($this->input['suffix']), 'tem_material_url' => urldecode($this->input['tem_material_url']), 'tem_material_dir' => urldecode($this->input['tem_material_dir']), 'program_dir' => urldecode($this->input['program_dir']), 'program_url' => urldecode($this->input['program_url']), 'jsphpdir' => urldecode($this->input['jsphpdir']), 'support_module' => empty($this->input['support_module']) ? '' : implode(',', $this->input['support_module']), 'support_content_type' => empty($this->input['support_content_type']) ? '' : implode(',', $this->input['support_content_type']), 'is_video_record' => intval($this->input['is_video_record']), 'user_email' => $this->input['user_email']);
     if (empty($data['site_name']) || empty($data['weburl']) || empty($data['sub_weburl'])) {
         $this->errorOutput("填写信息不全,请检测站点名称,站点域名,站点子域名是否填写");
     }
     //先查询这个站点跟目录是否被应用
     $domain_data = array('type' => $this->settings['domain_type']['site'], 'from_id' => $site_id, 'sub_domain' => $data['sub_weburl'], 'domain' => $data['weburl'], 'path' => $data['site_dir']);
     if (!common::check_domain($domain_data)) {
         $this->errorOutput("域名子域名已存在,请重新输入!");
     }
     if (empty($data['support_client'])) {
         $allclient = $this->obj->get_client();
         foreach ($allclient as $k => $v) {
             $client_ids .= $v['id'] . ',';
         }
         $client_ids = trim($client_ids, ',');
         $data['support_client'] = $client_ids;
     } else {
         $data['support_client'] = implode(',', $data['support_client']);
     }
     //站点百度视频收录处理
     if ($data['is_video_record']) {
         $data['is_video_record'] = 1;
         $data['video_record_count'] = empty($this->input['video_record_count']) ? 500 : intval($this->input['video_record_count']);
         //建立视频收录目录
         //			if($data['video_record_url'])
         //			{
         //				hg_mkdir($data['video_record_url']);
         //			}
         $data['video_record_url'] = $this->input['video_record_url'];
         $data['video_update_peri'] = intval($this->input['video_update_peri']);
         $data['video_record_filename'] = $this->input['video_record_filename'];
     }
     if ($site_id) {
         //更新
         if (!($site = $this->obj->update_site($site_id, $data))) {
             $this->errorOutput("更新失败!");
         }
         //更新domain
         common::update_domain($domain_data);
         //查询出站点详细信息
         //$site_detail = $this->obj->get_site_by_id($site_id);
         //站点插入到cms并保存cms站点id
         $cms_site_data = array('cms_siteid' => $site_id, 'site_name' => $data['site_name'], 'content' => $data['content'], 'sitedir' => $data['site_dir'], 'weburl' => 'http://' . ($data['sub_weburl'] ? $data['sub_weburl'] . '.' : '') . rtrim($data['weburl'], '/') . '/', 'site_keywords' => $data['site_keywords'], 'produce_format' => $data['produce_format'], 'indexname' => $data['indexname'], 'suffix' => $data['suffix'], 'material_fmt' => $data['material_fmt'], 'material_url' => $data['material_url'], 'tem_material_url' => $data['tem_material_url'], 'tem_material_dir' => $data['tem_material_dir'], 'program_dir' => $data['program_dir'], 'program_url' => $data['program_url'], 'jsphpdir' => $data['jsphpdir']);
         $cms_site_id = $this->pub_cms->update_cms_site($cms_site_data);
         $allclient = $this->obj->get_client();
         //获取所有模块
         //$data['module'] = common::get_module();
         //获取站点可以支持的内容类型
         //$data['content_type'] = $this->pub_content->get_content_type_by_colid($site_id,'','1');
         $data['site'] = $site;
         $data['client'] = $allclient;
         $this->addItem($data);
         $this->output();
     } else {
         $data['create_time'] = TIMENOW;
         //插入
         if ($site_id = $this->obj->insert_site($data)) {
             common::insert_domain($data + array('type' => $this->settings['domain_type']['site'], 'from_id' => $site_id, 'path' => $data['site_dir']));
             //站点插入到cms并保存cms站点id
             $cms_site_data = array('site_id' => $site_id, 'site_name' => $data['site_name'], 'content' => $data['content'], 'sitedir' => $data['site_dir'], 'weburl' => 'http://' . ($data['sub_weburl'] ? $data['sub_weburl'] . '.' : '') . rtrim($data['weburl'], '/') . '/', 'site_keywords' => $data['site_keywords'], 'material_fmt' => $data['material_fmt'], 'material_url' => $data['material_url'], 'tem_material_url' => $data['tem_material_url'], 'program_dir' => $data['program_dir'], 'program_url' => $data['program_url'], 'jsphpdir' => $data['jsphpdir']);
             $cms_site_id = $this->pub_cms->insert_cms_site($cms_site_data);
             //$this->obj->update_site($site_id,array('cms_site_id'=>$cms_site_id));
         } else {
             $this->errorOutput("添加失败!");
         }
         $allclient = $this->obj->get_client();
         $data['client'] = $allclient;
         $this->addItem($data);
         $this->output();
     }
 }
开发者ID:h3len,项目名称:Project,代码行数:77,代码来源:site.php

示例6: operate


//.........这里部分代码省略.........
     //获取栏目支持的客户端,如果为空,则取上级支持的客户端
     $data['support_client'] = $this->obj->get_column_support_client($data['support_client'], $site_id, $column_fid);
     if (!$data['support_client']) {
         $this->errorOutput("未取得客户端");
     }
     //取站点信息
     $site_detail = $this->obj->get_site_by_id($site_id);
     if ($column_id) {
         $dele_ids = '';
         unset($data['site_id']);
         $data['name'] = $column_name;
         if (!$this->obj->update_column($column_id, $data)) {
             $this->errorOutput("更新失败");
         }
         //查看栏目详细信息,看fid是否有改变,如果有改变,则调用节点方法更改
         $coldetail = $this->obj->get_column_first(' parents,fid ', $column_id);
         if ($coldetail['fid'] != $column_fid) {
             $this->col_node->update_node($column_id, $column_fid);
         }
         //计算出栏目的目录
         if ($column_fid) {
             $oth_coldetail = $this->obj->get_column_first(' column_dir,column_url,relate_dir ', $column_fid);
         }
         $column_self_dir = $data['column_dir'] ? $data['column_dir'] : $this->settings['defalult_column_dir'] . $column_id;
         $col_dir = (empty($oth_coldetail['column_dir']) ? '' : $oth_coldetail['column_dir']) . '/' . $column_self_dir;
         $this->obj->update_column($column_id, array('column_dir' => $col_dir));
         $now = $this->obj->get_column_first(' * ', $column_id);
         $this->change_dir($old_coldetail, $now, $column_id, $column_self_dir);
         //更新domain
         if ($data['childdomain']) {
             $domain_data['path'] = $col_dir;
             common::update_domain($domain_data);
         }
         if ($old_coldetail['childs']) {
             $childs_data = $this->obj->get_column_by_id(' * ', $old_coldetail['childs'], 'id');
             foreach (explode(',', $old_coldetail['childs']) as $cms_column_id) {
                 if ($cms_column_id) {
                     //栏目插入到cms并保存cms栏目id
                     $cms_column_data = array('column_id' => $cms_column_id, 'name' => $childs_data[$cms_column_id]['name'], 'brief' => $childs_data[$cms_column_id]['content'], 'cms_fid' => $childs_data[$cms_column_id]['fid'], 'cms_siteid' => $childs_data[$cms_column_id]['site_id'], 'column_dir' => $childs_data[$cms_column_id]['column_dir'], 'relate_dir' => $childs_data[$cms_column_id]['relate_dir'], 'linkurl' => $childs_data[$cms_column_id]['linkurl'], 'childdomain' => $childs_data[$cms_column_id]['childdomain'], 'colindex' => $childs_data[$cms_column_id]['colindex']);
                     $this->pub_cms->update_cms_column($cms_column_data);
                 }
             }
         }
         //删除部署里栏目未支持的内容类型,同时处理对应支持模块来删除对应的支持内容类型
         //			$new_con_type = $this->pub_content->get_content_type_by_colid($column_id,1);
         //			foreach($new_con_type as $k=>$v)
         //			{
         //				$new_con_typestr .= $v['id'].',';
         //			}
         //			$new_con_typestr = trim($new_con_typestr,',');
         //			if($new_con_typestr)
         //			{
         //				$sedata = array('support_content_type'=>$new_con_typestr);
         //				//根据栏目支持的模块更新栏目支持的内容类型
         //				$this->obj->update_column($column_id,$sedata);
         //			}
         //			$this->pub_sys->delete_column_template($column_id,empty($this->input['support_content_type'])?'':implode(',',$this->input['support_content_type']));
         //更新图片
         $this->update_pic($column_id, $data['support_client']);
     } else {
         //先插入节点
         $id = $this->col_node->insert_node($column_name, $column_fid, $data);
         //更新sort_id 排序id
         $this->obj->update_column($id, array('sort_id' => $id));
         //计算出栏目的目录
         if ($column_fid) {
             $oth_coldetail = $this->obj->get_column_first(' column_dir,column_url,relate_dir ', $column_fid);
         }
         $column_self_dir = $data['column_dir'] ? $data['column_dir'] : $this->settings['defalult_column_dir'] . $id;
         $col_dir = (empty($oth_coldetail['column_dir']) ? '' : $oth_coldetail['column_dir']) . '/' . $column_self_dir;
         //插入子域名
         if ($data['childdomain']) {
             $domain_data['path'] = $col_dir;
             common::insert_domain($domain_data + array('from_id' => $id));
         }
         //计算出栏目的相对路径
         if ($data['childdomain']) {
             $relate_dir = '';
         } else {
             $relate_dir = (empty($oth_coldetail['relate_dir']) ? '' : $oth_coldetail['relate_dir']) . '/' . $column_self_dir;
         }
         $this->obj->update_column($id, array('column_dir' => $col_dir, 'relate_dir' => $relate_dir));
         //栏目插入到cms并保存cms栏目id
         $cms_column_data = array('cms_columnid' => $id, 'name' => $column_name, 'brief' => $data['content'], 'cms_fid' => $column_fid, 'cms_siteid' => $site_id, 'column_dir' => $col_dir, 'linkurl' => $data['linkurl'], 'orderid' => $id, 'relate_dir' => $relate_dir, 'childdomain' => $data['childdomain'], 'colindex' => $data['colindex']);
         $cms_column_id = $this->pub_cms->insert_cms_column($cms_column_data);
         if ($fast_add_column) {
             $this->addItem($id);
             $this->output();
         }
         //插入图片
         $this->insert_pic($id, $data['support_client']);
     }
     $data['site_id'] = $data['site_id'];
     $data['column_id'] = $column_id;
     $data['column_fid'] = $column_fid;
     //获取栏目支持的模块 from table app
     //		$data['module'] = common::get_module();
     $this->addItem($data);
     $this->output();
 }
开发者ID:h3len,项目名称:Project,代码行数:101,代码来源:column.php


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