vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=242)
-   -   [HOW TO - vB4] Rendering templates and registering variables - a short guide (https://vborg.vbsupport.ru/showthread.php?t=228078)

Seven Skins 12-01-2009 06:47 PM

In the plugin change "THEMEFLARE" to "TESTPAGE" ....

jlevi 12-01-2009 07:06 PM

Quote:

Originally Posted by Seven Skins (Post 1923650)
In the plugin change "THEMEFLARE" to "TESTPAGE" ....

Oops... that's not the problem, I've checked and it is "TESTPAGE", just a typing error on my part. Thanks for helping :)

Edit: I've updated my original post.

sebz2009 12-02-2009 03:41 AM

I seemed to have gotten it to work. :D

Downloads.php
PHP Code:

<?php

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

// Define the unique name for this script
define('THIS_SCRIPT''Downloads');

// List of templates used on this page
$globaltemplates = array(
    
'DOWNLOADS_SHELL'
);

// List of action related templates used on this page
$actiontemplates = array();

require_once(
'./global.php');

// Navbar location
$navbits construct_navbits(array('' => 'Downloads')); 
$navbar render_navbar_template($navbits); 

// HTML stuff
$HTML "<INSERT WHATEVER CODE YOU WANT>";

// Fetch and parse templates
$templater vB_Template::create('DOWNLOADS_SHELL');
$templater->register_page_templates(); 
$templater->register('headinclude'$headinclude);
$templater->register('navbar'$navbar); 
$templater->register('header'$header);
$templater->register('HTML'$HTML);
$templater->register('footer'$footer);
print_output($templater->render());

?>


DOWNLOADS_SHELL
Code:

        {vb:raw headinclude}

        {vb:raw header}
       
        {vb:raw navbar}
       
        {vb:raw HTML}
       
        {vb:raw footer}
       
</body>
</html>


gurler 12-06-2009 09:04 PM

thank you very much..

CrazyProgrammer 12-06-2009 10:55 PM

Code:

eval( '$comment_boxes .= "' . fetch_template('App_Question_box') . '";' ) ;
i have this how can make this into the new vbulletin format im not understanding this :(

Lynne 12-07-2009 03:19 AM

Quote:

Originally Posted by CrazyProgrammer (Post 1926545)
Code:

eval( '$comment_boxes .= "' . fetch_template('App_Question_box') . '";' ) ;
i have this how can make this into the new vbulletin format im not understanding this :(

You're gonna translate into something like this, but only you know the variables that will need to be registered:
PHP Code:

/* render template and register variables */
$templater vB_Template::create('App_Question_box');
    
$templater->register('my_var'$my_var);
    
$templater->register('my_array'$my_array);
$comment_boxes .= $templater->render(); 


sebz2009 12-09-2009 11:26 PM

Alright, now I'm a bit stumped.
I cant seem to get the title of the page to register and it the pages don't work with subdomains.

Anyone got a clue?

cellarius 12-10-2009 06:15 AM

Quote:

Originally Posted by sebz2009 (Post 1928081)
Alright, now I'm a bit stumped.
I cant seem to get the title of the page to register and it the pages don't work with subdomains.

Anyone got a clue?

I'm not sure I understand your problem. From what I try to gather I am also not sure if you're asking anything that is in correspondence with the article.

sebz2009 12-10-2009 01:24 PM

Alright, my bad. I got the title to work.

The bit about the subdomains does relate back to this.

I've made a custom page using this How-To.
When I load the page in the directory that global.php is in (the forum root directory) it loads absolutely fine.

What I'm trying to do is made this template appear in a sub domain (stats.example.com) rather than being in the root (example.com) where the forums live.

When I try running the code from the sub domain, it comes up and says that it doesn't know where "./global.php" is.
I change this to be "http://example.com/global.php".

That's fine, but then I get another error saying that it then can't find another .php file, etc, etc.

I'm just trying to figure out how I can get my custom page to load on a sub domain.

cellarius 12-10-2009 01:32 PM

Ahm, just like I suspected.
Quote:

Originally Posted by sebz2009 (Post 1928314)
I've made a custom page using this How-To.

This tutorial is not about making custom pages, and has nothing to do with your problem. This one is.


All times are GMT. The time now is 08:17 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.01364 seconds
  • Memory Usage 1,756KB
  • 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_code_printable
  • (2)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)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