vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   How to get a template into PHP (https://vborg.vbsupport.ru/showthread.php?t=155454)

JacBowen 08-16-2007 11:16 PM

How to get a template into PHP
 
Hey Guys,

Once again looking for some help, ok so I have created a template and all I want to do is display it. It's a template to display the latest threads and news (like a news publishing system) and all I need to do is get this onto a page...

So basically I need the code to link "News-FPS" < the template name to a file like "Show_news.php" then I will integrate it then into what I need to do.

Please help ;).
Jac

EnIgMa1234 08-16-2007 11:45 PM

Just add this
PHP Code:

  eval('print_output("' fetch_template('YOUR TEMPLATE");'); 


JacBowen 08-17-2007 12:01 AM

Appricate your reply, but sorry to sound dumb lol.
It doesn't work :(, what am I doing wrong?
http://www.jac-bowen.co.uk/vBulletin/r.php
I made a custom template called "News".

Regards,
Jac

EnIgMa1234 08-17-2007 12:05 AM

use this
PHP Code:

<?php  

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

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

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

);  

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

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

$navbits = array();  
$navbits[$parent] = 'News';  

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

?>


Dismounted 08-17-2007 10:03 AM

<a href="https://vborg.vbsupport.ru/showthread.php?t=62164" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=62164</a>


All times are GMT. The time now is 08:40 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.03639 seconds
  • Memory Usage 1,727KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete