Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
  #1  
Old 04-07-2012, 04:20 AM
Preech Preech is offline
 
Join Date: Aug 2002
Location: Fort Campbell
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default Help show more than one result.

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:&nbsp <a href="./vbmusic_album.php?id=".$row1['alid']."\">{vb:raw malbumname}</a></div>
  <div class="
box">Artist:&nbsp<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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:57 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03565 seconds
  • Memory Usage 2,237KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)showthread_list
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_threadedmode.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids_threaded
  • showthread_threaded_construct_link
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete