Forums

Go Back   Home > Articles > Blogs > Cham

Attention Visitor:

You have to register before you can post and reply to threads: click the register link above to join for free. To start viewing messages, select the forum that you want to visit from the selection below.

Home Submit Article What's New What's Popular Search

Adding Aion Character Names into your vBulletin Postbit

Old 09-24-2009 08:52 PM
Cham
 
Category: Cham
Views: 8,563
Replies: 0
This guide explains how to add Aion Character information into the Postbit on your vBulletin forum. You could use a similar hack for just about any modern day MMORPG that has a profile system in place.

We will be creating a Custom User Profile Field and inserting it into our vBulletin Template.


Creating the User Profile Fields

User Profile Fields are just variables that your forum's users can assign values to through their User Control Panel. Login to your vBulletin Admin panel and find and expand "User Profile Fields". Click "Add New User Profile Field".

For the Nova Forums, I chose to include just the Character Name and Class Name fields. To create the "Character Name" user profile field, select "Single-Line Text Box" and click "Continue".

Assign the following attributes to the User Profile Field:

Title: I chose "Aion Character Name".
Description: You generally want to include basic instructions for your Users. I opted for: "The name of your Aion Character".
Profile Field Category: Uncategorized. You may create a category if you wish.
Default Value: Leave Blank.
Max length of allowed user input: I left it at the default value of 100. You can shorten if you want.
Field Length: I left it at the default of 25.
Profile Field Type: Single-Line Text Box
Display Order: This is going to depend on how many profile fields you have already. Select what works best for you.
Field Required: No.
Field Editable by User: Yes
Private Field: No
Field Searchable on Members List: Yes
Show on Members List: I chose yes. But this is up to you.
Regular Expression: Leave Blank.

For the option of what page to display this option on, I chose "Edit Your Details".

Now click "Save"

Please note the "Name" of your new profile field. It should say "field#" where # is a number. For example, mine is "field9". This is the variable name of your new User Profile Field, you're going to need this for later.

Next we need to create the Aion Class User Profile Field. This is where your users will select their class from a drop-down style menu.

Create a new User Profile Field as outlined above, except we'll want it to be a "Single-Selection Menu". Assign the following attributes for your new User Profile Field.

Title: Aion Class
Description: Class of your Aion Character
Options: This is where we'll create our menu options. Use a line break between each option. Yours should look like this (for Aion anyways):

Templar
Gladiator
Ranger
Assassin
Sorcerer
Spiritmaster
Cleric
Chanter

Set Default: Yes, Including a First Blank Option. This will set it to a null value if the User does not fill this field in.

Leave all the other options to their default values.

Click "Save"

As above, note the name of the new field. You'll need this for later when we edit the Posbit Template and include our new values.


Editing Your Templates


Now the fun part: vBulletin's Template system is very flexible. If you know a little HTML and PHP, you can essentially do anything with it.

For this guide, we're going to Edit the Postbit Legacy template, because my particular forum uses it instead of the new Postbit Template. Editing the new Postbit Template would be very similar, the HTML where you insert the code might just be a bit different.

Go into your vBulletin Admin options and expand "Styles & Templates". Then click on "Style Manager". There will be a list of your current themes / templates that are available for your forum. Find the Style you wish to edit, and select "Edit Templates" from the drop-down menu. Double-Click and expand the Postbit Templates group.

Double-Click on Postbit Legacy, this will display the HTML / PHP that is used for this particular template. I like to copy and paste the code into a text editor for easier editing. Now I hope you wrote down those User Profile Field Names, as this is where we're going to use them.

Just above $template_hook[postbit_userinfo_right] we'll want to insert the following (Make sure to substitute my field names for yours):

Code:
<if condition="$post[field9]"><div>Character: <a href="http://na.aiononline.com/characters/Vaizel/$post[field9]">&nbsp;$post[field9]</a></div></if>
<if condition="$post[field10]"><div>Class:&nbsp;$post[field10]</div></if>
As you can see we can use the User Profile Field variables anywhere. In the above example I'm wrapping the character's name in anchor tags that link to the Aiononline.com profile. I'm using the Character Name profile field as the last value in the link which will take the visitor directly to the character's profile.

The "if statement" tells vBulletin to only display the field in the Postbit if it has a value. So if someone joins your forum and doesn't have an Aion character (or they haven't filled out the fields), the fields will not be displayed in the Postbit under their name.

If I were running a general Aion forum I'd probably create a User Profile Field for the character's server and substitute that Profile Field Name in for "Vaizel" in the above example. This would allow anyone from any server to include their character's name and profile in the postbit.
Tags: vbulletin mod




 
Category Jump

All times are GMT -5. The time now is 03:51 PM.


Site optimized for Mozilla Firefox 3.5
Powered by: vBadvanced Dynamics v1.2.0
Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
©2003 - 2009 Nova, All Rights Reserved