{* 获取当前请求的大版块ID和小版块ID 小版块ID将被全局继承 *} {_ $temp_nav_1_id = $yxphp_url[1]} {_ $temp_nav_2_id = $yxphp_url[2]} {* 如果当前访问的是首页 则赋予首页链接样式 否则不赋予样式 *} {if $HTML_TEMPLATE == yxphp_md5_template_users.'index.html'}
  • 网站首页
  • {else}
  • 网站首页
  • {/if} {* 抓取所有大版块数据 *} {_ $list = $sql->execute('select',array('table' => 'yxphp_com_1_group','where' => array('t_show = true','and','fid=0'),'orderby' => array('t_order','asc'),'limit' =>array()))} {_ $list_count = count($list)} {* 循环作业 *} {for $i=0;$i<$list_count;$i++} {_ $temp_template_name = $list[$i]['t_template']} {_ $temp_template_name = str_replace(yxphp_falseurl,'',$temp_template_name)} {* 如果当前访问的大版块ID与当前的循环的大版块ID不一致 则不赋予样式 否则准备赋予样式 *} {if $temp_nav_1_id!=$list[$i]['id']} {* 如果当前循环的大版块没有指定模板文件 并且定义了站外链接 则赋予站外链接属性 否则为站内链接 *} {if $list[$i]['t_template']=='' && $list[$i]['t_geturl']!=''}
  • {_e $list[$i]['t_name']}
  • {else}
  • {_e $list[$i]['t_name']}
  • {/if} {else}
  • {_e $list[$i]['t_name']}
  • {/if} {/for} {* 赋予样式的方法(class="n") 注:本脚本原则上是通用的 *}