The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
How to create your own vBulletin-powered page! (uses vB templates)
Want to create your very own vBulletin powered page which includes the header, footer, and the user permissions system as well? Well now you can Want to know how it will look? Take a look at the attached screenshot below! Now includes the Who's Online modification! Also, instructions included on how to create your own pages that are integrated with current vBulletin files! I'm going to give you a generic page but you can easily modify the contents of the page by changing the template So here we go Instructions: Create a new file, whatever you want to call it (let's say test.php). Open up test.php and add the following (replace TEST with whatever template you want to show): PHP Code:
Now create the template, called TEST with the following content: HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Title</td> </tr> <tr> <td class="alt1">Text</td> </tr> </table> $footer </body> </html> Now check it out by going to test.php Who's Online Modification Now if you want to show who is browsing this new page of yours, just open up includes/functions_online.php and find: PHP Code:
PHP Code:
Then find: PHP Code:
PHP Code:
---------------------------------- Also if you want to create your own pages 'within' current vBulletin files, do the following: Open the file you want, and then right before the final ?> in the source code, add the following: PHP Code:
edit by Lynne: If running 3.8.4 or above, see this post to take care of the PHP 5.3.0-related problems - https://vborg.vbsupport.ru/showpost....postcount=1171 |
#1132
|
|||
|
|||
Yes, if that is what you want to show. The html (design and fixed data) part of the form can be put directly into the template, and any dynamic data can be displayed through variables set in the php code.
The basic purpose of templating (whether vbulletin or otherwise) is to separate the front end design from the business logic. The template holds just enough code (actually html with conditionals, not programming code) to show whatever needs to be shown. The template is simply 'shown', and that is why you cannot have php code in there. The vbulletin manual has a section on templates, and reading the default vb templates can be very instructive for newcomers. --------------- Added [DATE]1246858288[/DATE] at [TIME]1246858288[/TIME] --------------- This will work: php: Code:
$htmlform = "<form>........</form>" Code:
$header $navbar $htmlform $footer |
#1133
|
|||
|
|||
Thanks AMCD i finally got it to work.
|
#1134
|
|||
|
|||
Sorry, but this makes no sence at all to me
anyone care to explain it in more detail for me? Sorry Gary, i just dont find your instructions very clear at all :S |
#1135
|
||||
|
||||
It is explained as well as it can be. The best thing to do is just copy exactly what he did and then analyze it yourself after you get it up and working. If you need further help, the best thing to do is to create your own thread in the main forums and post the exact php file you wrote and the exact template you wrote (both using the php/html tags).
|
#1136
|
||||
|
||||
Okay, I accidentally deleted my test file that I finally got working and really can't spend another week reading through all 76 pages of this topic, fun as that was the first time, to find the answer to this simple question. What do I change in this code to make this page viewable by nonmembers?
Quote:
|
#1137
|
||||
|
||||
Remove
Code:
if (!$vbulletin->userinfo['userid']) print_no_permission(); |
#1138
|
||||
|
||||
Sorry, I couldn't figure out those tags. And thanks for the help. Much appreciated.
|
#1139
|
||||
|
||||
They're the same as the quote tags..... just php, code, and html
|
#1140
|
||||
|
||||
Quote:
I have fixed issue... It was a template issue. Thanks 4 your time & help. |
#1141
|
|||
|
|||
is there any way to insert html into the template, something like this:
eval('$showhtml = "' .$showhtml . '";'); // with $showhtml containing html I want to convert one of my scripts but if I can't do this it'll be a huge headache. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|