The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
||||
|
||||
Nested Loop with templates
Wonder if anyone can help. What I'm trying to do is show a gig listings but add multiple ticket buying options.
I'm stuck though at the nested part and getting it to display in the template. I'm pretty sure the bit that's wrong is the 1st and 3rd line as if I do it with just the second line I get one link displayed but with this code I get none. I know it's something simple but I'm new to the way vB4 does stuff. So any ideas? Code:
$templater = vB_Template::create('event_giglistrowticket'); $templater->register('ticketlink', $linkrow[ticketlink]); $event_giglistrowticket .= $templater->render(); Code:
$results = $vbulletin->db->query_read("SELECT date_format(gig.date, '%a %D %b %y') AS gig_date, gig.gigid, venue.venuename AS gig_venuename, gig.title, gig.status, gig.age FROM gig LEFT JOIN venue ON gig.venueid=venue.venueid WHERE Status='confirmed' AND title != '' AND date >= ( CURDATE() ) ORDER BY date ASC"); // Loop through all results while ($row = $vbulletin->db->fetch_array($results)) { // Generate row html from template $templater = vB_Template::create('event_giglistrow'); $templater->register('gigid', $row[gigid]); $templater->register('title', $row[title]); $templater->register('venuename', $row[gig_venuename]); $templater->register('date', $row[gig_date]); $templater->register('age', $row[age]); $linkresults = $vbulletin->db->query_read("SELECT ticketlink FROM ticketlink LEFT JOIN gig ON ticketlink.gigid=gig.gigid WHERE ticketlink.gigid=gig.gigid AND ticketlink.gigid = '$row[gigid]'"); while ($linkrow = $vbulletin->db->fetch_array($linkresults)) { $templater = vB_Template::create('event_giglistrowticket'); $templater->register('ticketlink', $linkrow[ticketlink]); $event_giglistrowticket .= $templater->render(); } $event_giglistrow .= $templater->render(); } |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|