PDA

View Full Version : Creating New Blog Templates?


hhillegas
09-21-2007, 03:53 AM
Hi,

I'm sorta new to any massive VBB changes - I'm a Ruby on Rails developer that is drawn to the nice VBB+Blog platform.

I have some Wordpress themes that I need to convert to work with the VBB blog addition.

I have PHP, Java, Ruby, Objective-C and C++ experience but what I don't have experience with is how VBB hangs together - what files do what and how they interact.

If anyone could point me in the direction of a tutorial, example code or something like that, I'd be very grateful.

Cheers,
Hunter

Dismounted
09-21-2007, 05:03 AM
vBulletin uses a template system. Basically, what that means is that the files do all the data preprocessing (note PHP's recursive acronym: "PHP: HTML Preprocessor") and the template uses that data.

http://www.vbulletin.com/docs/html/styles_and_templates

hhillegas
09-21-2007, 09:22 PM
Thanks. I actually have read through the entire VBB manual.

What I'm hoping to find is an article that would say, take me through the process of adding a new template to the system. Or even example code or something.

What files do I need to include? How do the templates and PHP files on the filesystem interact? What rules do I need to follow? Those sort of questions... The 'Hello World' of VBB mods for instance.

Is that out there somewhere?

Thanks,
Hunter

Reeve of shinra
09-21-2007, 11:11 PM
Your going to be doing a lot of poking around to get the basics down.

admincp - styles and templates - edit style
Edit your style and at the bottom is an option to add a template.
The template is added to that style and its children ONLY.

for example:

Parent Style One (I added a new template "x" here)
- Blue Style
- Red Style
- Green Style
(these inherit the properties of Parent Style One, including the new Template but we can change each style as needed, in this case to have a different color)

Parent Style Two
- Gray
- Orange
- Purple
(These styles didn't get template X because they don't roll up to Parent Style One)

The templates are stored in the database and the php files call them through an eval.

Here is a good tutorial for creating your own vb powered php page (ala hello world) which goes through the basics of creating a page that fully taps into the power of the vbulletin backend.... meaning you get to use your forums header, footer, templates, phrases, user info, etc.

[How-To] vBulletin API Basics: Creating Custom Pages & Misc. (https://vborg.vbsupport.ru/showthread.php?t=98009)

That is further expanded on here with many variables you will want to use.
[How-To] vBulletin API Basics: Variables, Functions, Objects (https://vborg.vbsupport.ru/showthread.php?t=98047)

Here are some others I bookmarked:
Adding the vbulletin editor into your mods (https://vborg.vbsupport.ru/showthread.php?t=135708)
Using the vbulletin database class (https://vborg.vbsupport.ru/showthread.php?t=119350)

There are more here:
https://vborg.vbsupport.ru/forumdisplay.php?f=218

Dismounted
09-22-2007, 04:50 AM
What rules do I need to follow?
If you indeed read through the whole manual, you would've found the "vBulletin Coding Standards".

hhillegas
09-23-2007, 05:30 AM
Reeve - thanks very much. I'm starting to realize that it seems much of this isn't documented as with other commercial environments. I appreciate steering me towards all of that stuff.

Dismounted- I did see those, yes. Great to have them, no doubt. They don't take the place of tutorials but of course coding standards are important.

It's nice for Jelsoft that this community exists but I'm honestly surprised there isn't more of the type of docs we were looking for around (or even better comments in the code). I know that when you've worked on a platform for long periods of time, things seem obvious and these questions may seem rudimentary. Anyway, I appreciate all who helped out.

Princeton
09-24-2007, 02:46 PM
not sure if it's what you are looking for...
Skinning: Understanding A Template-Based System (https://vborg.vbsupport.ru/showthread.php?t=124576)

it's directed towards programming newbies - but I thought what the heck