guildmaster/src_joomla_1.0/mod_guild/mod_guild.php

92 lines
3.5 KiB
PHP

<?php
// no direct access
defined( '_VALID_MOS' ) or die( 'Restricted access' );
require_once ($mosConfig_absolute_path .'/components/com_guildmaster/guild.guildmaster.class.php');
require_once ($mosConfig_absolute_path .'/components/com_guildmaster/guildmaster.parser.php');
require_once ($mosConfig_absolute_path .'/administrator/components/com_guildmaster/guildmaster.class.php');
global $mainframe;
global $database;
$config = new GuildMasterConf($database);
$config->load(1);
$error = array ();
if (!$config->guild_id) {
$error[] = "Guild ID not set.<br/>Please check configuration.";
error_msg($error);
return;
}
update_all($error, $config, $database, $force_update);
$guild = new GuildMasterGuild($database);
$guild->load($config->guild_id);
// temporary error handling
if (count($error)) {
error_msg($error);
return;
}
echo "<table width=\"100%\" border=\"0\">";
echo "<tr><th colspan=\"2\">Wall of fame</th></tr>";
if ($params->get('genstats')) {
echo '<tr><td>Guild name:</td><td><a href="http://eq2players.station.sony.com/guilds/guild_profile.vm?guildId='.$guild->guild_id.'">'.$guild->guild_name.'</a></td></tr>';
echo '<tr><td>Server:</td><td>'.$guild->server_name.'</td></tr>';
echo '<tr><td>Level:</td><td>'.$guild->level.'</td></tr>';
echo '<tr><td>Status:</td><td>'.$guild->points.'</td></tr>';
echo '<tr><td>Total characters:</td><td>'.$guild->members.'</td></tr>';
}
if ($params->get('extstats')) {
echo "<tr><td>Created:</td><td>".date("d M y", strtotime($guild->created))."</td></tr>";
echo "<tr><td>Kill vs. Death:</td><td>".$guild->kvd."</td></tr>";
echo "<tr><td>Items disc. Server:</td><td>".$guild->item_disc_server."</td></tr>";
echo "<tr><td>Items disc. World:</td><td>".$guild->item_disc_world."</td></tr>";
}
if ($params->get('leaders')) {
// echo "<tr><td>Most Item Discoveries (Server):</td><td>".((empty($guild->most_disc_server)) ? 'N/A' : $guild->most_disc_server)."</td></tr>";
// echo "<tr><td>Most Item Discoveries (World):</td><td>".((empty($guild->most_disc_world)) ? 'N/A' : $guild->most_disc_world)."</td></tr>";
// echo "<tr><td>Most killed NPCs:</td><td>".$guild->most_killed_npcs."</td></tr>";
// echo "<tr><td>Best Kill vs. Death ratio:</td><td>".$guild->best_kvd."</td></tr>";
// echo "<tr><td>Most quest completed:</td><td>".$guild->most_quests."</td></tr>";
echo "<tr><td>Highest Guild Status Contributor:</td><td>".$guild->most_points."</td></tr>";
// echo "<tr><td>Highest Melee Hit:</td><td>".$guild->most_points."</td></tr>";
// echo "<tr><td>Highest Magic Hit:</td><td>".$guild->most_points."</td></tr>";
}
/*
if ($params->get('current')) {
echo "<tr><td>Most Recent Member to Level:</td><td>".$guild->last_lvlup."</td></tr>";
echo "<tr><td>Most Recent Member to Die:</td><td>".$guild->last_die."</td></tr>";
echo "<tr><td>Most Recent Item discovered:</td><td>".$guild->most_recent_item."</td></tr>";
}
*/
if ($params->get('breakdown')) {
echo "<tr><td>Fighters:</td><td>".$guild->fighters."</td></tr>";
echo "<tr><td>Priests:</td><td>".$guild->priests."</td></tr>";
echo "<tr><td>Mages:</td><td>".$guild->mages."</td></tr>";
echo "<tr><td>Scouts:</td><td>".$guild->scouts."</td></tr>";
}
echo "</table>";
return;
// Function: error_message($message)
// What it does: Displays an error message
// Variables:
// $message - Error Message to display
function error_msg($message) {
echo "<div class=\"error\">Guild Master Error<p/>";
echo implode("<br/>", $message)."<p/>";
echo "If problem persists, check for latest updates on <a href=\"http://www.startux.de\">www.startux.de</a>";
echo "</div>";
return;
}
?>