Back to vBulletin 3.6 Template Modifications

[How to] Add custompages to your forum
Mod Version: 1.01, by utw-Mephisto

This modification is in the archives.
vB Version: 3.6.0 Rating: (9 votes - 4.78 average) Installs: 86
Released: 24 Aug 2006 Last Update: 25 Aug 2006 Downloads: 414
Not Supported Template Edits  

This is not really a mod, since this is simply a "reminder" of a function build in but not documented. Submitted also to vbulletin.com of course.

If you would like to add custom pages (including header / footer of your forum) do the following:

Add a new template in the style of your choice. You can name it whatever you want, it has to have the prefix
Code:
custom_
though.

You are then able to call the custompage using

http://www.ut2007world.com/misc.php?do=page&template=test2

Change www.ut2007world.com with your domain and the test2 with your template name accordingly.

Lets make an example.

Admincp > Styles & Templates > Style Manager > In drop down choose Add New Template

Name the template for example custom_google

Use the following code :

Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<!-- Custom Code Start Here -->
<center>
<iframe src="http://www.google.com" width="80%" height="400"></iframe></center>
<!-- / Custom Code Ends here -->
$footer
</body>
</html>
As you can see, I just use an iframe for you to see any results.

Now use your web-browser and go to

http://<domain>/misc.php?do=page&template=google

And change the domain to your own.

See attached a screenshot how the above example would look like. Also attached a default html code for a template. The page name will be automatically parsed in the navbar.

If you would like to have the code displayed for certain usergroups only, you can add one ID

Code:
<if condition="$bbuserinfo['usergroupid'] == '6'">
</if>
Or more usergroup IDs

Code:
<if condition="$bbuserinfo['usergroupid'] == '5' OR $bbuserinfo['usergroupid'] == '6' OR $bbuserinfo['usergroupid'] == '7'">
</if>
If you just would like to make sure that ANY user who is registered can see the code, regardless of its group, add

Code:
<if condition="$bbuserinfo[userid]">
</if>
instead.

Example code would be now:

Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar           
<if condition="$bbuserinfo[userid]">
<!-- Custom Code Start Here -->
<center>
<iframe src="http://www.google.com" width="80%" height="400"></iframe></center>
<!-- / Custom Code Ends here -->
</if>
$footer
</body>
</html>

On request:
Creating Custom Pages using vbadvanced
Anyway, some people would like to add for example flashchat, irc chat or simple iframes including all those modules etc. etc.

Some demos :

http://www.ut2007world.com/flashchat.html
http://www.ut2007world.com/index.php?page=linux

etc. etc.

So lets get started.

First, you need to create a template. Lets use as exmaple an iframe where google.com runs in it ...

Create a new template with the prefix adv_portal_ and name it for example google.

Admincp > Styles & Templates > Style Manager > In drop down choose Add New Template

http://img168.imageshack.us/my.php?image=2pi5.jpg

Put in the code

Code:
$stylevar[htmldoctype]
<html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]">
<head>
$headinclude
<title>$vboptions[bbtitle]</title>
</head>
<body>
$header
$navbar
<!-- Custom Code Start Here -->
<center>
<iframe src="http://www.google.com" width="80%" height="400"></iframe></center>
<!-- / Custom Code Ends here -->
$footer
</body>
</html>
and call it adv_portal_google

http://img168.imageshack.us/my.php?image=1ao2.jpg

Now add a new Page which is Template Based

http://img168.imageshack.us/my.php?image=2ms5.jpg

Page Title : What you would like to have displayed in the browser title bar
Page Identifier : This is the variable that will be used in the URL to link to this page. For example, if this option is set to 'games', then the link to this page would look like this: /cmps_index.php?page=games
Template : adv_portal_google

Should look something like

http://img168.imageshack.us/my.php?image=untitledso5.jpg

You don't have to use the Module Shell Template Options, only if you would like to have a typicall box around the stuff you display including the button to expand / collapse it

Now the important stuff : modules

There is not really a guideline for it ... The most important modul you need :

Custom Page Content

If you don't use it - you will get a white page ..

But for this example, lets disable all modules in the middle, except the one just mentioned, and some modules on the left and right. You will proparbly have a different module set, but once again : Custom Page content MUST and WILL be there

http://img169.imageshack.us/my.php?image=untitledht8.jpg

Since you named the identifier google - you can browse now to that page using

http://<domain>/cmps_index.php?page=google

IF you renamed cmps_index.php to index.php - you need to change that of course...

Here is a demo :

http://www.ut2007world.com/index.php?page=google

http://img169.imageshack.us/my.php?image=untitledep9.jpg

Download

This modification is archived, downloads are still allowed.

File Type: %1$s custom_sometemplate.txt (301 Bytes, 317 downloads)
File Type: %1$s instructions.txt (5.6 KB, 317 downloads)

Screenshots

Click image for larger version
Name:	untitledvd9.jpg
Views:	1302
Size:	66.0 KB
ID:	52566  

Similar Mods

Forum Display Enhancements Localize (translate) forum name, forum titles & forum descriptions vBulletin 3.6 Add-ons
Forum Activity Check For Forum Access (Per Forum) vBulletin 3.0 Beta Releases

vblts.ru supports vBulletin®, 2022-2024