本帖最后由 土包 于 2014-1-12 22:36 编辑 网站添加化龙巷左侧导航栏的方法,亲测,可以看下边的效果展示
效果展示:http://bbs.xianer.net/forum.php?mod=forumdisplay&fid=2
在你需要添加左侧导航的页面,添加如下代码。尽量添加在head代码,或者页面代码的上部 - <div class="comiis_left_divs wp">
- <div id="comiis_left_bars"> <a onClick="this.parentNode.style.display='none'" href="javascript:;" class="comiis_left_closes"><IMG src="{$_G['style']['styleimgdir']}/comiis_close.gif" /></a>
- <p> </p>
- <!--{eval $temp = $dpost = array();$on=0;$query = DB::query("SELECT fid,fup,type,name,todayposts,domain FROM ".DB::table('forum_forum')." WHERE status='1' ORDER BY displayorder;");while($data = DB::fetch($query)) $temp[]=$data;}-->
- <!--{loop $temp $bbs_group}-->
- <!--{if $bbs_group['type']=="group"}-->
- <!--{eval $on++;}-->
- <dl>
- <!--{eval $forumurl = !empty($bbs_group['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? 'http://'.$bbs_group['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?gid='.$bbs_group['fid'];}-->
- <dt> <a href="{$forumurl}" >{$bbs_group['name']}</a> </dt>
- <dd>
- <!--{loop $temp $bbs_forum}-->
- <!--{if $bbs_forum['fup']==$bbs_group['fid'] and $bbs_forum['type']=="forum"}-->
- <!--{eval $forumurl = !empty($bbs_forum['domain']) && !empty($_G['setting']['domain']['root']['forum']) ? 'http://'.$bbs_forum['domain'].'.'.$_G['setting']['domain']['root']['forum'] : 'forum.php?mod=forumdisplay&fid='.$bbs_forum['fid'];}-->
- <a href="{$forumurl}"{if $_G['fid']==$bbs_forum['fid']} class="kmon"{/if}>{$bbs_forum['name']}</a>
- <!--{/if}-->
- <!--{/loop}-->
- </dd>
- </dl>
- <!--{/if}-->
- <!--{/loop}-->
- </div>
- </div>
复制代码
在common的最底处添加如下css样式。
- .comiis_left_divs{position:relative;overflow:visible;z-index:190;}
- #comiis_left_bars{border:#D7E1F4 1px solid;position:absolute;width:120px;background:#fff;top:-8px;left:-128px;border-radius:3px;}
- #comiis_left_bars p{text-align:center;line-height:40px;background:url({STYLEIMGDIR}/comiis_bg.gif) repeat-x 0px 0px;color:#FFFFFF;font-size:16px;font-weight:400;height:40px;overflow:hidden;border-radius:3px 3px 0px 0px;margin:1px;}
- #comiis_left_bars dl dt{padding-left:10px;background:#EEF9FF;height:30px;border-top:#D7E1F4 1px solid;border-bottom:#D7E1F4 1px solid;}
- #comiis_left_bars dl dt a{line-height:30px;color:#EE1B2E;font-size:14px;font-weight:700;text-decoration:none}
- #comiis_left_bars dl dd{padding:5px;font-size:14px;}
- #comiis_left_bars dl dd a.comiis_sub{font-size:12px;text-indent:12px;background-image:url({STYLEIMGDIR}/comiis_dot.gif);background-repeat:no-repeat;background-position:8px 12px;}
- #comiis_left_bars dl dd a{line-height:28px;padding-left:5px;display:block;height:28px;color:#575757;overflow:hidden;}
- #comiis_left_bars dl dd a.kmon,#comiis_left_bars dl dd a:hover{background-color:#EEF9FF;color:#EE1B2E;text-decoration:none;}
- .comiis_left_closes{position:absolute;top:-15px;right:2px;background:#fff;}
- .ie6 #comiis_left_bars p,.ie6 #comiis_left_bars dl dt a{font-weight:700;}
- /*--copy right www.xianer.net*/
复制代码
然后把两个文件,放到你模板的指定文件包内既可
|