douzha8489 2012-08-12 21:59
浏览 37
已采纳

动态图像列表使用php mysql smarty里面的jquery

I want to print list of image address in jquery function using php(adodb) and smarty.

i need to this :

 $.lightbox(["/media/photos/tmb/4.jpg", "/media/photos/tmb/3.jpg", "/media/photos/tmb/6.jpg"]);

i try with this (just simple for test) :

 {/literal} {if $photos} $.lightbox(["{"\", \""|implode:$photos}"]); {/if}{literal}

result is :

 $.lightbox(["Array", "Array", "Array", "Array", "Array", "Array", "Array", "Array", "Array", "Array", "Array"]); 

Actually, i need to replace array with images address.

images address (dynamic loop) :

{$relative}/media/photos/tmb/{$photos[i].PID}.jpg

without jquery function, i list images with this methods :

{if $photos}
{section name=i loop=$photos}
{$relative}/media/photos/tmb/{$photos[i].PID}.jpg
{/section}
{/if}

php code:

    $sql            = "SELECT PID, caption FROM photos WHERE AID = " .$aid. " AND status = '1' LIMIT " .$limit;
    $rs             = $conn->execute($sql);
    $photos         = $rs->getrows();
    $smarty->assign('photos', $photos);

how to print list for my need? can i?

  • 写回答

1条回答

      报告相同问题?

      相关推荐 更多相似问题

      悬赏问题

      • ¥20 Oracle触发器,用户管理题目
      • ¥250 python的exchangelib 报错
      • ¥15 Oracle外部过程获取的句柄属性为空
      • ¥20 snmpv3相关提问
      • ¥20 boost电路升压频率和占空比选择
      • ¥15 找个人工智能的大佬咨询一些毕设问题
      • ¥15 需要教程:GD32F450I移植无系统lwip
      • ¥15 中文语料库检索构式 求助
      • ¥15 关于naver点击量信息
      • ¥15 Linux gcc升级问题