vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=228112

[HOW TO - vB4] Create your own vBulletin page
by Lynne
16 Nov 2009 18:38

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!!!):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

- Be sure to change 'TEST' to the actual template name (WARNING: the template name is CASE SENSITIVE!!!), and change 'test' to the filename or a unique name for the page. Also, change 'Test Page' and 'My Page Title' to whatever you want to show in the navbits, such as 'Viewing Member Profile' (just an example).

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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
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:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
2. hook location online_location_unknown:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

.
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

cellarius 17 Nov 2009 15:03

Thanks Lynne for compiling this - this will be most helpful for many users, no doubt :)

So, I gather you agree with my doubts that the NO_REGISTER_GLOBALS constant is still needed?

Lynne 17 Nov 2009 16:18

Quote:

Originally Posted by cellarius (Post 1915881)
Thanks Lynne for compiling this - this will be most helpful for many users, no doubt :)

So, I gather you agree with my doubts that the NO_REGISTER_GLOBALS constant is still needed?

Yep. I did a search in the vb pages and couldn't find NO_REGISTER_GLOBALS lurking around in any of them. :)

cellarius 17 Nov 2009 16:29

Excellent! :)

Brandon Sheley 17 Nov 2009 16:32

Thanks for the article Lynne :)

/me bookmarks this one

Mythotical 17 Nov 2009 20:40

Might want to add if conditions to your article as well. I did a search through templates and found this:

To do an if condition in a template:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Just replace $myvar with the variable you are using from your db query and mytable should be replaced with the row or column you are calling from the db.

Lynne 17 Nov 2009 21:22

There are already articles about conditions to use in templates. I would just be repeating them by putting them in this article. There are also articles about rendering templates and registering variables also (which I linked to). I wanted to put this up as just a basic outline to get someone started.

Mythotical 17 Nov 2009 22:07

Actually you point me to one article referring to conditions. I have not found one anywhere. You do that then your my savior.

bobster65 17 Nov 2009 22:35

Quote:

Originally Posted by Steve M (Post 1916161)
Actually you point me to one article referring to conditions. I have not found one anywhere. You do that then your my savior.

http://www.vbulletin.org/forum/showthread.php?t=217570

Mythotical 17 Nov 2009 22:35

Quote:

Originally Posted by bobster65 (Post 1916183)

Actually I found that, seems I wasn't searching for the right term.

nomoreturn 18 Nov 2009 00:34

Where we have to upload test.php

cellarius 18 Nov 2009 00:45

Quote:

Originally Posted by nomoreturn@hotm (Post 1916232)
Where we have to upload test.php

Put it in your forum root.

Lionel 18 Nov 2009 03:11

Nice, and what do you do if you want to have 3 columns in your page? Right now I had to create a table with 3 td, but I had rather avoid that

Lynne 18 Nov 2009 03:39

Quote:

Originally Posted by Lionel (Post 1916357)
Nice, and what do you do if you want to have 3 columns in your page? Right now I had to create a table with 3 td, but I had rather avoid that

There is no reason you can't use a table if you don't want to use divs. But, if you want to use divs to make 3 columns, google is a great place to start. There are lots of sites that will show you how to use divs in place of tables.

Lionel 18 Nov 2009 04:22

Got your first reply. Sorry Lynne. I asked because I found you extremely helpful and because I could not find any places by vb to explain about the new css, until I saw that there were new templates.

Specially whatever you put in $stylevar does not necessarily gets implemented. So instead of thinking that they were bugs, I inquire first.


All times are GMT. The time now is 04:52.

Powered by vBulletin® Version 3.8.13
Copyright © 2019, MH Sub I, LLC dba vBulletin. All Rights Reserved. vBulletin® is a registered trademark of MH Sub I, LLC
Copyright ©2001 - , vbulletin.org. All rights reserved.