如何在php中计算图像?

时间:2014-12-25 04:25:04

标签: php smarty

我正在制作一个项目,我使用smarty框架,在那里我试图计算图像,但所有图像都很重要,但我想计算像我在项目中给出的图像类型vise ..我的代码片段如下。 .can任何身体帮我这个?提前谢谢......

<div class="tab_container"> 
    {section name=mi  loop=$imagetype}
      <div id="tab{$smarty.section.mi.iteration}" class="tab_content">
        <div class="simplepage">
        <input type='hidden' id='current_page_{$smarty.section.mi.iteration}' />
        <input type='hidden' id='show_per_page_{$smarty.section.mi.iteration}' />
          <ul class="paging" id="gallery_{$smarty.section.mi.iteration}">
            {section name=i loop=$restaurant}
            {if $imagetype[mi] eq $restaurant[i].type}
                <li class="simplePagerPage1 simplePagerPage2"> <a href="{$R_SERVER}/{$restaurant[i].upload_dir}/{$restaurant[i].image}" rel="lightbox[{$restaurant[i].type}]" title="{$restaurant[i].title_tag}" > <img src="{$R_SERVER}/{$restaurant[i].upload_dir}/{$restaurant[i].image}" width="100%" height="123" alt="{$restaurant[i].alt_tag}" title="{$restaurant[i].title_tag}"/> </a> </li>
            {/if}
            {/section}
          </ul>

           {if $restaurant|@count gt 24}
            <div id='page_navigation_{$smarty.section.mi.iteration}'></div>
           {/if}

        </div>
      </div>
   {/section} 
   </div>

1 个答案:

答案 0 :(得分:0)

   var n{/literal}{$smarty.section.mi.iteration}{literal} = $("#gallery_{/literal}{$smarty.section.mi.iteration}{literal} li").length;

   if(n{/literal}{$smarty.section.mi.iteration}{literal} > 24)
   {
       $('#page_navigation_{/literal}{$smarty.section.mi.iteration}{literal}').css('display','block');
   }
   else
   {
       $('#page_navigation_{/literal}{$smarty.section.mi.iteration}{literal}').css('display','none');
   }

});