<!--{foreach from=$hot_goods item=goods}-->
  <div class="goodsItem">
         <span class="hot"></span>
           <a href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}" class="goodsimg" /></a><br />
           <p><a href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.short_style_name}</a></p>
           <font class="f1">
           <!-- {if $goods.promote_price neq ""} -->
          {$goods.promote_price}
          <!-- {else}-->
          {$goods.shop_price}
          <!--{/if}-->
           </font>
        </div>
  <!--{/foreach}-->
  <div class="more"><a href="../search.php?intro=hot"><img src="images/more.gif" /></a></div>
  <!-- {if $cat_rec_sign neq 1} -->
  </div>
</div>
</div>
<div class="blank5"></div>
  <!-- {/if} -->
<!-- {/if} -->我想先问一下ECSHOP是用smarty做的吗,有些语法我感觉好奇怪
<!-- {/if} --> 为什么这样写<!-- -->感觉好像是注释掉的。还有我学smarty的时候,只要有两个文件php代码文件和模板文件分离开来,怎么ecshop里面还有个库文件是怎么回事.lbi结尾的。
<!-- #BeginLibraryItem "/library/recommend_hot.lbi" --> <!-- #EndLibraryItem -->这是个包含语句么,这我也没见过,麻烦高手帮我一一解答一下,谢谢

解决方案 »

  1.   

    ecshop 是用smarty来设计的,只是这个开发团队从写了smarty!!!但大体上是相同的, <!-- {   }-->   这个只是标记符,你用什么符号都可以,你自己定,ecshop定义成这个只是为了在dwt中不显示控制语句但SMARTY知道。   。lib  是模块 ,在脚本编程中,你用什么文件你自己可以决定,你自己清楚就是了
      

  2.   


    <!-- #BeginLibraryItem "/library/recommend_hot.lbi" --><!-- {if $hot_goods} -->
    <!-- {if $cat_rec_sign neq 1} -->
    <div class="box">
    <div class="box_2 centerPadd">
      <div class="itemTit Hot" id="itemHot">
          {if $cat_rec[3]}
          <h2><a href="javascript:void(0)" onclick="change_tab_style('itemHot', 'h2', this);get_cat_recommend(3, 0);">{$lang.all_goods}</a></h2>
          {foreach from=$cat_rec[3] item=rec_data}
          <h2 class="h2bg"><a href="javascript:void(0)" onclick="change_tab_style('itemHot', 'h2', this);get_cat_recommend(3, {$rec_data.cat_id})">{$rec_data.cat_name}</a></h2>
          {/foreach}
          {/if}
      </div>
      <div id="show_hot_area" class="clearfix goodsBox">
      <!-- {/if} -->
      <!--{foreach from=$hot_goods item=goods}-->
      <div class="goodsItem">
             <span class="hot"></span>
               <a href="{$goods.url}"><img src="{$goods.thumb}" alt="{$goods.name|escape:html}" class="goodsimg" /></a><br />
               <p><a href="{$goods.url}" title="{$goods.name|escape:html}">{$goods.short_style_name}</a></p>
               <font class="f1">
               <!-- {if $goods.promote_price neq ""} -->
              {$goods.promote_price}
              <!-- {else}-->
              {$goods.shop_price}
              <!--{/if}-->
               </font>
            </div>
      <!--{/foreach}-->
      <div class="more"><a href="../search.php?intro=hot"><img src="images/more.gif" /></a></div>
      <!-- {if $cat_rec_sign neq 1} -->
      </div>
    </div>
    </div>
    <div class="blank5"></div>
      <!-- {/if} -->
    <!-- {/if} --> <!-- #EndLibraryItem -->谢谢楼上大哥回答,再请教一个问题,
    <!-- #BeginLibraryItem "/library/recommend_hot.lbi" --><!-- #EndLibraryItem -->这是包含语句么?这也看不大明白
      

  3.   

    <!-- #BeginLibraryItem "/library/recommend_hot.lbi" --> 我觉得这个是 ECSHOP后台动态设置首页模块的时候的标记 
      

  4.   

    这个你可以看他的includes/cls_templete.php
    都是这个处理的。