Hi All,
Just wondering if anyone here proficient with phplib templates could explain to me why my code isn't producing the expected output.
I have a template artistbrowse.ihtml:
<div style="float: right; text-align: right">{BACKLINK}</div>
<h1>Browse Artists</h1>
<br />
<div style="text-align: center">
<form action="artists.php">
Starting with:
<select name="sort">
<option value="num" {NSELECTED}>#</option>
<!-- Begin SortCharBlock -->
<option value="{SCHAR}" {SELECTED}>{SCHAR}</option>
<!-- Begin SortCharBlock -->
<option value="-1" {ASELECTED}>all</option>
</select>
Show:
<select name="bpp">
<option value="5">5 artists</option>
<option value="10">10 artists</option>
<option value="15">15 artists</option>
<option value="20">20 artists</option>
</select>
<input type="submit" name="browse" value="Filter" />
</form>
</div>
<br />
What I want to do is loop the SortCharBlock block for each character in the alphabet, which I am trying to do with this code:
$artisttpl = new Template('templates', 'remove');
$artisttpl->set_file('browse','artistbrowse.ihtml');
$artisttpl->set_block('browse','SortCharBlock','charout');
for( $i = 97; $i <= 122 ; $i++) {
$artisttpl->set_var('SCHAR', chr($i));
if (isset($_GET['sort']) && ($_GET['sort'] == chr($i)));
$artisttpl->set_var('SELECTED', chr($i));
$artisttpl->parse('charout', 'SortCharBlock', true);
}
$artisttpl->pparse('Output', 'browse');
Instead of producing a list of a-z it only shows one option tag "z" it looks like its not appending to the variable or i'm not doing something right. Seems basically the same as the article on devshed
Any thoughts, ideas, tips would be greatly appreciated.