Quote:
Originally Posted by PinkMilk
Template:
Code:
<div id="something">
<div class="really"><b>Cool:</b>$drc_rep</div>
</div>
Plugin:
hook : parse_templates
PHP Code:
$i=0;
foreach($result as $row) if ($i < 10+1) {
$drc_rep = number_format($row['repeat']);
eval('$mytemplate = "' . fetch_template('mytemplate') . '";');
$i +=1;
}
Note: This is just a randon guess!
|
thanks pink, i did something similar, been reading through alot of articles on here to find anything similar. I ended up doing it all in the plugin since im calling multiple varibles throughout the html code as well.
so my end results ended up being along these lines:
PHP Code:
$i=0;
foreach($result as $row) if ($i < 10+1)
{
$cantTellYa .= '<div class="creep-country">
<div class="creep-col creep-countrycol">
<span class="creep-col-country">'.$row['country'].'</span>
</div>
</div>
' . $i +=1;
}
then just used the $cantTellYa variable in the template, this seems to work well, there are multiple spans and variables in the code, i just shortened everything to display it here.