vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Some basics of vB3(mini howto) (https://vborg.vbsupport.ru/showthread.php?t=59939)

Dean C 06-21-2004 05:18 PM

You simply put:

PHP Code:

if($_REQUEST['do'] == 'test')
{
         
template call here....


:)

lichtflits 06-21-2004 06:36 PM

yea but that is only for one page.

I want samthing that is a code that is so that whene i add a template called test ,game or whatever i can do ?do= whene i made the template.

marcjd 06-28-2004 04:38 AM

I sure would appreciate some help with this question. I apologize if it has been answered in this thread, I just can't figure out how to do the simple little thing I want.

Basically I have a search bar and a google ad, etc. I want these in my headers but from time to time change the html code of them. I would much prefer to have them saved as templates and simply change those couple templates instead of the header in each style. I created a template for the Google Search bar and tried using $GoogleSearch in my header. Of course that didn't work...silly me. :)

I would really appreciate how to simply call custom templates in the header, footer, etc. Thank you very much! :)

Slapyo 06-28-2004 06:29 PM

Quote:

Originally Posted by VodkaFish
The only thing throwing me off is the logout javascript:
Code:

<script type="text/javascript">
<!--
function log_out()
{
        ht = document.getElementsByTagName("html");
        ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
        if (confirm('$vbphrase[sure_you_want_to_log_out]'))
        {
                return true;
        }
        else
        {
                ht[0].style.filter = "";
                return false;
        }
}
//-->
</script>

It will not fade color in IE anymore.

i am having the same problem. the code is exactly the same, copy/pasted, and i put onclick="return log_out()" in my logout link. i get the popup to ask if they want to logout, but i don't get the grayscale page.

it works fine when i am on the message board, but on my index page, there is no fade. anyone know what's goin on, or have this working on a non-vb page?

Slapyo 06-28-2004 06:47 PM

acutally, i just figured it out.

Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
put that at the top of your page.

lichtflits 07-23-2004 07:59 PM

