So I'm working on creating a mod for music base sites. I am trying to show the output for all of the latest mixtapes that was posted. I can get the one to show. But the rest doesn't show. Maybe I messed up some where in the code. Here is what I got.
PHP Code:
// ###### YOUR CUSTOM CODE GOES HERE #####
$musicalbum = $db->query_read("
SELECT al.alid, al.alname, al.arid, al.added, al.cvrsaved, ar.arname FROM " . TABLE_PREFIX. " album al
LEFT JOIN artist ar ON ar.arid=al.arid
ORDER BY al.alid DESC LIMIT 5
");
while ($musical =$db->fetch_array($musicalbum))
{
$malbumid = $musical['alid'];
$malbumname = $musical['alname'];
$malbumarname = $musical['arname'];
$malbumarid = $musical['arid'];
$mcvrsaved = $musical['cvrsaved'];
}
$musicstat = $db->query_read("SELECT nr_artists, nr_albums,nr_tracks FROM " . TABLE_PREFIX ." stats");
while ($music_stat = $db->fetch_array($musicstat))
{
$statar = $music_stat['nr_artists'];
$statal = $music_stat['nr_albums'];
$statt = $music_stat['nr_tracks'];
}
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('vbmusic');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('malbumid', $malbumid);
$templater->register('malbumname', $malbumname);
$templater->register('malbumarname', $malbumarname);
$templater->register('malbumarid', $malbumarid);
$templater->register('cvrsaved', $cvrsaved);
$templater->register('statar', $statar);
$templater->register('statal', $statal);
$templater->register('statt', $statt);
$templater->register('mar1', $mar1);
$templater->register('vbmusic_latest', $vbmusic_latest);
print_output($templater->render());
this is my template.
PHP Code:
<div class="audio_body2">
<span class="column">
<div class="box">
<center>
<vb:if condition="$my_variable == yes">
<img src="./audio/covers/{vb:raw cvrsaved}/jpg" width="130px" border="0" ">
<vb:else />
<img src="./audio/covers/no_cover.jpg" width="130px" border="0" ">
</vb:if>
</center>
</div>
<hr style="height: 1;
border-style: dashed;
border-width: 1px 0 0 0;
border-color:rgb(255, 255, 255) url(images/gradients/grey-up.png) repeat-x left bottom;">
<div class="box">Album:  <a href="./vbmusic_album.php?id=".$row1['alid']."\">{vb:raw malbumname}</a></div>
<div class="box">Artist: <a href="./artist.php?id={vb:raw malbumarid}">{vb:raw malbumarname}</a></div>
</span>
</div>
and this is the code I'm using to pull this template into my main template.
PHP Code:
{vb:raw vbmusic_latest}
Please point me in the right direction.