你现在的位置:首页 > PHP网站建设知识库 > Discuz > 正文

如何让discuz的footer底部居中显示

很多用discuz网站开发的朋友都对discuz默认模板的footer底部不太满意或者说是不习惯,因为它的版权信息和网站底部导航分为两边了。今天,特意分享一个简单的修改方法,供大家参考。

打开discuz的\template\default\common\footer.htm,寻找代码:

<div id="flk" class="y">  
            <p>  
                <!--{loop $_G['setting']['footernavs'] $nav}--><!--{if $nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||  
                        !$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile'))}-->$nav[code]<span class="pipe">|</span><!--{/if}--><!--{/loop}-->  
                        <strong><a href="$_G['setting']['siteurl']" target="_blank">$_G['setting']['sitename']</a></strong>  
                <!--{if $_G['setting']['icp']}-->( <a href="" target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->  
                <!--{hook/global_footerlink}-->  
                <!--{if $_G['setting']['statcode']}-->$_G['setting']['statcode']<!--{/if}-->  
            </p>  
            <p class="xs0">  
                {lang time_now}  
                <span id="debuginfo">  
                <!--{if debuginfo()}-->, Processed in $_G[debuginfo][time] second(s), $_G[debuginfo][queries] queries  
                    <!--{if $_G['gzipcompress']}-->, Gzip On<!--{/if}--><!--{if C::memory()->type}-->, <!--{echo ucwords(C::memory()->type)}--> On<!--{/if}-->.  
                <!--{/if}-->  
                </span>  
            </p>  
        </div>  
        <div id="frt">  
            <p>Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em>$_G['setting']['version']</em><!--{if !empty($_G['setting']['boardlicensed'])}--> <a href="http://license.comsenz.com/?pid=1&host=$_SERVER[HTTP_HOST]" target="_blank">Licensed</a><!--{/if}--></p>  
            <p class="xs0">© 2001-2012 <a href="http://www.comsenz.com" target="_blank">Comsenz Inc.</a></p>  
        </div>  
        <!--{eval updatesession();}-->  

替换成:

<div style="text-align:center;">  
            <p style="border:#cdcdcd 1px solid; padding:5px 0;">  
                <!--{loop $_G['setting']['footernavs'] $nav}--><!--{if $nav['available'] && ($nav['type'] && (!$nav['level'] || ($nav['level'] == 1 && $_G['uid']) || ($nav['level'] == 2 && $_G['adminid'] > 0) || ($nav['level'] == 3 && $_G['adminid'] == 1)) ||  
                        !$nav['type'] && ($nav['id'] == 'stat' && $_G['group']['allowstatdata'] || $nav['id'] == 'report' && $_G['uid'] || $nav['id'] == 'archiver' || $nav['id'] == 'mobile'))}-->$nav[code]<span class="pipe">|</span><!--{/if}--><!--{/loop}-->  
                        <strong><a href="$_G['setting']['siteurl']" target="_blank">$_G['setting']['sitename']</a></strong>  
                <!--{if $_G['setting']['icp']}-->( <a href="" target="_blank">$_G['setting']['icp']</a> )<!--{/if}-->  
                <!--{hook/global_footerlink}-->  
                <!--{if $_G['setting']['statcode']}-->$_G['setting']['statcode']<!--{/if}-->  
            </p>  
        </div>  
        <p style="text-align:center; padding:13px 0 5px 0;">  
            CopyRight © 2002-2012 <a href="http://www.phpstudio.info/" target="_blank" style="color:#666;">PHP网站建设工作室</a>  , All Rights Reserved .  
        </p>  
        <div style="text-align:center;">  
            <p><!--{if !empty($_G['setting']['boardlicensed'])}--> <a href="http://license.comsenz.com/?pid=1&host=$_SERVER[HTTP_HOST]" target="_blank">Licensed</a><!--{/if}--></p>  
              
            <p><span class="xs0">Powered by <strong><a href="http://www.discuz.net" target="_blank">Discuz!</a></strong> <em>$_G['setting']['version']</em></span>  
            <script src="http://s9.cnzz.com/stat.php?id=x&web_id=x&show=pic" language="JavaScript"></script>  
            </p>  
        </div>  
        <!--{eval updatesession();}-->  

 

然后结合自己的需要,对代码进行修改。