与
ESC
输入关键词搜索文章

phpcms V9 应用URL规则到所有子栏目

全文约 220 字预计阅读 1 分钟
后台找不到批量修改url规则到所有子栏目的选项,可是尽然模版和权限竟然都可以应用到所有子栏目,懒得去弄新的,直接写到模版应用到子栏目的函数里,以下代码红色部分就是后来添加的,你们根据需要再修改下。 文件路径:/phpcms/modules/admin/category.php //应用模板到所有子栏目 if($_POST['template_child']){ $this->categorys = $categorys = $this->db->select(array('siteid'=>$this->siteid,'module'=>'content'), '*', '', 'listorder ASC, catid ASC', '', 'catid'); $idstr = $this->get_arrchildid($catid); if(!empty($idstr)){ $sql = "select catid,setting from phpcms_category where catid in($idstr)"; $this->db->query($sql); $arr = $this->db->fetch_array(); if(!empty($arr)){ foreach ($arr as $v){ $new_setting = array2string( array_merge(string2array($v['setting']), array('category_template' => $_POST['setting']['category_template'],'list_template' => $_POST['setting']['list_template'],'show_template' => $_POST['setting']['show_template'] ,'category_ruleid'=>$setting['category_ruleid'],'show_ruleid'=>$setting['show_ruleid']))//添加了url规则更新 ); $this->db->update(array('setting'=>$new_setting), 'catid='.$v['catid']); } } } }  
phpcms V9 应用URL规则到所有子栏目
分享

发表评论

评论 0 条

暂无评论,来说点什么吧。