The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Question about creating a custom template
I am trying to use a custom template on a page: http://www.v6performance.net/featuredcar/. However, the paths to the images and links in the $navbar are all incorrect because they are relative to the /forums/, how can I fix this for all of my custom templates?
Thanks! |
#2
|
||||
|
||||
<font color="darkgreen">I believe if you prepend the paths with "forums/" it will set the proper path for the images.</font>
|
#3
|
|||
|
|||
Here is my script,
Code:
<?php // ######################## SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // ##################### DEFINE IMPORTANT CONSTANTS ####################### // change the line below to the actual filename without ".php" extention. // the reason for using actual filename without extention as a value of this constant is to ensure uniqueness of the value throughout every PHP file of any given vBulletin installation. define('THIS_SCRIPT', 'custompage'); // #################### 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( // change the lines below to the list of actual templates used in the script 'custompage' ); // pre-cache templates used by specific actions $actiontemplates = array(); // ########################## REQUIRE BACK-END ############################ chdir('/path/to/forums'); require_once('./global.php'); // #################### HARD CODE JAVASCRIPT PATHS ######################## $headinclude = str_replace('clientscript', $vbulletin->options['bburl'] . '/clientscript', $headinclude); // ######################################################################## // ######################### START MAIN SCRIPT ############################ // ######################################################################## $navbits = array(); // change the line below to contain whatever you want to show in the navbar (title of your custom page) $navbits[$parent] = 'Custom Page'; $navbits = construct_navbits($navbits); eval('$navbar = "' . fetch_template('navbar') . '";'); $custompage = implode('', file('/path/to/custom/page.html')); // change the line below to contain the name of the actual main output template used in your script eval('print_output("' . fetch_template('custompage') . '");'); ?> |
#4
|
||||
|
||||
You would have to do it in your template code where you use the path to your images.
Code:
<img src="forums/$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" title="Test" /> Code:
<img src="$forums/$stylevar[imgdir_statusicon]/thread$thread[statusicon].gif" title="Test" /> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|