linhuiming
因上努力,果上随缘

7.2 应用举例 页面头部

  • LinHuiMing

7.2 应用举例 页面头部

模板变量名:[!--temp.header--]

常用代码

1、导航

一级导航

   <nav>      <ul id="starlist">        <li><a href="[!--news.url--]" title="首页">网站首页</a></li>[showclasstemp]'0',12,0,0[/showclasstemp]       </ul>    </nav>

二级导航

<ul id="starlist">  <li><a href="[!--news.url--]">网站首页</a></li>  [e:loop={"select classid,classname,islast,sonclass from {$dbtbpre}enewsclass where bclassid=0 and showclass=0 order by myorder,classid ASC",0,24,0}]  <?php $classurl=sys_ReturnBqClassname($bqr,0);//取得栏目地址 ?>  <?phpif($bqr[sonclass]=='' or $bqr[sonclass]=='|') //判断是否存在子栏目{?>  <li><a href="<?=$bqsr[classurl]?>">    <?=$bqr[classname]?>    </a></li>  <?php        }else        {?>  <li class="menu"><a href="<?=$bqsr[classurl]?>">    <?=$bqr[classname]?>    </a>    <ul class="sub">      <?php          $newsclass=$empire->query("select classid,classname from ".$dbtbpre."enewsclass where bclassid=".$bqr[classid]."  and showclass=0 order by myorder,classid asc");while($classr=$empire->fetch($newsclass))    {        $classrurl=sys_ReturnBqClassname($classr,9); //取得子栏目地址        ?>      <li><a href="<?=$classrurl?>">        <?=$classr[classname]?>        </a></li>      <?php}?>    </ul>    <span></span></li>  <?php}?>  [/e:loop]</ul>

2、登录

<div class="user-login"><section><script src="[!--news.url--]e/member/login/loginjs.php"></script><section></div>

3、搜索

<div class="search">            <form action="[!--news.url--]e/search/index.php" method="post" name="searchform" id="searchform">              <input name="keyboard" id="keyboard" class="input_text" value="请输入关键字词" style="color: rgb(153, 153, 153);" onfocus="if(value=='请输入关键字词'){this.style.color='#000';value=''}" onblur="if(value==''){this.style.color='#999';value='请输入关键字词'}" type="text">              <input name="show" value="title" type="hidden">              <input name="tempid" value="1" type="hidden">              <select name="tbname">                <option value="news">博客</option>                <option value="photo">相册</option>                <option value="movie">视频</option>              </select>              <input name="Submit" class="input_submit" value="搜索" type="submit">            </form>          </div>
  • YES
  • NO
更多>>

相关文章