Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Template Modifications
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
[How to] Add custompages to your forum Details »»
[How to] Add custompages to your forum
Version: 1.01, by utw-Mephisto utw-Mephisto is offline
Developer Last Online: Feb 2013 Show Printable Version Email this Page

Version: 3.6.0 Rating:
Released: 08-22-2006 Last Update: 08-24-2006 Installs: 86
Template Edits
 
No support by the author.

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 :

FlashChat
Custom Stuff

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



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



Now add a new Page which is Template Based



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



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



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


Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #22  
Old 08-25-2006, 04:27 AM
Jeordie015 Jeordie015 is offline
 
Join Date: Nov 2002
Location: Illinois, USA
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Okay, let me be more specific. If I wanted the page to be for a Top 10 List, how would I be able to call it that with the spaces? In the header, you have the directory structure break down, and if you called the template "top10list," that's how it would look in the header thing, and that doesn't look right.
Reply With Quote
  #23  
Old 08-25-2006, 05:29 AM
Onur Onur is offline
 
Join Date: Oct 2005
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hello, to check more than 1 or 2 Usergroups i think
Code:
<if condition="is_member_of($bbuserinfo, 2,3,4,5,6)">
is more clear
Reply With Quote
  #24  
Old 08-25-2006, 07:24 AM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jeordie015
Okay, let me be more specific. If I wanted the page to be for a Top 10 List, how would I be able to call it that with the spaces? In the header, you have the directory structure break down, and if you called the template "top10list," that's how it would look in the header thing, and that doesn't look right.
This works with the file I gave you ...

Check out what I mean :

http://www.ut2007world.com/top10.php
Reply With Quote
  #25  
Old 08-25-2006, 07:25 AM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Onur
Hello, to check more than 1 or 2 Usergroups i think
Code:
<if condition="is_member_of($bbuserinfo, 2,3,4,5,6)">
is more clear
Thanks, I was also thinking using in_array yesterday.... But yet again - my knowledge is limited - therefore thanks a lot for the tip ..
Reply With Quote
  #26  
Old 08-26-2006, 01:00 AM
Ninth Dimension's Avatar
Ninth Dimension Ninth Dimension is offline
 
Join Date: Oct 2001
Location: London, England.
Posts: 739
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great tutorial, thank you very much. I'm not using it just yet, but I will be shortly
Reply With Quote
  #27  
Old 08-26-2006, 01:42 AM
Jeordie015 Jeordie015 is offline
 
Join Date: Nov 2002
Location: Illinois, USA
Posts: 125
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Either I'm missing something or you didn't explain how to do what I'm wanting to do. All I'm able to figure out is to make a template called custom_whatever and I'll be able to view that by going to boardurl.com/misc.php?do=page&template=whatever

How exactly would I be able to create something like your top10.php?
Reply With Quote
  #28  
Old 08-26-2006, 01:52 AM
Kirk Y's Avatar
Kirk Y Kirk Y is offline
 
Join Date: Apr 2005
Location: Tallahassee, Florida
Posts: 2,604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

That'd require creating a new PHP file. Psionic Vision has posted a tutorial on doing this in the Articles forum.
Reply With Quote
  #29  
Old 08-26-2006, 12:21 PM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Jeordie015
Either I'm missing something or you didn't explain how to do what I'm wanting to do. All I'm able to figure out is to make a template called custom_whatever and I'll be able to view that by going to boardurl.com/misc.php?do=page&template=whatever

How exactly would I be able to create something like your top10.php?
Just a few posts up

https://vborg.vbsupport.ru/showpost....5&postcount=20
Reply With Quote
  #30  
Old 08-26-2006, 06:17 PM
VBUsers's Avatar
VBUsers VBUsers is offline
 
Join Date: Aug 2004
Posts: 830
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i added this hack and it works great but i wanted to know if there was a way to do it as a hard file. like test.php and have the content you need in there.

i tried it your way but i have 2 js scripts i need to be pulled into the page and its not working. what can i do?
Reply With Quote
  #31  
Old 08-26-2006, 06:28 PM
utw-Mephisto utw-Mephisto is offline
 
Join Date: Jan 2005
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You mean no templates at all ?

Unfortunately my knowledge is a bit limited in how to pull header and footer in a custom file. Maybe this helps:

http://www.vbulletin.com/forum/showp...18&postcount=1

I can search myself too - but so far no idea tbh ...
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 09:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04536 seconds
  • Memory Usage 2,324KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (9)bbcode_code
  • (3)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete