/** * 修改某个分类的子类模板 * * @param $cate_id 分类ID * @param $type 类型:cover,list,content * @param $level 级数 * @param $tpl 模板变量值 */ function update_cate_tpl($cate_id, $type, $level, $tpl) { global $dbm, $c; $_cate = $c->cate_son($cate_id); $dbm->query_update("update " . TB_PREFIX . "category set tpl_" . $type . "='" . $tpl . "' where cate_id='" . $cate_id . "'"); foreach ($_cate as $a) { $dbm->query_update("update " . TB_PREFIX . "category set tpl_" . $type . "='" . $tpl . "' where cate_id='" . $a['cate_id'] . "'"); if ($level == 'son') { } else { update_cate_tpl($a['cate_id'], $type, $level, $tpl); } } }
/** * 修改某个分类的子类模板 * * @param $cate_id 分类ID * @param $type 类型:cover,list,content * @param $level 级数 * @param $tpl 模板变量值 */ function update_cate_tpl($cate_id, $type, $level, $tpl) { global $c_obj; $_cate = $c_obj->cate_son($cate_id); $c_obj->update(array("tpl_" . $type => $tpl), $cate_id); foreach ($_cate as $a) { $c_obj->update(array("tpl_" . $type => $tpl), $a['cate_id']); if ($level == 'son') { } else { update_cate_tpl($a['cate_id'], $type, $level, $tpl); } } }