The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
[HOW TO - vB4] Create your own vBulletin page
This is an updated article on how to create your own vbulletin powered page. It's only for use with vB4. This is NOT my work. I'm posting this from another thread where vB Style took the time to write this out. And his work is based on the article by Gary King here - How to create your own vBulletin-powered page! (uses vB templates) Instructions to Create your Own Page: 1. Create the php page: - 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 - WARNING: the template name is CASE SENSITIVE!!!): Code:
<?php // ####################### SET PHP ENVIRONMENT ########################### error_reporting(E_ALL & ~E_NOTICE); // #################### DEFINE IMPORTANT CONSTANTS ####################### define('THIS_SCRIPT', 'test'); define('CSRF_PROTECTION', true); // change this depending on your filename // ################### 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('TEST', ); // pre-cache templates used by specific actions $actiontemplates = array(); // ######################### REQUIRE BACK-END ############################ // if your page is outside of your normal vb forums directory, you should change directories by uncommenting the next line // chdir ('/path/to/your/forums'); require_once('./global.php'); // ####################################################################### // ######################## START MAIN SCRIPT ############################ // ####################################################################### $navbits = construct_navbits(array('' => 'Test Page')); $navbar = render_navbar_template($navbits); // ###### YOUR CUSTOM CODE GOES HERE ##### $pagetitle = 'My Page Title'; // ###### NOW YOUR TEMPLATE IS BEING RENDERED ###### $templater = vB_Template::create('TEST'); $templater->register_page_templates(); $templater->register('navbar', $navbar); $templater->register('pagetitle', $pagetitle); print_output($templater->render()); ?> 2. Create the Template: - If you are in debug mode, create the template in your MASTER STYLE so it shows up in all your styles, otherwise make sure you create the template in the style you are using. If following the page above, call the template TEST (WARNING: the template name is CASE SENSITIVE!!!) with the following content: HTML Code:
{vb:stylevar htmldoctype} <html xmlns="http://www.w3.org/1999/xhtml" dir="{vb:stylevar textdirection}" lang="{vb:stylevar languagecode}" id="vbulletin_html"> <head> <title>{vb:raw vboptions.bbtitle} - {vb:raw pagetitle}</title> {vb:raw headinclude} {vb:raw headinclude_bottom} </head> <body> {vb:raw header} {vb:raw navbar} <div id="pagetitle"> <h1>{vb:raw pagetitle}</h1> </div> <h2 class="blockhead">Title</h2> <div class="blockbody"> <div class="blockrow"> Text </div> </div> {vb:raw footer} </body> </html> Instructions to Add your Page to the Who's Online List (WOL): Create two plugins using the following hooks. Replace mypage and similar with your information. 1. hook location - online_location_process: Code:
switch ($filename) { case 'test.php': $userinfo['activity'] = 'mypage'; break; // add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all. } 2. hook location online_location_unknown: Code:
switch ($userinfo['activity']) { case 'mypage': $userinfo['where'] = '<a href="test.php?'.$vbulletin->session->vars[sessionurl].'">My Page</a>'; $userinfo['action'] = "Viewing My Page"; $handled = true; break; // add more cases here if you have more than one custom page. no need for multiple plugins. one plugin can handle all. } The colored part in the code above shows what you need to change in the plugins (both reds should be the same and both blues should be the same, whereas green can be whatever you want). Please see this article for help with rendering templates - [vB4] Rendering templates and registering variables - a short guide |
#142
|
||||
|
||||
Quote:
|
#143
|
||||
|
||||
Been trying to get this to work all day with no luck, just get a blank page every time, copied it exactly but no joy
|
#144
|
|||
|
|||
Quote:
Code:
$templater = vB_Template::create('test'); |
#145
|
|||
|
|||
Awesome job, works great for me.
|
#146
|
||||
|
||||
Quote:
Checked that a few times and still the same, must be doing something wrong creating the template. I went in to style manager / add new template and named it test then pasted in the info from the first page (2nd box) is this correct ? |
#147
|
|||
|
|||
Quote:
Anyway - thanks for the info, Lynne. Guess I'll have to create my own CSS (yuck) just to be able to use strong and ordered lists... PS - frustration directed at VB development team, not you Lynne. |
#148
|
||||
|
||||
Quote:
Quote:
Code:
<ul> <li>stuff</li> <li>more stuff</li> </ul> As for the css for strong, just add this in your custom css for the page: HTML Code:
<style type="text/css"> strong {font-weight:bold;} ul.unordered li {list-style-type: disc;list-style-position:inside;} </style> HTML Code:
<ul class="unordered"> <li>stuff</li> <li>more stuff</li> </ul> |
#149
|
||||
|
||||
Only using the default style on my test board, still no joy..
|
#150
|
|||
|
|||
Quote:
Thanks for your help, I sincerely appreciate it. The UL tags are being used correctly, though. I extracted just the content of the block and pasted it here: HTML Code:
Advertising with the Michigan FBody Association is a sure fire way to get more customers to your local shop! What better way to get local customers interested in your products than to advertise them on a website that thousands of Michigan residents would see? Let's take a look at the features that each Sponsor gets!<br> <br> <b>Premier Package - $200 per Year</strong> - Ultimate Exposure! </b><b><font color="red">SOLD!</font></b> <UL> <LI>Premier Package = Ultimate in Company Exposure!</LI> <UL> <LI>This package is only available to ONE company at a time! With this package, you not only do you get everything that is offered in the "Gold" package, but your company will have sponsored <strong>FOUR</strong> trophies for the annual Spring Meet & Greet! That's right, each <b>1st Place</b> Generation-Specific trophy (1st Place - 1st Generation, 1st Place - 2nd Generation, etc) will be sponsored by your company with this package! Instant recognition for being a sponsor that helps make our Meet & Greet possible, your company's name will be mentioned throughout the course of the Meet & Greet and at the Awards ceremony!</LI> </UL> <LI>Banner on EVERY MiFbody.com Page</LI> <UL> <LI>Your banner will be displayed in the top right corner of every single page on MiFbody.com. Your banner will also rotate in the Horizontal Banner section as well as the Right Sponsor Bar section. That's right - your banner is guaranteed to be displayed once on every single page, and the potential for up to three different locations on the page! <b>Now that's some exclusive exposure!</b></LI> </UL> <LI>SubForum under the Sponsor Section</LI> <UL> <LI>The sub forum allows sponsors to post specific company information, deals, specials, new products, etc that you want to advertise.</LI> </UL> <LI>Right Sponsor Bar Banner</LI> <UL> <LI>A 100 pixel wide banner is displayed on the main vBulletin templates such as the Forum Home, Forum Display, and Show Thread templates. </LI> </UL> <LI>Horizontal Banner Section</LI> <UL> <LI>To ensure even more exposure, we've implemented a random rotating banner section that displays above the main content area. That way your company's banner will get maximum exposure on many pages that the average user navigates through. </LI> </UL> <LI>Banner Statistics (Upon request)</LI> <UL> <LI>Banner Impressions (times the banner is shown on the page) and Banner Clicks are logged by default. Upon request, we can pull up your impressions and clicks to let you know how well your banner is doing.</LI> </UL> <LI>Company Flier / Brochure</LI> <UL> <LI>At our annual Spring Meet & Greet, we will hand out a Sponsor-provided flier upon registration and check-in. This will get your product information into the hands of over 200 people! </LI> </UL> </UL> <br> <b>Platinum Package - $150 per Year</b> - Better Exposure! <UL> <LI>Two Sponsored Spring Meet & Greet Trophies!</LI> <UL> <LI>With the Gold "Plus" Package, your company will be sponsoring two Non-Generation specific trophies for our Annual Spring Meet & Greet! This will give you even more exposure than the Gold and Silver package! When we are holding the awards ceremony, your company's name will be mentioned as being the sponsor of the trophy! This is a great way to get recognition for your company.</LI> </UL> <LI>SubForum under the Sponsor Section</LI> <UL> <LI>The sub forum allows sponsors to post specific company information, deals, specials, new products, etc that you want to advertise.</LI> </UL> <LI>Right Sponsor Bar Banner</LI> <UL> <LI>A 100 pixel wide banner is displayed on the main vBulletin templates such as the Forum Home, Forum Display, and Show Thread templates. </LI> </UL> <LI>Horizontal Banner Section</LI> <UL> <LI>To ensure even more exposure, we've implemented a random rotating banner section that displays above the main content area. That way your company's banner will get maximum exposure on many pages that the average user navigates through. </LI> </UL> <LI>Banner Statistics (Upon request)</LI> <UL> <LI>Banner Impressions (times the banner is shown on the page) and Banner Clicks are logged by default. Upon request, we can pull up your impressions and clicks to let you know how well your banner is doing.</LI> </UL> <LI>Company Flier / Brochure</LI> <UL> <LI>At our annual Spring Meet & Greet, we will hand out a Sponsor-provided flier upon registration and check-in. This will get your product information into the hands of over 200 people! </LI> </UL> </UL> <br> <b>Gold Package - $100 per Year</b> - Good Exposure! <UL> <LI>SubForum under the Sponsor Section</LI> <UL> <LI>The sub forum allows sponsors to post specific company information, deals, specials, new products, etc that you want to advertise.</LI> </UL> <LI>Right Sponsor Bar Banner</LI> <UL> <LI>A 100 pixel wide banner is displayed on the main vBulletin templates such as the Forum Home, Forum Display, and Show Thread templates. </LI> </UL> <LI>Horizontal Banner Section</LI> <UL> <LI>To ensure even more exposure, we've implemented a random rotating banner section that displays above the main content area. That way your company's banner will get maximum exposure on many pages that the average user navigates through. </LI> </UL> <LI>Banner Statistics (Upon request)</LI> <UL> <LI>Banner Impressions (times the banner is shown on the page) and Banner Clicks are logged by default. Upon request, we can pull up your impressions and clicks to let you know how well your banner is doing.</LI> </UL> <LI>Company Flier / Brochure</LI> <UL> <LI>At our annual Spring Meet & Greet, we will hand out a Sponsor-provided flier upon registration and check-in. This will get your product information into the hands of over 200 people! </LI> </UL> </UL> <br> <b>Silver Package - $50 per Year</b> <UL> <LI>Right Sponsor Bar Banner</LI> <UL> <LI>A 100 pixel wide banner is displayed on the main vBulletin templates such as the Forum Home, Forum Display, and Show Thread templates. </LI> </UL> <LI>Banner Statistics (Upon request)</LI> <UL> <LI>Banner Impressions (times the banner is shown on the page) and Banner Clicks are logged by default. Upon request, we can pull up your impressions and clicks to let you know how well your banner is doing.</LI> </UL> <LI>Company Flier / Brochure</LI> <UL> <LI>At our annual Spring Meet & Greet, we will hand out a Sponsor-provided flier upon registration and check-in. This will get your product information into the hands of over 200 people! </LI> </UL> </UL> <br> <b>Spring Meet & Greet Trophy Sponsorship - $30 / trophy</b><br> Each year, we hold a Spring Meet & Greet car show. We have a number of trophies that are awarded to show winners and for a small price you can get recognition at our show too! For only $30 per trophy, you can sponsor one of the trophies at our Meet & Greet - when we get to awarding the trophy, your company's name will be announced to everyone at the show! Likewise, we will have a small flier that will be given out at registration/check-in that will thank all of the trophy sponsors and will give their company information - website, address, contact information. The people at our show know where to go to thank you by buying your products! <strong>Please note: the trophy sponsorship will be applied at the next possible car show. If you sponsor the trophy before this year's show, it will be applied to this year's show. Obviously, if you sponsor a trophy after our car show has already happened for the year, it will be applied to next year's show.</strong> <br><br> Want to know more information about advertising with the Michigan Fbody Association? Send an email to our advertising e-mail address and we will be in contact with you as soon as possible to discuss the packages in more detail.<br><br><center><a href="mailto:advertising@mifbody.com">Advertising Email Address</center> </font> |
#151
|
||||
|
||||
Try this for your css:
Code:
<style type="text/css"> strong {font-weight:bold;} ul.unordered li {list-style-type: disc;list-style-position:inside; display: list-item; margin-left: 2.5em; padding-left: 0;} ul.unordered ul li {list-style-type: circle; display: list-item;margin-left: 2.5em; padding-left: 0;} </style> HTML Code:
<LI>SubForum under the Sponsor Section <UL> <LI>The sub forum allows sponsors to post specific company information, deals, specials, new products, etc that you want to advertise.</LI> </UL> </LI> |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|