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)

Lynne 09-28-2008 10:21 PM

You cannot add php code to a template. You add all the php into the page script (your whatever.php page) and then spit the variables out in the template.

ru55ian 09-29-2008 02:06 AM

Quote:

Originally Posted by Lynne (Post 1632556)
You cannot add php code to a template. You add all the php into the page script (your whatever.php page) and then spit the variables out in the template.

looking at that code, can you help me?

Cip 10-01-2008 08:16 AM

A good start would be to read the article on the first page of this thread (No offense but it seems quite obvious to me that you haven't :p)

se_p800 10-08-2008 07:41 PM

Hi, I cant get this to work.

This is the code I have:

HTML Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'googlesearch.php'); // 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(
    'googlesearch',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

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

$navbits = array();
$navbits[$parent] = 'Searching google';

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

?>

And I created a new template called "googlesearch".

What am I doing wrong?

Lynne 10-08-2008 07:54 PM

Quote:

Originally Posted by se_p800 (Post 1640581)
And I created a new template called "googlesearch".

What am I doing wrong?

Change the eval line for your template:

PHP Code:

eval('print_output("' fetch_template('googlesearch') . '");'); 


ForumsMods 10-08-2008 09:52 PM

PHP Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS'1);
define('THIS_SCRIPT''googlesearch'); // 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(
    
'googlesearch',
);

// pre-cache templates used by specific actions
$actiontemplates = array(

);

// ######################### REQUIRE BACK-END ############################
require_once('./global.php');

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

$navbits = array();
$navbits[$parent] = 'Searching google';

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

?>


ragtek 10-09-2008 02:28 AM

u are not using the googlesearch template
PHP Code:

eval('print_output("' fetch_template('TEST') . '");'); 

should be
PHP Code:

eval('print_output("' fetch_template('googlesearch') . '");'); 


se_p800 10-09-2008 03:01 PM

Oh thanks very much guys I fixed the problem now :) Thanks once again!

DeanoUK 10-10-2008 12:23 PM

Maybe I've missed the answer to this in the previous 58(!) pages, but how do I get the footer to work in the new page?

The footer is there, but the usual 'whos online' etc info isn't. This would be nice to see.

Cheers in advance.

amcd 10-16-2008 02:17 PM

who's online is not part of the footer.


All times are GMT. The time now is 01:07 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.02362 seconds
  • Memory Usage 1,754KB
  • 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
  • (1)bbcode_html_printable
  • (4)bbcode_php_printable
  • (2)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