Duse any one now how to use <?php include("$id.htm" ?> in vb.

Zachery 07-29-2004 09:22 AM

Quote:

Originally Posted by lichtflits
Duse any one now how to use <?php include("$id.htm" ?> in vb.

use the phpinclude template

Blue Moose Aaron 07-31-2004 04:30 AM

Any idea why my code isn't working? I'm sure (as a novice) I have to be doing something wrong. What I'm trying to do is get a page up thats going to display information put into my database. Its an episode guide. It runs fine alone, but I'm in the process of making my entire site template based.

Here is the template
Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - Donate</title>
$headinclude
</head>
<body>
$header

<table border="0" cellspacing="0"

 

width="100%" cellpadding="0">
              <tr>
                <td width="100%">
                <table border="0" cellspacing="0"

 

width="100%"

cellpadding="0">
                  <tr>
                   
          <td width="24" id="top"> <img border="0" src="images/smallville/left_top.jpg" width="24" height="6" /></td>
                   
          <td width="100%"

background="images/smallville/top.jpg"> <img border="0" src="images/smallville/top.jpg" width="2" height="6" /></td>
                   
          <td width="19" align="right"> <img border="0" src="images/smallville/right_top.jpg" width="19" height="6" /></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_corner.jpg" width="24" height="19" /></p></td>
                    <td width="100%"

background="images/smallville/top_mid.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Smallville
                    Episode Guide</font></b></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_corner.jpg" width="19" height="19" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_second.jpg" width="24" height="16" /></p></td>
                    <td id="top" width="100%"

background="images/smallville/second_mid.jpg">
                    <p align="left"> <b><font face="Verdana" size="1" color="#CC9966">
                $id - $episode_name</font></b></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_second.jpg" width="19" height="16" /></p></td>
                  </tr>
                  <tr>
                    <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg">
                    <p align="left"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></p></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"

 

width="100%"

 cellpadding="4">
                      <tr>
                        <td width="100%" valign="top">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <p align="left"> <font face="Verdana" size="1" color="#CC9966">
        $episode_description
        </font></p></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                    <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg">
                    <p align="right"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></p></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/left_maroon_bottom.jpg" width="24" height="13" /></td>
                    <td width="100%" id="top"

background="images/smallville/maroon_mid.jpg" valign="bottom">
                   
                    <p align="center"><font size="1" face="Verdana">&nbsp;</font></p></td>
                    <td width="19" valign="baseline">
                    <p align="right"> <img border="0" src="images/smallville/right_maroon_bottom.jpg" width="19" height="13" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_bottom.jpg" width="24" height="18" /></p></td>
                    <td width="100%"

background="images/smallville/bottom.jpg">
                    <p align="left"> <img border="0" src="images/smallville/bottom.jpg" width="3" height="18" /></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_bottom.jpg" width="19" height="18" /></p></td>
                  </tr>
                  <tr>
                   
          <td width="24" id="top"> <img border="0" src="images/smallville/left_top.jpg" width="24" height="6" /></td>
                   
          <td width="100%"

background="images/smallville/top.jpg"> <img border="0" src="images/smallville/top.jpg" width="2" height="6" /></td>
                   
          <td width="19" align="right"> <img border="0" src="images/smallville/right_top.jpg" width="19" height="6" /></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_corner.jpg" width="24" height="19" /></p></td>
                    <td width="100%"

background="images/smallville/top_mid.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Extras</font></b></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_corner.jpg" width="19" height="19" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_second.jpg" width="24" height="16" /></p></td>
                    <td id="top" width="100%"

background="images/smallville/second_mid.jpg">
                    <p align="left"> <b><font face="Verdana" size="1" color="#CC9966">Original
              Air Date</font></b></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_second.jpg" width="19" height="16" /></p></td>
                  </tr>
                  <tr>
                    <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg">
                    <p align="left"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></p></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"

 

width="100%"

 cellpadding="4">
                      <tr>
                        <td width="100%" valign="top">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <font face="Verdana" size="1" color="#CC9966">
                                                        $air_date</font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                    <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg">
                    <p align="right"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></p></td>
                  </tr>
                  <tr>
                                       
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Music</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
</tr>
                  <tr>
                    <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg">
                    <p align="left"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></p></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"

 

width="100%"

 cellpadding="4">
                      <tr>
                        <td width="100%" valign="top">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                           
                      <td width="100%"> <font face="Verdana" size="1" color="#CC9966">
                                          $music</td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                    <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg">
                    <p align="right"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></p></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Guest Stars</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"  width="100%" cellpadding="4">
                      <tr>
                        <td width="100%">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                           
                      <td width="100%"> <font face="Verdana" size="1" color="#CC9966">
                                          $guest_stars</font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                   
          <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font color="#CC9966" size="1" face="Verdana">Written By</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"  width="100%" cellpadding="4">
                      <tr>
                        <td width="100%">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <font face="Verdana" size="1" color="#CC9966">
                                          $written_by
                                        </font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                   
          <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Directed By</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"  width="100%" cellpadding="4">
                      <tr>
                        <td width="100%">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <font face="Verdana" size="1" color="#CC9966">
                                          $directed_by
                                          </font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                   
          <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/left_maroon_bottom.jpg" width="24" height="13" /></td>
                    <td width="100%" id="top"

background="images/smallville/maroon_mid.jpg" valign="bottom">
                   
                    <p align="center"><font size="1" face="Verdana">&nbsp;</font></p></td>
                    <td width="19" valign="baseline">
                    <p align="right"> <img border="0" src="images/smallville/right_maroon_bottom.jpg" width="19" height="13" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_bottom.jpg" width="24" height="18" /></p></td>
                    <td width="100%"

background="images/smallville/bottom.jpg">
                    <p align="left"> <img border="0" src="images/smallville/bottom.jpg" width="3" height="18" /></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_bottom.jpg" width="19" height="18" /></p></td>
                  </tr>

                  </table>
                </td>
              </tr>
</table>



$footer
</body>
</html>

Here is the file
PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ########################### 

error_reportingE_ALL & ~E_NOTICE ); 

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

define'NO_REGISTER_GLOBALS'); 

define'THIS_SCRIPT''test' ); 

// ################### 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( 'episode_guide' ); 

// pre-cache templates used by specific actions 

$actiontemplates = array(); 

// ######################### REQUIRE BACK-END ############################ 

require_once( './global.php' ); 

// ######################## START MAIN SCRIPT ############################ 
$db mysql_connect('localhost''---''---') or die('Couldn\'t connect to the database.');   
mysql_select_db('---'$db) or die('Couldn\'t select the database'); 
$query 'select * from smallville_episode_guide where id="101"';  
$result mysql_query($query$db) or die($query.' failed: '.mysql_error());  
$row mysql_fetch_assoc($result);
eval(
"\$id = \""nl2br($row['id']) ."\";");
eval(
"\$episode_name = \""nl2br($row['episode_name']) ."\";");
eval(
"\$episode_description = \""nl2br($row['episode_description']) ."\";");
eval(
"\$air_date = \""nl2br($row['air_date']) ."\";");
eval(
"\$music = \""nl2br($row['music']) ."\";");
eval(
"\$guest_stars = \""nl2br($row['guest_stars']) ."\";");
eval(
"\$written_by = \""nl2br($row['written_by']) ."\";");
eval(
"\$directed_by = \""nl2br$row['directed_by'] ) ."\";");
eval( 
'print_output( "' fetch_template'episode_guide' ) . '" );' );

?>

The template itself is working I'm just not getting any information from my database. I'm probably running the query wrong. Thanks for your help!

Zachery 07-31-2004 04:58 AM

Quote:

Originally Posted by Ted Varnson
Any idea why my code isn't working? I'm sure (as a novice) I have to be doing something wrong. What I'm trying to do is get a page up thats going to display information put into my database. Its an episode guide. It runs fine alone, but I'm in the process of making my entire site template based.

Here is the template
Code:

$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
<title>$vboptions[bbtitle] - Donate</title>
$headinclude
</head>
<body>
$header

<table border="0" cellspacing="0"

 

width="100%" cellpadding="0">
              <tr>
                <td width="100%">
                <table border="0" cellspacing="0"

 

width="100%"

cellpadding="0">
                  <tr>
                   
          <td width="24" id="top"> <img border="0" src="images/smallville/left_top.jpg" width="24" height="6" /></td>
                   
          <td width="100%"

background="images/smallville/top.jpg"> <img border="0" src="images/smallville/top.jpg" width="2" height="6" /></td>
                   
          <td width="19" align="right"> <img border="0" src="images/smallville/right_top.jpg" width="19" height="6" /></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_corner.jpg" width="24" height="19" /></p></td>
                    <td width="100%"

background="images/smallville/top_mid.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Smallville
                    Episode Guide</font></b></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_corner.jpg" width="19" height="19" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_second.jpg" width="24" height="16" /></p></td>
                    <td id="top" width="100%"

background="images/smallville/second_mid.jpg">
                    <p align="left"> <b><font face="Verdana" size="1" color="#CC9966">
                $id - $episode_name</font></b></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_second.jpg" width="19" height="16" /></p></td>
                  </tr>
                  <tr>
                    <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg">
                    <p align="left"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></p></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"

 

width="100%"

 cellpadding="4">
                      <tr>
                        <td width="100%" valign="top">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <p align="left"> <font face="Verdana" size="1" color="#CC9966">
        $episode_description
        </font></p></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                    <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg">
                    <p align="right"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></p></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/left_maroon_bottom.jpg" width="24" height="13" /></td>
                    <td width="100%" id="top"

background="images/smallville/maroon_mid.jpg" valign="bottom">
                   
                    <p align="center"><font size="1" face="Verdana">&nbsp;</font></p></td>
                    <td width="19" valign="baseline">
                    <p align="right"> <img border="0" src="images/smallville/right_maroon_bottom.jpg" width="19" height="13" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_bottom.jpg" width="24" height="18" /></p></td>
                    <td width="100%"

background="images/smallville/bottom.jpg">
                    <p align="left"> <img border="0" src="images/smallville/bottom.jpg" width="3" height="18" /></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_bottom.jpg" width="19" height="18" /></p></td>
                  </tr>
                  <tr>
                   
          <td width="24" id="top"> <img border="0" src="images/smallville/left_top.jpg" width="24" height="6" /></td>
                   
          <td width="100%"

background="images/smallville/top.jpg"> <img border="0" src="images/smallville/top.jpg" width="2" height="6" /></td>
                   
          <td width="19" align="right"> <img border="0" src="images/smallville/right_top.jpg" width="19" height="6" /></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_corner.jpg" width="24" height="19" /></p></td>
                    <td width="100%"

background="images/smallville/top_mid.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Extras</font></b></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_corner.jpg" width="19" height="19" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_second.jpg" width="24" height="16" /></p></td>
                    <td id="top" width="100%"

background="images/smallville/second_mid.jpg">
                    <p align="left"> <b><font face="Verdana" size="1" color="#CC9966">Original
              Air Date</font></b></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_second.jpg" width="19" height="16" /></p></td>
                  </tr>
                  <tr>
                    <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg">
                    <p align="left"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></p></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"

 

width="100%"

 cellpadding="4">
                      <tr>
                        <td width="100%" valign="top">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <font face="Verdana" size="1" color="#CC9966">
                                                        $air_date</font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                    <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg">
                    <p align="right"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></p></td>
                  </tr>
                  <tr>
                                       
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Music</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
</tr>
                  <tr>
                    <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg">
                    <p align="left"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></p></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"

 

