- PHP code
if(is_array($data['relatedtag']['order'])) { asort($data['relatedtag']['order']); $relatedtag = array(); foreach($data['relatedtag']['order'] AS $k => $v) { $relatedtag['status'][$k] = $data['relatedtag']['status'][$k]; $relatedtag['name'][$k] = $data['relatedtag']['name'][$k]; $relatedtag['limit'][$k] = $data['relatedtag']['limit'][$k]; $relatedtag['template'][$k] = $data['relatedtag']['template'][$k]; } $data['relatedtag'] = $relatedtag; foreach((array)$data['relatedtag']['status'] AS $appid => $status) { if(!$status) { unset($data['relatedtag']['limit'][$appid]); } } unset($data['relatedtag']['status'], $data['relatedtag']['order'], $relatedtag); }
上边的这段代码是 discuz7.2 中 cache_func.php 中的 relatedtag 的值在后台或别的地方那里可以设置(非手动修改)
------解决方案--------------------
这个好像没法设置吧
$data是程序中声明的空数组 $data = array();