在图片集页面如何输出全部图片?下面的代码只能输出一张图片{dede:field name='imgurls' alt='图片输出区'}
                    <div><img src="[field:imgsrc/]" alt="[field:title function='html2text(@me)'/]" width="534" height="336"/></div>
                    <div><center>[field:alttext/]</center></div>
{/dede:field}各位大侠帮帮忙,先谢了

解决方案 »

  1.   

    我也没用过dede的,你看哈dede的模板系统,肯定有解释咋个循环的
      

  2.   

    <div><img src="[field:imgsrc/]" row="10" col="2" alt="[field:title function='html2text(@me)'/]" width="534" height="336"/></div>
    可以吗
      

  3.   

      {dede:field name='imgurls'}<li><img src="[field:linkurl/]"  alt="" /></li>{/dede:field}
      

  4.   

    在include/common.inc.php文件中添加
    function Getimg($aid, $imgwith = 344, $imgheight = 450, $num = 0 , $style = 'li')
    {
        global $dsql;
        $imgurls = '';
         $row = $dsql -> getone("Select imgurls From`#@__addonimages` where aid='$aid'"); //
         $imgurls = $row['imgurls'];
         preg_match_all("/{dede:img (.*)}(.*){\/dede:img/isU", $imgurls, $wordcount);
         $count = count($wordcount[2]);
         if ($num > $count || $num == 0)
     {
            $num = $count;
          }
        
        for($i = 0;$i < $num;$i++)
    {
            if($style == 'li')
    {
                $imglist .= "<a href=#" . $i . "><img src=". trim($wordcount[2][$i]) . " width=" . $imgwith . " height=" . $imgheight . "></a>";
            }
        }
         return $imglist;
    } 然后在列表模版中使用 {dede:list}
                           [field:id  function="Getimg(@me,344,400,9)" /]
                           {/dede:list}调用
    在文章模版中使用 {dede:field.id  function="Getimg(@me,344,400,9)" /}调用   
    希望能帮助你