$tpl->set_block('main','find','finds');
$tpl->set_block('find', 'tr', 'mtr');
$tpl->set_block('tr', 'td', 'mtd');
$i=0;

foreach($cache_find as $find)
{
if($i < 4){
$tpl->set_var('myVar', $i); 
$tpl->parse('mtd', 'td', true);
if ($i%2 == 1) { //这个是换行的条件
$tpl->parse('mtr', 'tr', true); 
$tpl->set_var('mtd', '');
}
 
$find_htmlfile=$htmlroot.$dirhtml_find.'/'.$find[htmlroot].'/'.$find[id].'.html';
$link_find=file_exists($find_htmlfile)?$find_htmlfile:'view.php?action=showfind&info='.$info[id];
$tpl->set_var(
array(
'FIND_NAME' => wane_str($find[job],0,$string_find),
'TRUENAME' => wane_str($find[truename],0,$string_personal),
'FIND_SEX' => $find[sex],
'FIND_BIRTH'=> $find[birth],
'FIND_EDU' => $find[edu],
'FIND_TIME' => $find[addtime],
'FIND_LINK' => $link_find,
'PER_LINK' => 'view.php?action=personal&info='.urlencode($find[username]),
)
);
//echo $find[job]."<br>";
unset($find_file,$cache_find,$find,$find_htmlfile,$linkfind);
$tpl->parse('finds','find',true);
$i++;
}
}