roriscrave
Advanced OT User
- Joined
- Dec 7, 2011
- Messages
- 1,210
- Solutions
- 35
- Reaction score
- 206
$config['site']['vocation_descriptions'] = array(1 => 'Sorcerer Title', 2 => 'Druid Title', 3 => 'Paladin Title', 4 => 'Knight Title');
$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
foreach($config['site']['newchar_vocations'] as $char_vocation_key => $sample_char)
{
$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
if($newchar_vocation == $char_vocation_key)...
$config['site']['newchar_vocations'] = array(1 => 'Sorcerer Sample', 2 => 'Druid Sample', 3 => 'Paladin Sample', 4 => 'Knight Sample');
Yes, you are sure, but how i can add the "description"? like i said?I've never worked with Gesior AAC but I've looked through the sources on Github:
If I'm correct, the vocations that display there are taken from config:
PHP:$config['site']['newchar_vocations'] = array(1 => 'Sorcerer Sample', 2 => 'Druid Sample', 3 => 'Paladin Sample', 4 => 'Knight Sample');
Found here
$config['site']['newchar_vocations']
isn't used anywhere else but character creation.htmlspecialchars()
, so this is not possible without editing pages/accountmanagement.php
$main_content .= '>'.htmlspecialchars($vocation_name[$char_vocation_key]).'</td></tr>';
$main_content .= '>' . $vocation_name[$char_vocation_key] . '</td></tr>';
$config['site']['newchar_vocations'] = array(1 => 'Knight <span style="color: rgb(184, 49, 47)">(Tanker)</span>', 2 => 'Mage <span style="color: rgb(184, 49, 47)">(Tanker)</span>');
htmlspecialchars()
I just copied it as you submitted, but nothing changed.Well the thing is, you can't just add the description there as the element won't be styled.
From what I see, the variable$config['site']['newchar_vocations']
isn't used anywhere else but character creation.
Possibly the simpliest solution would be to edit the array and add some wrapping element.
However the echoing of that value from the config array is escaped via the functionhtmlspecialchars()
, so this is not possible without editingpages/accountmanagement.php
So, probably, the simpliest solution is:
In pages/accountmanagement.php line 673
Replace
withPHP:$main_content .= '>'.htmlspecialchars($vocation_name[$char_vocation_key]).'</td></tr>';
PHP:$main_content .= '>' . $vocation_name[$char_vocation_key] . '</td></tr>';
And in your config, update the config to e.g.:
Making sure you've got the HTML elements closed properly, as this could break your html if configured inproperly.PHP:$config['site']['newchar_vocations'] = array(1 => 'Knight <span style="color: rgb(184, 49, 47)">(Tanker)</span>', 2 => 'Mage <span style="color: rgb(184, 49, 47)">(Tanker)</span>');
So the config array contains an additional html element that now gets rendered thanks to removal of the PHP functionhtmlspecialchars()
$config['site']['vocation_descriptions'] = array(1 => 'Sorcerer Title', 2 => 'Druid Title', 3 => 'Paladin Title', 4 => 'Knight Title');
$main_content .= '<td><table class="TableContent" width="100%" ><tr class="Odd" valign="top"><td width="160"><br /><b>Select your vocation:</b></td><td><table class="TableContent" width="100%" >';
foreach($config['site']['newchar_vocations'] as $char_vocation_key => $sample_char)
{
$main_content .= '<tr><td><input type="radio" name="newcharvocation" value="'.$char_vocation_key.'" ';
if($newchar_vocation == $char_vocation_key)
$main_content .= 'checked="checked" ';
$main_content .= '>'.htmlspecialchars($vocation_name[$char_vocation_key]).'</td></tr>';
}
$main_content .= '</table></table></td>';
$main_content .= '>'.htmlspecialchars($vocation_name[$char_vocation_key]).'</td></tr>';
$main_content .= '>'.htmlspecialchars($vocation_name[$char_vocation_key]).' '.$config['site']['vocation_descriptions'][$char_vocation_key].'</td></tr>';
Sorcerer Sorcerer Title
Druid Druid Title
Paladin Paladin Title
Knight Knight Title
(<a style="color: red">Healer</a>)
should output (Healer)thx brO!!! u save me all timeInside config.php add this line: