PHP Code:
<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('THIS_SCRIPT', 'test');
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('TEST',
);
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### 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('' => 'Test Page'));
$navbar = render_navbar_template($navbits);
$code = "<div style='font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-weight: bold;
padding-left:30px;' >Sun flower</div>
<div style='width:106px;
height:109px;
margin-left:20px;
float:left;'><img src='images/flower_03.png' style='float:left' /></div>
<div style='height:150px;
width:338px;
float:left;'><div style='font-family: Arial, Helvetica, sans-serif;
font-size: 13px;
line-height: 19px;
font-weight: normal;
padding-left:6px;'>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vulputate, nibh eget ehiculaolestie, augue mi eleifend eros, fermentuaculis agna diam sed mi. Fusce euismodtortor at Fusce euismodtortor at</div> </div>
<div><div style='height:150px;
width:109px;
float:left;'><img src='images/Untitled-1.png' /><br />PlantsBlooms<br />Size<br />Light</div></div>
<div style='float:left;'>
4.5/5<br />
May - June<br />
May - June<br />
May - June<br /></div>
</div>
<div style='width:687;
height:142px;
padding-top:13px;
border:ridge;
border-width:2px;
border-color:cddee9;
margin-top:10px;'>";
include "connect.php";
$result = $db->query_read("SELECT * from plants");
$resultset = $db->fetch_array($result);
while ($userdata = $db->fetch_array($result))
{
// nun stehen die Daten in $userdata zur Verf?gung
echo $userdata['id'];
}
// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'My Page Title';
// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######
$templater = vB_Template::create('TEST');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
$templater->register('code', $code);
print_output($templater->render());
?>
i have registered my variable $code in template and its working OK.
if i use this code to display data, it displays it outside the template

but i have to display all records from database.
how it can be done?? any clue
PHP Code:
$result = vB::$vbulletin->db->query_read("SELECT * from plants");
$resultset = vB::$vbulletin->db->fetch_array($result);
while ($userdata = vB::$vbulletin->db->fetch_array($result))
{
// nun stehen die Daten in $userdata zur Verf?gung
echo $userdata['id'];
}
First I was using this code to get and dislpay data. But it was dislplaying error message that "VB class not found"
--------------- Added [DATE]1274277151[/DATE] at [TIME]1274277151[/TIME] ---------------
cellarius thnxxxxx a lottttttt a got some Idea

you are sooo goood