width="100%"

 cellpadding="4">
                      <tr>
                        <td width="100%" valign="top">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                           
                      <td width="100%"> <font face="Verdana" size="1" color="#CC9966">
                                          $music</td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                    <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg">
                    <p align="right"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></p></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Guest Stars</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"  width="100%" cellpadding="4">
                      <tr>
                        <td width="100%">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                           
                      <td width="100%"> <font face="Verdana" size="1" color="#CC9966">
                                          $guest_stars</font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                   
          <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font color="#CC9966" size="1" face="Verdana">Written By</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"  width="100%" cellpadding="4">
                      <tr>
                        <td width="100%">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <font face="Verdana" size="1" color="#CC9966">
                                          $written_by
                                        </font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                   
          <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/con_left.jpg" width="24" height="17" /></td>
                    <td width="100%" background="images/smallville/con_middle.jpg">
                    <b><font face="Verdana" size="1" color="#CC9966">Directed By</font></b></td>
                   
          <td width="19" valign="baseline"> <img border="0" src="images/smallville/con_right.jpg" width="19" height="17" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"

background="images/smallville/left_mid.jpg"> <img border="0" src="images/smallville/left_mid.jpg" width="24" height="5" /></td>
                    <td width="100%" bgcolor="#000000">
                    <table border="0" cellspacing="0"  width="100%" cellpadding="4">
                      <tr>
                        <td width="100%">
                        <table border="0" cellspacing="0"  width="100%" cellpadding="3">
                          <tr>
                            <td width="100%">
                            <font face="Verdana" size="1" color="#CC9966">
                                          $directed_by
                                          </font></td>
                          </tr>
                        </table>
                        </td>
                      </tr>
                    </table>
                    </td>
                   
          <td width="19" valign="baseline"

background="images/smallville/right_mid.jpg"> <img border="0" src="images/smallville/right_mid.jpg" width="19" height="5" /></td>
                  </tr>
                  <tr>
                   
          <td width="24" valign="baseline"> <img border="0" src="images/smallville/left_maroon_bottom.jpg" width="24" height="13" /></td>
                    <td width="100%" id="top"

background="images/smallville/maroon_mid.jpg" valign="bottom">
                   
                    <p align="center"><font size="1" face="Verdana">&nbsp;</font></p></td>
                    <td width="19" valign="baseline">
                    <p align="right"> <img border="0" src="images/smallville/right_maroon_bottom.jpg" width="19" height="13" /></p></td>
                  </tr>
                  <tr>
                    <td width="24">
                    <p align="left"> <img border="0" src="images/smallville/left_bottom.jpg" width="24" height="18" /></p></td>
                    <td width="100%"

background="images/smallville/bottom.jpg">
                    <p align="left"> <img border="0" src="images/smallville/bottom.jpg" width="3" height="18" /></p></td>
                    <td width="19" align="right">
                    <p> <img border="0" src="images/smallville/right_bottom.jpg" width="19" height="18" /></p></td>
                  </tr>

                  </table>
                </td>
              </tr>
</table>



$footer
</body>
</html>

Here is the file
PHP Code:

<?php

// ####################### SET PHP ENVIRONMENT ########################### 

error_reportingE_ALL & ~E_NOTICE ); 

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

define'NO_REGISTER_GLOBALS'); 

define'THIS_SCRIPT''test' ); 

// ################### 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( 'episode_guide' ); 

// pre-cache templates used by specific actions 

$actiontemplates = array(); 

// ######################### REQUIRE BACK-END ############################ 

require_once( './global.php' ); 

// ######################## START MAIN SCRIPT ############################ 
$db mysql_connect('localhost''---''---') or die('Couldn\'t connect to the database.');   
mysql_select_db('---'$db) or die('Couldn\'t select the database'); 
$query 'select * from smallville_episode_guide where id="101"';  
$result mysql_query($query$db) or die($query.' failed: '.mysql_error());  
$row mysql_fetch_assoc($result);
eval(
"\$id = \""nl2br($row['id']) ."\";");
eval(
"\$episode_name = \""nl2br($row['episode_name']) ."\";");
eval(
"\$episode_description = \""nl2br($row['episode_description']) ."\";");
eval(
"\$air_date = \""nl2br($row['air_date']) ."\";");
eval(
"\$music = \""nl2br($row['music']) ."\";");
eval(
"\$guest_stars = \""nl2br($row['guest_stars']) ."\";");
eval(
"\$written_by = \""nl2br($row['written_by']) ."\";");
eval(
"\$directed_by = \""nl2br$row['directed_by'] ) ."\";");
eval( 
'print_output( "' fetch_template'episode_guide' ) . '" );' );

?>

The template itself is working I'm just not getting any information from my database. I'm probably running the query wrong. Thanks for your help!

Is all this info in the same database as vBulletins?

lichtflits 07-31-2004 08:48 AM

and how do i do that phpinclude template thing.


All times are GMT. The time now is 01:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01668 seconds
  • Memory Usage 2,073KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (3)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete