![]() |
template driven pages
Re: http://www.vbulletin.com/forum/showthread.php?t=101325
Create a PHP file with this code. Change the red code appropriately. This will display a page within your forum layout where the page contents are the contents of the template you specify. Code:
<?php |
thanks jake
for some reason the $navbar variable wont work - is there something i have to include in the php code to be able to include the navbar template |
Try adding this code before the last eval line:
PHP Code:
|
yeah that worked - thanks
|
Quote:
PHP Code:
|
Quote:
|
Please pardon my ignorance, but what I'm getting from this is that this creates the option to stick any current (or custom) template into an entirely new page with a vBulletin theme. This is all well and good (from my retarded little standpoint), but I'm not too keen on custom making a template w/o guidance. My webmaster and myself are testing this hack and the setup is simple enough but we're having problems adding content. :ermm: It's just that we don't quite understand vB3 yet. Any guidence?
|
Quote:
PHP Code:
|
<a href="http://www.interfans.org/forum/rules.php" target="_blank">http://www.interfans.org/forum/rules.php</a>
I get this error: Warning: chdir(): No such file or directory (errno 2) in /home/interfan/public_html/forum/rules.php on line 4 And what do I have to add in the new template? |
Quote:
PHP Code:
|
where do I have to copy that?
Sorry not very confident with php |
Put it instead of this:
PHP Code:
|
I don't know what u r talking about...:(
My code is this one: <?php // GO TO FORUM DIR chdir('/full/path/to/forum/directory'); // STANDARD VBULLETIN STUFF define('NO_REGISTER_GLOBALS', 1); define('THIS_SCRIPT', 'script_name'); require_once('./global.php'); // GENERIC_SHELL VARS $pagetitle = "Title of Page"; $HTML = ""; // PIECED TOGETHER IN SCRIPT eval('$HTML = "' . fetch_template('name of template') . '";'); eval('print_output("' . fetch_template('GENERIC_SHELL') . '");'); ?> |
Quote:
PHP Code:
|
<a href="http://www.interfans.org/forum/rules.php" target="_blank">http://www.interfans.org/forum/rules.php</a>
error I am getting confused about the code to use now. Can u please say exaclty all the code I have to have in my rules.php page. Thanks |
Here's what I use for my rules.php file:
PHP Code:
|
now I get this http://www.interfans.org/forum/rules.php?
:( |
What is in the template you're trying to call?
|
I have to put the rules of my forum, but I don't know how.
|
Quote:
|
should I copy this?
and in the template? |
Quote:
Jakeman, This php file is working fine. But, I wand to display ?control panel?. I mean this Board "tree" and Welcome, UserName User CP FAQ Members List Calendar New Posts Search Quick Links Log Out How I can do this? What I should add to your code? Thank you. |
Hello,
I'm having a little trouble with this. I've created a php file called Untitled.php which can be seen here: http://www.astra-mk2.com/Untitled.php contents of the file are as follows: PHP Code:
The code that's above works beautifully, but it's just the linking to an html as the template and everything that it uses is as I want it. Any help would be much appreciated. |
Sorry, I'm a bit thick when it comes to this sort of thing.
I think i've nailed it down a bit further. Do i understand it right that I need a script? How and what? and that I obviously need to create the file. Should this have the php or html extension? Cheers in advanced |
Anyone fancy helping the thick??? :nervous:
|
php extension :)
|
still not getting anywhere no matter what i change here, nothing happens
PHP Code:
PHP Code:
I know I'm terrible, I really need things spelt out! |
Anyone??
|
hmmm, I've had me another go at this, still can't get it, I give up
|
Right, I'm having another pop at this and at the mo, I still can't get it to work this is what I have:
PHP Code:
Cheers |
I take it no-one knows then?
|
--------------------------------------------------------------------------------
Right, that's it, i still can't get it to work!!! I'll pay for someone to do this for me as long as it's not stupid money. If anyone is interested??? |
Sorted!! :cool: :cool: Thanks to a guy called David Robinson from Freelancers.net
Well chuffed. You can see a test page here if you're interested http://www.astra-mk2.com/untitled.php |
Allen,
I am having the same exact problem with my file. Could you please guide me on how to insert my HTML page into it? |
Yep no problem blue chi.
This is what has been done with mine: create your html pages as normal. Then create a template with vbulletin here: admincp/styles & Templates/Style Manager/Add New Template call it what you want, mine is html_poloshirts. Copy all the html code into this template. eg: PHP Code:
untitled.php PHP Code:
You can put this file wherever you want really, doesn't make any difference. Oh, don't forget to upload any images referenced in the new template created. Once done, just replicate for the various pages you want. |
Thanks so much allen, I managed to get the file show my HTML content. But I was trying to use the PHP include() function, but it doesn't seem to work. Any ideas of how to fix this?
|
OK, I just realised that PHP is not allowed in templates, that's a whole differrent issue then. :S
|
Quote:
I've stripped my version of this code to: Code:
<?php Any ideas? |
Quote:
|
If you just want the username you don't need to load the whole vB backend.
Just check the cookies (bbuserid, bbpassword) and query table user |
All times are GMT. The time now is 04:46 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|