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 |
#982
|
||||
|
||||
Quote:
PHP Code:
|
#983
|
|||
|
|||
Thank you very much Lynne that did the trick that i was looking for I am sorry if it had been discussed before but i couldn't find the topic with it explained enough to understand again thank you
|
#984
|
|||
|
|||
- forum/my_folder/myfile.php
How to call file global.php ? |
#985
|
|||
|
|||
hello
is it possible to know how to do so: the forum is: . / Foum and the page that I will wish to generate (List Who's Online (WOL) is here: . / gfx can you tell me is that there has to change and if possible thank you |
#986
|
||||
|
||||
I had tried to do this before and was unsuccessful. I think you will need to just play with it yourself until you can get it to work.
|
#987
|
|||
|
|||
thank you for the answer
it's been several months that I try I would like to export the List Who's Online (WOL) in the gallery 4images and three days I try this way. is it possible to use one of these codes to match 4images and VB4.2.1? because the integration does not work with 4images vb4.2.1 (at least not well because I managed repair part.) just for look: http://www.gfx-art.fr/index.php |
#988
|
||||
|
||||
I'm sorry, but I don't understand what you are trying to do at all and the link doesn't help me.
|
#989
|
|||
|
|||
As @lynne said it is a bit hard to understand what you are looking for.
I managed to understand that you wanted us to view link "http://www.gfx-art.fr/gfx/index.php". I understand you want to use the WOL code in your pages. I do not understand the 4 images and why it is a problem in vbulletin v4.2.1? Let me know if we are using a translator... |
#990
|
|||
|
|||
Hello
I'm sorry for my English (translator) and that for me to be obvious. I'll try to be clearer. Currently, the home page, the gallery 4 images, blog Dotclear and VB4.2.1 forum are all linked. (integrated). There is nevertheless something that bothers me: when somebody is on the reception, the gallery or blog, it is not recorded in the WOL Vb. to be recognized (for a while) it is mandatory to go through the forum (visited one of the pages). More restriction When we connect via 4images, it is redirected to 4 images and despite the time the connection is recognized everywhere, WOL Vb Does not detect the person. the idea is to have all the stats for all pages (visitors, members ...) on the WOL forum mm and that these stats are also on the WOL of 4 images. catch here is to illustrate (at the same time): Vbulletin: 4 images: Normally both WOL should notify members 4 and 4 (Vb) +4 (4images)+ dotclear + home page = 8 visitors ++ the idea was to use the recognition Vb thanks to "Create your own vBulletin page" to merge data of the time someone visits or whatever the community page, it is automatically Ressence on WOL 4 images and the Vb and to go further is to use the downright Vb to integrate a 4 images to have all the information and colors.... Is for you'm clear? thank you for your help |
#991
|
||||
|
||||
In the very first post of this article, I reposted instructions on how to add this page to your WOL list (that is the online.php page). Did you create those plugins for all your custom pages? And did you follow this article for creating those pages? If you didn't, and someone else created those pages, then you need to ask them how to do this because I cannot help you with that.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|