vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   How to create your own vBulletin-powered page! (uses vB templates) (https://vborg.vbsupport.ru/showthread.php?t=62164)

cellarius 05-18-2010 02:18 PM

Well, your code goes after the section where it says START MAIN SCRIPT. Save the results of your code into variables, register them, and call them in the template.

danishravian 05-18-2010 02:21 PM

Thnx a lot, Now i got some idea.

--------------- Added [DATE]1274196333[/DATE] at [TIME]1274196333[/TIME] ---------------

can you please tell me how to dislpay registered variables in php???

what is proper code???
i am using VB4

--------------- Added [DATE]1274196683[/DATE] at [TIME]1274196683[/TIME] ---------------

This Is My Code
include "connect.php";
$query = "select * from plants";
$result = mysql_query($query);
$row = mysql_fetch_array($result);


$templater->register('query', $query);
$templater->register('result', $result);
$templater->register('row', $row);


if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{

echo "data found";

}

}

else
{
echo "No Record With These Parameters";

}

cellarius 05-18-2010 02:35 PM

You're in the wrong thread completely. This is for vB3, but you are using vB4 and thus followed a completely different tutorial. You really need to do some reading on how to register variables for vB4 (there's a tutorial for that, too), and then ask in your own thread. This is totally off topic here, and I won't continue answering in this thread. Before doing so: Please use code or php tags if posting code, and please read the article I linked you to regarding the vB database classes. If doing database operations insinde vB, you really should use them.

danishravian 05-18-2010 03:10 PM

https://vborg.vbsupport.ru/showthrea...73#post2039273

i made my thread, plz reply there :)

eda199 05-20-2010 03:34 PM

hello my test.php is like this and gives some errors any help pls?
http://izmir.tr.kg/test.php

? any help?

thank you...

kdr4t 06-20-2010 02:58 AM

Does this work in VB4?

Digital Jedi 06-20-2010 03:00 AM

Quote:

Originally Posted by kdr4t (Post 2056157)
Does this work in VB4?

No. But the article in the vB4 Articles section does.

Atreidex 06-21-2010 05:01 PM

Quote:

Originally Posted by Digital Jedi (Post 2056158)
No. But the article in the vB4 Articles section does.

Could you please provide a link to that article, i can't find it :(

Thank you!

Digital Jedi 06-22-2010 02:46 AM

Quote:

Originally Posted by Atreidex (Post 2057018)
Could you please provide a link to that article, i can't find it :(

Thank you!

It's on the first page of the vB4 articles section.

jdrakopo 06-23-2010 11:19 AM

I'm having trouble getting this working.
Am getting the following errors (below).

=======
Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: navbar in [path]/includes/functions.php on line 3957

Parse error: syntax error, unexpected T_STRING in /home/bostonwh/public_html/adhub1.php(42) : eval()'d code on line 1

Warning: fetch_template() calls should be replaced by the vB_Template class. Template name: adhub1 in [path]/includes/functions.php on line 3957
=======

The last part of my custom php file (named adhub1.php) is as follows (see just below):
(and I do have a template named 'adhub1'.)
Line 42 - which is where the error msg points to - is the line there that contains '... fetch_template('navbar' ...'

Any ideas ?
I must be missing something simple.
Thanks.

// ############ START MAIN SCRIPT ################
$navbits = array();
$navbits[$parent] = 'adhub1';

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');
eval('print_output("' . fetch_template('adhub1') . '");');

?>


All times are GMT. The time now is 02:14 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.03505 seconds
  • Memory Usage 1,743KB
  • 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
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (4)pagenav_pagelinkrel
  • (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