Go Back   vb.org Archive > vBulletin 4 Discussion > vB4 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 04-17-2012, 05:53 PM
Preech Preech is offline
 
Join Date: Aug 2002
Location: Fort Campbell
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default I can not display

So this is my php script.
PHP Code:
<?php

// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT''vbmusic_album');
define('CSRF_PROTECTION'true);  
// change this depending on your filename

// ################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();

// get special data templates from the datastore
$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array('vbmusic_album',
);

// pre-cache templates used by specific actions
$actiontemplates = array('vbmusic_album');

// ######################### REQUIRE BACK-END ############################
// if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line
// chdir ('/path/to/your/forums');
require_once('./global.php');



// #######################################################################
// ######################## START MAIN SCRIPT ############################
// #######################################################################

$navbits construct_navbits(array('' => 'Album'));
$navbar render_navbar_template($navbits);



// ###### YOUR CUSTOM CODE GOES HERE #####

$vbulletin->input->clean_gpc('r''id'TYPE_UINT);
$id $vbulletin->GPC['id'];


$track $db->query_read("SELECT tr.trname, tr.playtime AS tracktime, tr.tracknr, tr.trid, al.*,
        ar.arname, co.cdecname, cd.cdid, cd.playtime AS cdtime, cd.cdname, ge.genname,
        cn.cntyname, fe.ext AS filext
        FROM " 
TABLE_PREFIX" track tr 
        LEFT JOIN cdlist cd ON cd.cdid=tr.cdid
        LEFT JOIN album al ON al.alid=cd.alid
        LEFT JOIN artist ar ON ar.arid=al.arid 
        LEFT JOIN codec co ON co.cdecid=al.codec 
        LEFT JOIN genre ge ON ge.genid=al.genre
        LEFT JOIN country cn ON cn.id=al.country
        LEFT JOIN filext fe ON fe.id=tr.extid
        WHERE cd.alid=
$id ORDER BY cd.cdname,tr.tracknr, tr.trname");
 
 
$cdcnt=1;
 
$cdid='0';
  
$cdname='';
 
 
$mart = array();
   if (
$db->num_rows($track))
{
while (
$musical $db->fetch_array($track))
{
$mart[] = $musical;

}

}     
$db->free_result($track); 








// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater vB_Template::create('vbmusic_album');
$templater->register_page_templates();
$templater->register('navbar'$navbar);
$templater->register('mart'$mart);
print_output($templater->render());

?>
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
So it seems to me, everything is correct, no errors. When I go to try to get my data to show up through the template, nothing. Could anyone explain to me what I'm doing wrong.

Before I forget. I am getting to this page by clicking a link from another page.
The link is something like this. something.php?id={vb:raw something}
I got the id..but I can't get any of the info that may go with that id.
Reply With Quote
  #2  
Old 04-17-2012, 09:51 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

What does your template look like?
Reply With Quote
  #3  
Old 04-18-2012, 05:42 AM
Preech Preech is offline
 
Join Date: Aug 2002
Location: Fort Campbell
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
{vb:stylevar htmldoctype}
<
html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html">
  <
head>
    <
title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title>
    {
vb:raw headinclude}
    {
vb:raw headinclude_bottom}

<
script type="text/javascript">
<!--
function 
PlayPop(filedesc,id,WindowNumber
{
 
Play window.open('',WindowNumber,'width=620,height=420,top=0,left=0,screenX=0,screenY=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0');
 
Play.focus();
 
Play.document.writeln("<html><head>");
 
Play.document.writeln("<title>" filedesc "</title>");
 
Play.document.writeln("<link rel='stylesheet' type='text/css' href='images/css.css'></head>");
 
Play.document.writeln("<body style='background-color:#727e8c'><div align='center'><br />");

 
Play.document.writeln("<table cellspacing='0' cellpadding='0' border='0' width='90%'><tr><td align='left'><img src='images/obenlinks.gif' /></td><td width='100%' class='obenmitte' align='center'></td><td align='right'><img src='images/obenrechts.gif'></td></tr></table>");
 
Play.document.writeln("<table class='tablec' width='90%' cellspacing='20'><tr><td align='center' class='data1'>");
 
Play.document.writeln("<b>" filedesc "</b></td></tr></table>");
 
Play.document.writeln("<table class='tabled' width='90%' cellspacing='10'><tr><td align='center'>");
 
Play.document.writeln("<object type='application/x-shockwave-flash' width='500' height='170' ");
 
Play.document.writeln("data='js/xspf_player.swf?" id + \"&autoplay=1'>");
 
Play.document.writeln("<param name='movie'");
 
Play.document.writeln("value='js/xspf_player.swf?playlist_url=playlist/" id ".xml&autoplay=1'></object>");
 
Play.document.writeln("</td></tr></table>");
 
Play.document.writeln("<table class='tablec' width='90%' cellspacing='10'><tr><td align='center'>");
 
Play.document.writeln("<br /><form><input class='button' type='button' value='Close window' onclick='javascript:window.close();'></form></td></tr></table>");
 
Play.document.writeln("<table cellspacing='0' cellpadding='0' border='0' width='90%'><tr><td align='left'><img src='images/untenlinks.gif' /></td><td width='100%' class='untenmitte' align='center'></td><td align='right'><img src='images/untenrechts.gif'></td></tr></table>");
 
Play.document.writeln("<br /></body></html>");
 
Play.document.close();
}
// -->
</script>
  </
head>
  <
body>
    
    {
vb:raw header}
    
    {
vb:raw navbar}


<
div class="colmask leftmenu">
    <
div class="colleft">
        <
div class="col1">
            <!-- 
Column 1 start -->

<
div class="audio_head">
<
h1>
 <
table align="center" cellspacing="1" cellpadding="0" width="100%">
             <
tr>
         <
td style="width:7%" align="center" class="data2"><b>Track</b></td>
         <
td style="width:75%" align="center" class="data2"><b>Track name</b></td>
         <
td style="width:8%" align="center" class="data2"><b>Time</b></td>
         <
td style="width:10%" align="center" class="data2"><b>Action</b></td>
      </
tr>
</
table>
        </
h1></div>
<
div class="audio_body">


</
div>



            <!-- 
Column 1 end -->
        </
div>
        <
div class="col2">
            <!-- 
Column 2 start -->

<
div class="audio_head">
<
h1>
 {
vb:raw cdname}
        </
h1></div>
    <
div class="audio_body">
<
span class="column">
 
<
center>
<
vb:if condition="$musical['cvrsaved'] == yes">
    <
img src="./audio/covers/{vb:raw musical.cvrsaved}/jpg" width="230px" border="0" ">
<vb:else />
    <img src="
./audio/covers/no_cover.jpg" width="230px" border="0" ">
</
vb:if>
</
center>

</
span>
</
div>
<
br />
<
div class="audio_head">
<
h1>
Album Info
        
</h1></div>
    <
div class="audio_body">
<
table align="center" cellspacing="12" cellpadding="0" style="width:100%">
       <
tr>
        <
td align="left" class="data1">Artist : <a href="vbmusic_artist.php?id={vb:raw artid}">{vb:raw artname}</a> </td>
   
       </
tr>
       <
tr>
        <
td align="left" class="data1">Album : {vb:raw alname}</td
       </
tr>
       <
tr>
        <
td align="left" class="data1">Genre :{vb:raw genname}</td>
       </
tr>
       <
tr>
        <
td align="left" class="data1">Release Year :{vb:raw year}</td>
       </
tr>
       <
tr>
        <
td align="left" class="data1">Size :{vb:raw alsize}</td>
       </
tr>
       <
tr>
        <
td align="left" class="data1">Added :{vb:raw added}</td>
       </
tr>
      </
table>
</
div>


            
            <!-- 
Column 2 end -->
        </
div>
    </
div>
</
div>

    {
vb:raw footer}
  </
body>
</
html
Reply With Quote
  #4  
Old 04-18-2012, 02:22 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You have several variables in your template that you did not register for use in there - $alname, $genname, $year, etc. So, nothing is going to show up for any of those variables until you register them for use in there.
Reply With Quote
  #5  
Old 04-18-2012, 03:51 PM
Preech Preech is offline
 
Join Date: Aug 2002
Location: Fort Campbell
Posts: 325
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll work on it..than check back later if I still haven't got it to work.
Reply With Quote
Reply


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 02:02 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.04206 seconds
  • Memory Usage 2,281KB
  • 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
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (5)post_thanks_box
  • (5)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (5)post_thanks_postbit_info
  • (5)postbit
  • (5)postbit_onlinestatus
  • (5)postbit_wrapper
  • (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_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
  • 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