Discuz 获取分区名称(一级版块名称)

关键的内容在于 $thisgid

     <!--{if $_GET[‘tid‘] || $_GET[‘fid‘]}-->
         <!--{if $thisgid == 57 || $thisgid == 69 || $thisgid == 120}-->
             <strong><!--{eval echo mb_substr($_G[‘cache‘][‘forums‘][1][‘name‘],0,2,‘gb2312‘)}--></strong>
         <!--{else}-->
            <strong><!--{eval echo mb_substr($_G[‘cache‘][‘forums‘][$thisgid][‘name‘],0,2,‘gb2312‘)}--></strong>
         <!--{/if}-->
     <!--{elseif $_GET[‘gid‘]}-->
         <!--{if $_GET[‘gid‘] == 1}-->
        <strong>北京</strong>
        <!--{elseif $_GET[‘gid‘] == 39}-->
        <strong>武汉</strong>
        <!--{elseif $_GET[‘gid‘] == 77}-->
        <strong>天津</strong>
        <!--{elseif $_GET[‘gid‘] == 40}-->
        <strong>太原</strong>
        <!--{elseif $_GET[‘gid‘] == 49}-->
        <strong>西安</strong>
        <!--{elseif $_GET[‘gid‘] == 85}-->
        <strong>济南</strong>
        <!--{elseif $_GET[‘gid‘] == 96}-->
        <strong>威海</strong>
        <!--{elseif $_GET[‘gid‘] == 97}-->
        <strong>保定</strong>
        <!--{elseif $_GET[‘gid‘] == 98}-->
        <strong>苏州</strong>
        <!--{elseif $_GET[‘gid‘] == 99}-->
        <strong>南京</strong>
        <!--{else}-->
        <strong>北京</strong>
        <!--{/if}-->
     <!--{else}-->
        <!--{if strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"taiyuan")}-->
        <strong>太原</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"wuhan")}-->
        <strong>武汉</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"tianjin")}-->
        <strong>天津</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"xian")}-->
        <strong>西安</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"jinan")}-->
        <strong>济南</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"weihai")}-->
        <strong>威海</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"baoding")}-->
        <strong>保定</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"suzhou")}-->
        <strong>苏州</strong>
        <!--{elseif strstr($_SERVER[‘HTTP_HOST‘].$_SERVER[‘REQUEST_URI‘],"nanjing")}-->
        <strong>南京</strong>
        <!--{else}-->
        <strong>北京</strong>
        <!--{/if}-->
    <!--{/if}-->

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。