Here are the changes needed to get a box added to the credits page for the addon developers.
1. Modify lib/menu.php
- Code: Select all
function makeAddonList()
{
global $roster_conf, $wordings;
to
- Code: Select all
function makeAddonList()
{
global $roster_conf, $wordings, $creditspage;
2. Modify credits.php
Add this code at the bottom of the file:
- Code: Select all
/**
* Gets the list of currently installed roster addons
*
* @return string formatted list of addons
*/
function makeAddonCredits()
{
global $roster_conf, $wordings, $creditspage;
$output = '';
if(isset($creditspage[$roster_conf['roster_lang']]['addons'])) {
foreach( array_keys($creditspage[$roster_conf['roster_lang']]['addons']) as $addonName )
{
$AddOnArray = $creditspage[$roster_conf['roster_lang']]['addons'][$addonName];
foreach( $AddOnArray as $addonDev )
{
$stripe_class = 'membersRow' . ( ( ++$strip_count % 2 ) + 1 );
$stripe_class_right = 'membersRowRight' . ( ( $strip_count % 2 ) + 1 );
$output .= "\t<tr>\n";
$output .= "\t\t<td class=\"$stripe_class\">" . $addonName . "</td>\n";
$output .= "\t\t<td class=\"$stripe_class\">" . $addonDev['name']."</td>\n";
$output .= "\t\t<td class=\"$stripe_class_right\">" . nl2br($addonDev['info']) . "</td>\n";
$output .= "\t</tr>\n";
$lCount += 1;
}
}
}
if ($lCount < 1)
{
return '';
}
return $output;
}
Next change:
- Code: Select all
echo "</table>\n".border('syellow','end');
// format table locations
echo "\n</td></tr></table>\n";
to
- Code: Select all
echo "</table>\n".border('syellow','end');
$AddonCredits = makeAddonCredits();
if($AddonCredits != '') {
// Print the Addon developer credits
echo "<br />\n" . border('sblue','start','WoWRoster Addon Developers') . "<table cellspacing=\"0\">\n";
echo $AddonCredits;
echo "</table>\n".border('sblue','end');
}
// format table locations
echo "\n</td></tr></table>\n";
3. Go to your addon localization file and add something like this:
- Code: Select all
$creditspage['enUS']['addons']['guildstats'] = array(
array( "name"=> "Nightfighter",
"info"=> "Original Addon developer"),
array( "name"=> "Aibon",
"info"=> "German Translator"),
);
change the addon name and the developers and their information and it will automatically get added into the credits when a user installs your addon.
Here is how it looks on my website: Credits Page
I believe that I got all of the places that I changed documented here, but if you have trouble, let me know and I will try to help correct the problems.