给DiscuzX3.2门户添加四级频道栏目
认discuzX门户支持三级栏目的,但是如果添加四级需要修改程序才可以,具体是修改source/admincp/admincp_portalcategory.php的751-767行代码,把
[*] if($level == 2) {
[*] $class = $last ? 'lastchildboard' : 'childboard';
[*] $return = '<tr class="hover" id="cat'.$value['catid'].'"><td> </td><td class="td25"><input type="text" class="txt" name="neworder['.$value['catid'].']" value="'.$value['displayorder'].'" /></td><td><div class="'.$class.'">'.
[*] '<input type="text" class="txt" name="name['.$value['catid'].']" value="'.$value['catname'].'" />'.
[*] '</div>'.
[*] '</td><td>'.$value['articles'].'</td>'.
[*] '<td>'.(empty($value['disallowpublish']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td>'.(!empty($value['allowcomment']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td>'.(empty($value['closed']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td><input class="radio" type="radio" name="newsetindex" value="'.$value['catid'].'" '.($value['caturl'] == $_G['setting']['defaultindex'] ? 'checked="checked"':'').' /></td>'.
[*] '<td><a href="'.$value['caturl'].'" target="_blank">'.cplang('view').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=edit&catid='.$value['catid'].'">'.cplang('edit').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=move&catid='.$value['catid'].'">'.cplang('portalcategory_move').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=delete&catid='.$value['catid'].'">'.cplang('delete').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=diytemplate&operation=perm&targettplname=portal/list_'.$value['catid'].'&tpldirectory='.getdiydirectory($value['primaltplname']).'">'.cplang('portalcategory_blockperm').'</a></td>
[*] <td><a href="'.ADMINSCRIPT.'?action=article&operation=list&&catid='.$value['catid'].'">'.cplang('portalcategory_articlemanagement').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=perm&catid='.$value['catid'].'">'.cplang('portalcategory_articleperm').'</a>'.$publish.'</td></tr>';
复制代码
替换为
[*] if ($level == 3) {
[*] $class = $last ? 'lastthirdboard' : 'thirdboard';
[*] $return = '<tr class="hover" id="cat'.$value['catid'].'"><td> </td><td class="td25"><input type="text" class="txt" name="neworder['.$value['catid'].']" value="'.$value['displayorder'].'" /></td><td><div class="'.$class.'">'.
[*] '<input type="text" class="txt" name="name['.$value['catid'].']" value="'.$value['catname'].'" />'.
[*] '</div>'.
[*] '</td><td>'.$value['articles'].'</td>'.
[*] '<td>'.(empty($value['disallowpublish']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td>'.(!empty($value['allowcomment']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td>'.(empty($value['closed']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td><input class="radio" type="radio" name="newsetindex" value="'.$value['catid'].'" '.($value['caturl'] == $_G['setting']['defaultindex'] ? 'checked="checked"':'').' /></td>'.
[*] '<td><a href="'.$value['caturl'].'" target="_blank">'.cplang('view').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=edit&catid='.$value['catid'].'">'.cplang('edit').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=move&catid='.$value['catid'].'">'.cplang('portalcategory_move').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=delete&catid='.$value['catid'].'">'.cplang('delete').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=diytemplate&operation=perm&targettplname=portal/list_'.$value['catid'].'&tpldirectory='.getdiydirectory($value['primaltplname']).'">'.cplang('portalcategory_blockperm').'</a></td>
[*] <td><a href="'.ADMINSCRIPT.'?action=article&operation=list&&catid='.$value['catid'].'">'.cplang('portalcategory_articlemanagement').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=perm&catid='.$value['catid'].'">'.cplang('portalcategory_articleperm').'</a>'.$publish.'</td></tr>';
[*] }elseif($level == 2) {
[*] $class = $last ? 'lastchildboard' : 'childboard';
[*] $return = '<tr class="hover" id="cat'.$value['catid'].'"><td> </td><td class="td25"><input type="text" class="txt" name="neworder['.$value['catid'].']" value="'.$value['displayorder'].'" /></td><td><div class="'.$class.'">'.
[*] '<input type="text" class="txt" name="name['.$value['catid'].']" value="'.$value['catname'].'" />'.
[*] '<a class="addchildboard" href="'.ADMINSCRIPT.'?action=portalcategory&operation=add&upid='.$value['catid'].'">'.cplang('portalcategory_addfourthcategory').'</a></div>'.
[*] '</td><td>'.$value['articles'].'</td>'.
[*] '<td>'.(empty($value['disallowpublish']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td>'.(!empty($value['allowcomment']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td>'.(empty($value['closed']) ? cplang('yes') : cplang('no')).'</td>'.
[*] '<td><input class="radio" type="radio" name="newsetindex" value="'.$value['catid'].'" '.($value['caturl'] == $_G['setting']['defaultindex'] ? 'checked="checked"':'').' /></td>'.
[*] '<td><a href="'.$value['caturl'].'" target="_blank">'.cplang('view').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=edit&catid='.$value['catid'].'">'.cplang('edit').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=move&catid='.$value['catid'].'">'.cplang('portalcategory_move').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=delete&catid='.$value['catid'].'">'.cplang('delete').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=diytemplate&operation=perm&targettplname=portal/list_'.$value['catid'].'&tpldirectory='.getdiydirectory($value['primaltplname']).'">'.cplang('portalcategory_blockperm').'</a></td>
[*] <td><a href="'.ADMINSCRIPT.'?action=article&operation=list&&catid='.$value['catid'].'">'.cplang('portalcategory_articlemanagement').'</a>
[*] <a href="'.ADMINSCRIPT.'?action=portalcategory&operation=perm&catid='.$value['catid'].'">'.cplang('portalcategory_articleperm').'</a>'.$publish.'</td></tr>';
[*] for($i=0,$L=count($value['children']); $i<$L; $i++) {
[*] $return .= showcategoryrow($value['children'][$i], 3, $i==$L-1);
[*] }
复制代码
然后再在\static\image\admincp\admincp.css的317行后添加
[*] .thirdboard{ padding-left:165px; background:url(bg_repno.gif) no-repeat -130px -550px; }
[*] .lastthirdboard{ padding-left:165px; background:url(bg_repno.gif) no-repeat -130px -600px; }
复制代码
在\source\language\lang_admincp.php的6590下添加
[*] 'portalcategory_addfourthcategory' => '添加四级频道栏目',
复制代码
这样就可以在频道栏目中就可以看到第四级的栏目设置了
页:
[1]