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] Create your own vBulletin page (https://vborg.vbsupport.ru/showthread.php?t=228112)

muratmunich 12-15-2009 07:32 PM

Thanks...

Ok nice, but do you know the Advantage of this way to use Variables in a Template ?

ragtek 12-15-2009 07:58 PM

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

anthony parsons 12-16-2009 10:35 PM

1 Attachment(s)
I like it Lynne... between this and the nav plugin, my life is now made a lot easier than having to sit down and come up with it myself. Very much appreciated. Custom page with menu... excellent.

https://vborg.vbsupport.ru/attachmen...1&d=1261010072

nubian 12-17-2009 05:07 AM

  1. Is is mandatory that I have the text case of there vars to be all in caps in the test.php and in the name of the template?
    PHP Code:

    $globaltemplates = array('TEST',); 

    PHP Code:

    $templater vB_Template::create('TEST'); 

    How do I get it so that I can retain the case of my test.php but change the case in the template from TEST to test?
  2. I plan on making quite a few custom pages so would it be possible to place these php files in another directory?

Lynne 12-17-2009 03:52 PM

1. No, you don't need all caps. You just need to be consistent when you use it. If it's in all small letters in the $globaltemplates area, then use all small letters in the $templater.
2. Sure, but you'll have to make sure when you include the global.php page, or any other scripts, you'll have to make sure the path to them are correct.

turtile 12-19-2009 04:22 PM

I get the error:

Code:

Warning: require_once(./global.php) [function.require-once]: failed to open stream: No such file or directory in /home1/riptidep/public_html/unusualplants/index.php on line 27

Fatal error: require_once() [function.require]: Failed opening required './global.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home1/riptidep/public_html/unusualplants/index.php on line 27

I tried the other global method from the posts and I get a blank page. My template is under my default page.

Code:
Code:

<?php

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

// #################### DEFINE IMPORTANT CONSTANTS #######################

define('THIS_SCRIPT', 'index.php');
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('INDEX',
);

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

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


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

$navbits = construct_navbits(array('' => 'Home'));
$navbar = render_navbar_template($navbits);

// ###### YOUR CUSTOM CODE GOES HERE #####
$pagetitle = 'Unusual Plants Home Page';

// ###### NOW YOUR TEMPLATE IS BEING RENDERED ######

$templater = vB_Template::create('INDEX');
$templater->register_page_templates();
$templater->register('navbar', $navbar);
$templater->register('pagetitle', $pagetitle);
print_output($templater->render());

?>

Thanks

Lynne 12-19-2009 04:58 PM

And are you putting this file in the same directory as all your other vbulletin files? If not, you need to do a chdir to get the global.php file.

turtile 12-19-2009 05:33 PM

My index file is in unusualplants.net/
The forum is located at unusualplants.net/forums

I tried changing the directory at the beginning of the code (never changing back), right before the global line(never changing back), at the beginning and changing the directory back after the global line, and right before the global line and changed it back after. I get a blank page for each one.

I used this for changing the directory:
Code:

chdir('forums');
and this for moving back:
Code:

chdir('../');
Thanks

Lynne 12-19-2009 05:51 PM

When you added the template, did you add it to the style you are currently using to browse your forum?

turtile 12-19-2009 05:53 PM

Quote:

Originally Posted by Lynne (Post 1933635)
When you added the template, did you add it to the style you are currently using to browse your forum?

Yes


All times are GMT. The time now is 10:44 PM.

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.03851 seconds
  • Memory Usage 1,745KB
  • 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
  • (4)bbcode_code_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (3)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