Special thanks to Raugturi for his WoW block, which made it where I didn't have to do much to get ready for this new game. Class icons in a zip attached.
// SMF-TinyPortal Aion Recruitment Block - ver. 0.1
// Author: Cipher (zerocipher@gmail.com)
// Created: 05 August, 2009
// Last Update: 05 August, 2009
// Based off of the WoW recruitment block by Raugturi
// Code to display list of classes for Aion along with current
// recruitment status (Closed, Low, Medium and High).
// ******************
// * Config Section *
// ******************
// Recruitment Page: Path to Recruitment page
$recruitment_page = 'index.php?board=8.0';
// Image Directory: Path to icon folder
// Note: Must contain trailing '/'
$icon_dir = 'images/';
// Status Colors: Set the color for each status here.
$closed_color = '#6a8a99';
$low_color = '#418499';
$medium_color = '#8dd1d9';
$high_color = '#bcfbfb';
// Class Arrays
// Variables:
// Name - Type: Text, Value: Class name
// Status - Type: Integer, Value: 0=closed, 1=low, 2=medium, 3=high
// Icon - Type: Text, Value: Name of class icon image
$classlist = array(
array(
'name' => 'Assassin',
'status' => 1,
'icon' => 'assassin.png'),
array(
'name' => 'Chanter',
'status' => 2,
'icon' => 'chanter.png'),
array(
'name' => 'Cleric',
'status' => 1,
'icon' => 'cleric.png'),
array(
'name' => 'Gladiator',
'status' => 1,
'icon' => 'gladiator.png'),
array(
'name' => 'Ranger',
'status' => 3,
'icon' => 'ranger.png'),
array(
'name' => 'Sorcerer',
'status' => 2,
'icon' => 'sorcerer.png'),
array(
'name' => 'Spiritmaster',
'status' => 1,
'icon' => 'spiritmaster.png'),
array(
'name' => 'Templar',
'status' => 3,
'icon' => 'templar.png'),
);
//**********************
//* END Config Section *
//**********************
//*********************************
//* Do not edit below here unless *
//* you know what you are doing!! *
//*********************************
echo '
<table width="100%">';
foreach ($classlist as $class) {
switch ($class['status']) {
case 0:
$status = '<font color="' . $closed_color . '">Closed</font>';
break;
case 1:
$status = '<font color="' . $low_color . '">Low</font>';
break;
case 2:
$status = '<font color="' . $medium_color . '">Medium</font>';
break;
case 3:
$status = '<font color="' . $high_color . '">High</font>';
break;
}
echo '
<tr>
<td><img src="' . $icon_dir . $class['icon'] . '"> ' . $class['name'] . '</td>
<td align="right">' . $status . '</td>
</tr>';
}
echo '
<tr>
<td align="center" colspan=2>
<a href="' . $recruitment_page . '">Apply to Legion</a>
<hr />
<font size="-2">Must register to Apply</font>
</td>
</tr>
</table>
';
Fixed spelling error.
Thanks for sharing
very nice worked without any fuss
There is an error in spelling that will cause an error whent he block is produced in the image.
Quotearray(
'name' => 'Sorceror',
'status' => 2,
'icon' => 'sorceror.png'),
Should be:
Quotearray(
'name' => 'Sorcerer',
'status' => 2,
'icon' => 'sorcerer.png'),
sorry guys im very noob.,but the code where should put? in block panel? if yes with with type of code?
:idiot2:
Welcome to TP :)
This code can go in a PHP block or a PHP article, depending on where and how you want to use it.
Quote from: freddy888 on November 05, 2009, 05:08:41 PM
Welcome to TP :)
This code can go in a PHP block or a PHP article, depending on where and how you want to use it.
tk :) now work :D