有縮略圖10張和10條評(píng)論
如何隨機(jī)調(diào)取3張縮略圖和3條評(píng)論組成一個(gè)內(nèi)容。
將下面的代碼重組
<?php if ($thumb) { $key=0;foreach ($thumb as $c) { ?>
<img src="{dr_get_file($c.file)}" >
<?php $key++;} } ?>
{comment module=MOD_DIR order=rand() num=3}
<p>{$t.content}</p>
{/comment}
<?php if ($thumb) { $key=0;foreach ($thumb as $c) { if($key>3) { break; } ?> <img src="{dr_get_file($c.file)}" > <?php $key++;} } ?> {comment module=MOD_DIR order=rand num=3} <p>{$t.content}</p> {/comment}開源是一種精神,但不是義務(wù),幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復(fù)@外聘專員-優(yōu)速IT設(shè)計(jì) 組合到一起, 一個(gè)圖片一個(gè)評(píng)論, 循環(huán)三次。