Пример #1
0
 function alt_name_hover()
 {
     global $roster;
     $alt_hover = '';
     if (active_addon('memberslist')) {
         $sql = "SELECT `main_id` FROM `" . $roster->db->table('alts', 'memberslist') . "` WHERE `member_id` = " . $roster->data['member_id'] . ";";
         $main_id = $roster->db->query_first($sql);
         if ($main_id != 0) {
             // we know the main, get alt info
             $sql = "SELECT `m`.`name`, `m`.`level`, `m`.`class`, `a`.* FROM `" . $roster->db->table('alts', 'memberslist') . "` AS a, `" . $roster->db->table('players') . "` AS m " . " WHERE `a`.`member_id` = `m`.`member_id` " . " AND `a`.`main_id` = {$main_id};";
             $qry = $roster->db->query($sql);
             $alts = $roster->db->fetch_all($qry, SQL_ASSOC);
             if (isset($alts[1])) {
                 $html = $caption = '';
                 foreach ($alts as $alt) {
                     if ($alt['main_id'] == $alt['member_id']) {
                         $caption = 'Alts of: <a href="' . makelink('char-info&amp;a=c:' . $alt['member_id']) . '">' . $alt['name'] . ' (' . $roster->locale->act['level'] . ' ' . $alt['level'] . ' ' . $alt['class'] . ')</a>';
                     } else {
                         $html .= '<a href="' . makelink('char-info&amp;a=c:' . $alt['member_id']) . '">' . $alt['name'] . ' (' . $roster->locale->act['level'] . ' ' . $alt['level'] . ' ' . $alt['class'] . ')</a><br />';
                     }
                 }
                 setTooltip('alt_html', $html);
                 setTooltip('alt_cap', $caption);
                 $alt_hover = ' style="cursor:pointer;" onmouseover="return overlib(overlib_alt_html,CAPTION,overlib_alt_cap);" ' . 'onclick="return overlib(overlib_alt_html,CAPTION,overlib_alt_cap,STICKY,OFFSETX,-10,OFFSETY,-10,NOCLOSE);" ' . 'onmouseout="return nd();"';
             }
         }
     }
     $roster->tpl->assign_var('ALT_TOOLTIP', $alt_hover);
 }
Пример #2
0
function getAV($user)
{
    global $roster;
    $user_is_active = active_addon('user');
    $siggen_is_active = active_addon('siggen');
    $av = null;
    if ($user_is_active == 1 && $siggen_is_active == 1) {
        $query = 'SELECT * FROM `' . $roster->db->table('user_members') . '` AS user ' . 'LEFT JOIN `' . $roster->db->table('profile', 'user') . '` AS profile ON `user`.`id` = `profile`.`uid` ' . 'WHERE `user`.`usr` = "' . $user . '" ';
        $result = $roster->db->query($query);
        $rw = $roster->db->fetch($result);
        if (!empty($rw['avatar'])) {
            $av = '<img src="' . urldecode($rw['avatar']) . '" ></a>';
        }
    }
    return $av;
}
Пример #3
0
# You should have received a copy of the Affero General Public License
# along with this program; if not, download it from http://www.affero.org/
// Multiple edits done for WoWRoster
if (!defined('IN_ROSTER')) {
    exit('Detected invalid access to this file!');
}
include ROSTER_LIB . 'item.php';
if (isset($_GET['mode'])) {
    $gbank_mode = $_GET['mode'] == 'inv' ? '2' : '1';
    $gbank_mode = $_GET['mode'] == 'full' ? '1' : '2';
} else {
    $gbank_mode = $addon['config']['guildbank_ver'];
}
$columns = $gbank_mode == '2' ? '15' : '2';
$roster->output['title'] = $roster->locale->act['guildbank'];
$roster->tpl->assign_vars(array('U_FULL' => makelink('&amp;mode=full'), 'U_INV' => makelink('&amp;mode=inv'), 'S_MONEY' => (bool) $addon['config']['bank_money'], 'S_INFO_ADDON' => active_addon('info'), 'S_COLUMNS' => $columns, 'S_MODE' => $gbank_mode, 'L_GUILDBANK' => $roster->locale->act['guildbank'], 'L_LIST' => $roster->locale->act['gbank_list'], 'L_INV' => $roster->locale->act['gbank_inv'], 'L_TOTAL_MONEY' => $roster->locale->act['guildbank_totalmoney'], 'L_LAST_UPDATED' => $roster->locale->act['lastupdate']));
$muleNameQuery = "SELECT m.member_id, m.name AS member_name, m.note AS member_note, m.officer_note AS member_officer_note, p.money_g AS gold, p.money_s AS silver, p.money_c AS copper, p.clientLocale, p.dateupdatedutc" . " FROM `" . $roster->db->table('players') . "` AS p, `" . $roster->db->table('members') . "`  AS m" . " WHERE m." . $addon['config']['banker_fieldname'] . " LIKE '%" . $addon['config']['banker_rankname'] . "%' AND p.member_id = m.member_id AND m.guild_id = " . $roster->data['guild_id'] . " ORDER BY m.name;";
$muleNames = $roster->db->query($muleNameQuery);
if ($addon['config']['bank_money']) {
    $mulemoney = $roster->db->fetch($roster->db->query("SELECT SUM( p.money_g ) AS gold, SUM( p.money_s ) AS silver, SUM( p.money_c ) AS copper" . " FROM `" . $roster->db->table('players') . "` AS p, `" . $roster->db->table('members') . "` AS m" . " WHERE m." . $addon['config']['banker_fieldname'] . " LIKE '%" . $addon['config']['banker_rankname'] . "%'" . " AND p.member_id = m.member_id AND m.guild_id = " . $roster->data['guild_id'] . " ORDER  BY m.name;"));
    $addsilver = 0;
    if ($mulemoney['copper'] >= 100) {
        $mulemoney['copper'] = $mulemoney['copper'] / 100;
        $addsilver = (int) $mulemoney['copper'];
        $mulemoney['copper'] = explode('.', $mulemoney['copper']);
        $mulemoney['copper'] = $mulemoney['copper'][1];
    }
    $mulemoney['silver'] = $mulemoney['silver'] + $addsilver;
    $addgold = 0;
    if ($mulemoney['silver'] >= 100) {
        $mulemoney['silver'] = $mulemoney['silver'] / 100;
Пример #4
0
/**
 * Addon installer/upgrader/uninstaller
 *
 */
function processAddon()
{
    global $roster, $installer;
    $addon_name = $_POST['addon'];
    if (preg_match('/[^a-zA-Z0-9_]/', $addon_name)) {
        $installer->seterrors($roster->locale->act['invalid_char_module'], $roster->locale->act['installer_error']);
        return;
    }
    // Check for temp tables
    //$old_error_die = $roster->db->error_die(false);
    if (false === $roster->db->query("CREATE TEMPORARY TABLE `test` (id int);")) {
        $installer->temp_tables = false;
        $roster->db->query("UPDATE `" . $roster->db->table('config') . "` SET `config_value` = '0' WHERE `id` = 1180;");
    } else {
        $installer->temp_tables = true;
    }
    //$roster->db->error_die($old_error_die);
    // Include addon install definitions
    $addonDir = ROSTER_ADDONS . $addon_name . DIR_SEP;
    $addon_install_file = $addonDir . 'inc' . DIR_SEP . 'install.def.php';
    $install_class = $addon_name . 'Install';
    if (!file_exists($addon_install_file)) {
        $installer->seterrors(sprintf($roster->locale->act['installer_no_installdef'], $addon_name), $roster->locale->act['installer_error']);
        return;
    }
    require $addon_install_file;
    $addon = new $install_class();
    $addata = escape_array((array) $addon);
    $addata['basename'] = $addon_name;
    if ($addata['basename'] == '') {
        $installer->seterrors($roster->locale->act['installer_no_empty'], $roster->locale->act['installer_error']);
        return;
    }
    // Get existing addon record if available
    $query = 'SELECT * FROM `' . $roster->db->table('addon') . '` WHERE `basename` = "' . $addata['basename'] . '";';
    $result = $roster->db->query($query);
    if (!$result) {
        $installer->seterrors(sprintf($roster->locale->act['installer_fetch_failed'], $addata['basename']) . '.<br />MySQL said: ' . $roster->db->error(), $roster->locale->act['installer_error']);
        return;
    }
    $previous = $roster->db->fetch($result);
    $roster->db->free_result($result);
    // Give the installer the addon data
    $installer->addata = $addata;
    $success = false;
    // Save current locale array
    // Since we add all locales for localization, we save the current locale array
    // This is in case one addon has the same locale strings as another, and keeps them from overwritting one another
    $localetemp = $roster->locale->wordings;
    foreach ($roster->multilanguages as $lang) {
        $roster->locale->add_locale_file(ROSTER_ADDONS . $addata['basename'] . DIR_SEP . 'locale' . DIR_SEP . $lang . '.php', $lang);
    }
    // Collect data for this install type
    switch ($_POST['type']) {
        case 'install':
            if ($previous) {
                $installer->seterrors(sprintf($roster->locale->act['installer_addon_exist'], $installer->addata['basename'], $previous['fullname']));
                break;
            }
            // check to see if any requred addons if so and not enabled disable addon after install and give a message
            if (isset($installer->addata['requires'])) {
                if (!active_addon($installer->addata['requires'])) {
                    $installer->addata['active'] = false;
                    $installer->setmessages('Addon Dependency "' . $installer->addata['requires'] . '" not active or installed, "' . $installer->addata['fullname'] . '" has been disabled');
                    break;
                }
            }
            $query = 'INSERT INTO `' . $roster->db->table('addon') . '` VALUES (NULL,"' . $installer->addata['basename'] . '","' . $installer->addata['version'] . '","' . (int) $installer->addata['active'] . '",0,"' . $installer->addata['fullname'] . '","' . $installer->addata['description'] . '","' . $roster->db->escape(serialize($installer->addata['credits'])) . '","' . $installer->addata['icon'] . '","' . $installer->addata['wrnet_id'] . '",NULL);';
            $result = $roster->db->query($query);
            if (!$result) {
                $installer->seterrors('DB error while creating new addon record. <br /> MySQL said:' . $roster->db->error(), $roster->locale->act['installer_error']);
                break;
            }
            $installer->addata['addon_id'] = $roster->db->insert_id();
            // We backup the addon config table to prevent damage
            $installer->add_backup($roster->db->table('addon_config'));
            $success = $addon->install();
            // Delete the addon record if there is an error
            if (!$success) {
                $query = 'DELETE FROM `' . $roster->db->table('addon') . "` WHERE `addon_id` = '" . $installer->addata['addon_id'] . "';";
                $result = $roster->db->query($query);
            } else {
                $installer->sql[] = 'UPDATE `' . $roster->db->table('addon') . '` SET `active` = ' . (int) $installer->addata['active'] . " WHERE `addon_id` = '" . $installer->addata['addon_id'] . "';";
                $installer->sql[] = "INSERT INTO `" . $roster->db->table('permissions') . "` VALUES ('', 'roster', '" . $installer->addata['addon_id'] . "', 'addon', '" . $installer->addata['fullname'] . "', 'addon_access_desc' , '" . $installer->addata['basename'] . "_access');";
            }
            break;
        case 'upgrade':
            if (!$previous) {
                $installer->seterrors(sprintf($roster->locale->act['installer_no_upgrade'], $installer->addata['basename']));
                break;
            }
            /* Carry Over from AP branch
            			if( !in_array($previous['basename'],$addon->upgrades) )
            			{
            				$installer->seterrors(sprintf($roster->locale->act['installer_not_upgradable'],$addon->fullname,$previous['fullname'],$previous['basename']));
            				break;
            			}
            			*/
            $query = "UPDATE `" . $roster->db->table('addon') . "` SET `basename`='" . $installer->addata['basename'] . "', `version`='" . $installer->addata['version'] . "', `active`=" . (int) $installer->addata['active'] . ", `fullname`='" . $installer->addata['fullname'] . "', `description`='" . $installer->addata['description'] . "', `credits`='" . serialize($installer->addata['credits']) . "', `icon`='" . $installer->addata['icon'] . "', `wrnet_id`='" . $installer->addata['wrnet_id'] . "' WHERE `addon_id`=" . $previous['addon_id'] . ';';
            $result = $roster->db->query($query);
            if (!$result) {
                $installer->seterrors('DB error while updating the addon record. <br /> MySQL said:' . $roster->db->error(), $roster->locale->act['installer_error']);
                break;
            }
            $installer->addata['addon_id'] = $previous['addon_id'];
            // We backup the addon config table to prevent damage
            $installer->add_backup($roster->db->table('addon_config'));
            $success = $addon->upgrade($previous['version']);
            break;
        case 'uninstall':
            if (!$previous) {
                $installer->seterrors(sprintf($roster->locale->act['installer_no_uninstall'], $installer->addata['basename']));
                break;
            }
            if ($previous['basename'] != $installer->addata['basename']) {
                $installer->seterrors(sprintf($roster->locale->act['installer_not_uninstallable'], $installer->addata['basename'], $previous['fullname']));
                break;
            }
            $query = 'DELETE FROM `' . $roster->db->table('addon') . '` WHERE `addon_id`=' . $previous['addon_id'] . ';';
            $result = $roster->db->query($query);
            if (!$result) {
                $installer->seterrors('DB error while deleting the addon record. <br /> MySQL said:' . $roster->db->error(), $roster->locale->act['installer_error']);
                break;
            }
            $installer->addata['addon_id'] = $previous['addon_id'];
            // We backup the addon config table to prevent damage
            $installer->add_backup($roster->db->table('addon_config'));
            $success = $addon->uninstall();
            if ($success) {
                $installer->remove_permissions($previous['addon_id']);
            }
            break;
        case 'purge':
            $success = purge($installer->addata['basename']);
            break;
        default:
            $installer->seterrors($roster->locale->act['installer_invalid_type']);
            $success = false;
            break;
    }
    if (!$success) {
        $installer->seterrors($roster->locale->act['installer_no_success_sql']);
        return false;
    } else {
        $success = $installer->install();
        $installer->setmessages(sprintf($roster->locale->act['installer_' . $_POST['type'] . '_' . $success], $installer->addata['basename']));
    }
    // Restore our locale array
    $roster->locale->wordings = $localetemp;
    unset($localetemp);
    return true;
}
Пример #5
0
 /**
  * Controls Output of the Talent Spec Column
  *
  * @param array $row - of character data
  * @return string - Formatted output
  */
 function spec_icon($row)
 {
     global $roster, $addon;
     $cell_value = '';
     // Don't proceed for characters without data
     if (!isset($row['talents']) || $row['talents'] == '') {
         return '<img class="membersRowimg" width="' . $addon['config']['icon_size'] . '" height="' . $addon['config']['icon_size'] . '" src="' . $roster->config['img_url'] . 'pixel.gif" alt="" />';
     }
     $lang = $row['clientLocale'];
     $talents = explode(',', $row['talents']);
     $spec = $specicon = '';
     $tooltip = array();
     $specpoint = 0;
     foreach ($talents as $talent) {
         list($name, $points, $icon) = explode('|', $talent);
         $tooltip[] = $points;
         if ($points > $specpoint) {
             $specpoint = $points;
             $spec = $name;
             $specicon = $icon;
         }
     }
     $tooltip = implode(' / ', $tooltip);
     $specicon = '<img class="membersRowimg" width="' . $addon['config']['icon_size'] . '" height="' . $addon['config']['icon_size'] . '" src="' . $roster->config['img_url'] . 'spec/' . $specicon . '.' . $roster->config['img_suffix'] . '" alt="" ' . makeOverlib($tooltip, $spec, '', 1, '', ',RIGHT,WRAP') . ' />';
     if (active_addon('info')) {
         $cell_value .= '<a href="' . makelink('char-info-talents&amp;a=c:' . $row['member_id']) . '">' . $specicon . '</a>';
     } else {
         $cell_value .= $specicon;
     }
     return $cell_value;
 }
Пример #6
0
         $resulta = $roster->db->query($querya);
         if ($resulta) {
             $row = $roster->db->fetch($resulta);
             $rank = $row['guild_rank'];
         } else {
             $rank = '';
         }
         $data = array('usr' => $_POST['username'], 'pass' => $pass, 'email' => $email, 'regIP' => $_SERVER['REMOTE_ADDR'], 'dt' => $roster->db->escape(gmdate('Y-m-d H:i:s')), 'access' => '0:' . $rank, 'active' => '1');
         $query = 'INSERT INTO `' . $roster->db->table('user_members') . '` ' . $roster->db->build_query('INSERT', $data);
         // user link table i was hoping to NOT use this....
         if ($roster->db->query($query)) {
             $uuid = $roster->db->insert_id();
             $roster->set_message('You are registered and can now login', 'User Register:', 'notice');
             $querya = "SELECT `name`,`guild_id`,`server`,`region`,`member_id` FROM `" . $roster->db->table('members') . "` WHERE `name` = '" . $_POST['username'] . "';";
             $resulta = $roster->db->query($querya);
             if (active_addon('user')) {
                 $a = "INSERT INTO `" . $roster->db->table('profile', 'user') . "` (`uid`, `signature`, `avatar`, `avsig_src`, `show_fname`, `show_lname`, `show_email`, `show_city`, `show_country`, `show_homepage`, `show_notes`, `show_joined`, `show_lastlogin`, `show_chars`, `show_guilds`, `show_realms`) VALUES ('{$uuid}', '', '', '', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0');";
                 $aa = $roster->db->query($a);
             }
             if (!$resulta) {
                 die_quietly($roster->db->error, 'user Profile', __FILE__, __LINE__, $querya);
             }
             echo $roster->auth->getLoginForm();
             return;
         } else {
             $roster->set_message('There was a DB error while creating your user.', '', 'error');
             $roster->set_message('<pre>' . $roster->db->error() . '</pre>', 'MySQL Said', 'error');
         }
     }
 } else {
     $roster->set_message($roster->locale->act['user_user']['msg31'], $roster->locale->act['user_page']['register'], 'error');
Пример #7
0
 * WoWRoster.net WoWRoster
 *
 * Lists quests for each character
 *
 *
 * @copyright  2002-2011 WoWRoster.net
 * @license    http://www.gnu.org/licenses/gpl.html   Licensed under the GNU General Public License v3.
 * @version    SVN: $Id$
 * @link       http://www.wowroster.net
 * @package    QuestList
*/
if (!defined('IN_ROSTER')) {
    exit('Detected invalid access to this file!');
}
$roster->output['title'] = $roster->locale->act['questlist'];
$roster->tpl->assign_vars(array('S_INFO_ADDON' => active_addon('info'), 'S_SHOW' => false, 'L_QUEST_LIST' => $roster->locale->act['questlist'], 'L_QUEST_LIST_HELP' => $roster->locale->act['questlist_help'], 'L_SEARCH_ZONE' => $roster->locale->act['search_by_zone'], 'L_SEARCH_QUEST' => $roster->locale->act['search_by_quest'], 'L_NAME' => $roster->locale->act['name'], 'L_QUEST_DATA' => $roster->locale->act['quest_data'], 'L_COMPLETE' => $roster->locale->act['complete'], 'L_FAILED' => $roster->locale->act['failed'], 'L_DAILY' => $roster->locale->act['daily']));
$zoneid = isset($_GET['zoneid']) ? $_GET['zoneid'] : '';
$questid = isset($_GET['questid']) ? $_GET['questid'] : '';
// The next two lines call the function selectQuery and use it to populate and return the code that lists the dropboxes for quests and for zones
selectQuery('`' . $roster->db->table('quests') . "` AS quests LEFT JOIN `" . $roster->db->table('quest_data') . "` AS quest_data ON `quests`.`quest_id` = `quest_data`.`quest_id` LEFT JOIN `" . $roster->db->table('players') . "` AS players ON `players`.`member_id` = `quests`.`member_id` WHERE `players`.`server` = '" . $roster->db->escape($roster->data['server']) . "' AND `quests`.`member_id` = `players`.`member_id`", 'DISTINCT `quest_data`.`zone`', 'zone', $zoneid, '&amp;zoneid');
selectQuery('`' . $roster->db->table('quests') . "` AS quests LEFT JOIN `" . $roster->db->table('quest_data') . "` AS quest_data ON `quests`.`quest_id` = `quest_data`.`quest_id` LEFT JOIN `" . $roster->db->table('players') . "` AS players ON `players`.`member_id` = `quests`.`member_id` WHERE `players`.`server` = '" . $roster->db->escape($roster->data['server']) . "' AND `quests`.`member_id` = `players`.`member_id`", 'DISTINCT `quest_data`.`quest_name`', 'quest_name', $questid, '&amp;questid');
if (!empty($zoneid)) {
    $sql = "SELECT DISTINCT `zone` FROM `" . $roster->db->table('quest_data') . "` WHERE `zone` = '{$zoneid}' ORDER BY `zone`;";
    $zone = $roster->db->query_first($sql) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $sql);
    // Set our questlink caption name
    setTooltip('questlink', $roster->locale->act['quest_links']);
    $roster->tpl->assign_vars(array('S_SHOW' => true, 'ZONE_NAME' => $zone));
    $qquery = "SELECT *" . " FROM `" . $roster->db->table('quest_data') . "`" . " WHERE `zone` = '" . $zoneid . "'" . " ORDER BY `quest_name`;";
    $qresult = $roster->db->query($qquery) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $qquery);
    while ($qrow = $roster->db->fetch($qresult)) {
        $query = "SELECT `q`.*, `p`.`name`, `p`.`server`, `p`.`member_id`, `p`.`level`" . " FROM `" . $roster->db->table('quests') . "` AS q, `" . $roster->db->table('players') . "` AS p" . " WHERE `p`.`server` = '" . $roster->db->escape($roster->data['server']) . "' AND `q`.`quest_id` = '" . $qrow['quest_id'] . "' AND `q`.`member_id` = `p`.`member_id`" . " ORDER BY `p`.`level` DESC, `p`.`name` ASC;";
Пример #8
0
/**
 * Make select box of characters for main selection
 */
function selectGen($uid)
{
    global $roster, $addon, $user, $uid;
    $query = "SELECT `avsig_src` FROM `" . $roster->db->table('profile', 'user') . "` WHERE `uid` = " . $uid . ";";
    $result = $roster->db->query($query);
    if (!$result) {
        die_quietly($roster->db->error, 'user Profile', __FILE__, __LINE__, $query);
    }
    $src = '';
    while ($row = $roster->db->fetch($result)) {
        $src = $row['avsig_src'];
    }
    $input_field = '<select name="select:avsig_src">' . "\n";
    $sigGen = active_addon('siggen');
    if ($sigGen == 1 && $src == 'SigGen') {
        $input_field .= '  <option value="SigGen" selected="selected">SigGen</option>' . "\n";
        $input_field .= '  <option value="default">Default</option>' . "\n";
    } elseif ($sigGen == 1 && $src == 'default' || $src == '') {
        $input_field .= '  <option value="default" selected="selected">Default</option>' . "\n";
        $input_field .= '  <option value="SigGen">SigGen</option>' . "\n";
    } else {
        $input_field .= '  <option value="default" selected="selected">Default</option>' . "\n";
    }
    $input_field .= '</select>';
    return $input_field;
}
Пример #9
0
 * Completely rewritten by vgjunkie 2006-09-14
 *
 * LICENSE: Licensed under the Creative Commons
 *          "Attribution-NonCommercial-ShareAlike 2.5" license
 *
 * @copyright  2002-2008 WoWRoster.net
 * @license    http://creativecommons.org/licenses/by-nc-sa/2.5   Creative Commons "Attribution-NonCommercial-ShareAlike 2.5"
 * @version    SVN: $Id: index.php 1791 2008-06-15 16:59:24Z Zanix $
 * @link       http://www.wowroster.net
 * @package    Professions
*/
if (!defined('IN_ROSTER')) {
    exit('Detected invalid access to this file!');
}
$roster->output['title'] = $roster->locale->act['professions'];
$roster->tpl->assign_vars(array('S_HIDE' => $addon['config']['collapse_list'], 'S_INFO_ADDON' => active_addon('info'), 'L_PROFESSIONS' => $roster->locale->act['professions'], 'L_LEVEL' => $roster->locale->act['level'], 'L_NAME' => $roster->locale->act['name']));
// Build a list of "Skills" to look for
$inClause = "'";
foreach ($roster->multilanguages as $lang) {
    $inClause .= implode("', '", $roster->locale->wordings[$lang]['tsArray']);
    $inClause .= "', '";
}
$inClause .= "'";
// If we don't want to show skills with a "1" value, uncomment this line (make option in config?)
$showNewSkill = $addon['config']['show_new_skills'] ? " AND SUBSTRING_INDEX(`s`.`skill_level`, ':', 1 ) > 1 " : '';
// Gather a list of players that have the skills we are looking for
$query = "SELECT `s`.*, `p`.`name`, `p`.`clientLocale`, `p`.`member_id` FROM `" . $roster->db->table('skills') . "` AS s, `" . $roster->db->table('players') . "` AS p" . " WHERE `p`.`member_id` = `s`.`member_id`" . " AND `p`.`guild_id` = '" . $roster->data['guild_id'] . "'" . $showNewSkill . " AND `skill_name` IN ({$inClause})" . " ORDER BY `s`.`skill_type`, `s`.`skill_name`,(mid(`skill_level` FROM 1 FOR (locate(':', `skill_level`)-1)) + 0) DESC, `p`.`name`;";
$result = $roster->db->query($query) or die_quietly($roster->db->error(), 'Database Error', __FILE__, __LINE__, $query);
if ($roster->db->num_rows($result)) {
    while ($row = $roster->db->fetch($result)) {
        $skill_name = $row['skill_name'];
Пример #10
0
 /**
  * Controls Output of the Tradeskill Icons Column
  *
  * @param array $row - of character data
  * @return string - Formatted output
  */
 function tradeskill_icons($row)
 {
     global $roster;
     //$addon = getaddon('memberslist');
     $cell_value = '';
     // Don't proceed for characters without data
     if ($row['clientLocale'] == '') {
         return '<div>&nbsp;</div>';
     }
     $lang = $row['clientLocale'];
     $profs = explode(',', $row['professions']);
     foreach ($profs as $prof) {
         $r_prof = explode('|', $prof);
         $toolTip = isset($r_prof[1]) ? str_replace(':', '/', $r_prof[1]) : '';
         $toolTiph = $r_prof[0];
         if ($r_prof[0] == $roster->locale->wordings[$lang]['riding']) {
             if ($row['class'] == $roster->locale->wordings[$lang]['Paladin'] || $row['class'] == $roster->locale->wordings[$lang]['Warlock']) {
                 $icon = $roster->locale->wordings[$lang]['ts_ridingIcon'][$row['class']];
             } else {
                 $icon = $roster->locale->wordings[$lang]['ts_ridingIcon'][$row['race']];
             }
         } else {
             $icon = isset($roster->locale->wordings[$lang]['ts_iconArray'][$r_prof[0]]) ? $roster->locale->wordings[$lang]['ts_iconArray'][$r_prof[0]] : '';
         }
         // Don't add professions we don't have an icon for. This keeps other skills out.
         if ($icon != '') {
             $icon = '<img class="membersRowimg" width="20" height="20" src="' . $roster->config['interface_url'] . 'Interface/Icons/' . $icon . '.' . $roster->config['img_suffix'] . '" alt="" ' . makeOverlib($toolTip, $toolTiph, '', 2, '', ',RIGHT,WRAP') . ' />';
             if (active_addon('info')) {
                 $cell_value .= '<a href="' . makelink('char-info-recipes&amp;a=c:' . $row['member_id'] . '#' . strtolower(str_replace(' ', '', $r_prof[0]))) . '">' . $icon . '</a>';
             } else {
                 $cell_value .= $icon;
             }
         }
     }
     return $cell_value;
 }
Пример #11
0
    }
}
if ($stage == 1) {
    $roster->tpl->assign_vars(array('STAGE' => $stage, 'TEXT' => 'stage 1'));
    $js = "\n\t\n\t\t\n\t";
    roster_add_js($js, 'inline', 'header', false, false);
}
if ($stage == 3) {
    $roster->tpl->assign_vars(array('STAGE' => $stage, 'TEXT' => 'Select the character to be your main char'));
    $query = "SELECT * FROM `" . $roster->db->table('user_link', 'user') . "` WHERE `uid` = '" . $roster->auth->user['id'] . "';";
    $result = $roster->db->query($query);
    if (!$result) {
        die_quietly($roster->db->error, 'claim alt', __FILE__, __LINE__, $query);
    }
    while ($row = $roster->db->fetch($result)) {
        $roster->tpl->assign_block_vars('chars', array('THUMB' => 'http://us.battle.net/static-render/us/' . $row['thumbnail'], 'NAME' => $row['name'], 'ID' => $row['link_id'], 'LEVEL' => $row['level'], 'RACE' => $row['race'], 'GENDER' => $row['gender'], 'SERVER' => $row['realm'], 'GUILD' => $row['guild'], 'IS_MAIN' => (bool) $row['is_main'], 'CLASS' => $roster->locale->act['id_to_class'][$row['class']], 'PROFILE' => active_addon('info') && $row['server'] && $row['member_id'] != 0 ? makelink('char-info&amp;a=c:' . $row['member_id']) : ''));
    }
}
$roster->tpl->set_filenames(array('alt' => $addon['basename'] . '/alt.html'));
$roster->tpl->display('alt');
function getcharid($name, $server)
{
    global $roster, $addon;
    $mid = array();
    $sql = 'SELECT `member_id`,`name`,`server`,`guild_id` FROM `' . $roster->db->table('members') . '` WHERE `name` = "' . $name . '" AND `server` = "' . $server . '"';
    $query = $roster->db->query($sql);
    while ($row = $roster->db->fetch($query)) {
        $mid = array('member_id' => $row['member_id'], 'name' => $row['name'], 'server' => $row['server'], 'guild_id' => $row['guild_id']);
    }
    return $mid;
}
Пример #12
0
 /**
  * Controls Output of the Talent Spec Column
  *
  * @param array $row - of character data
  * @return string - Formatted output
  */
 function spec_icon($row)
 {
     global $roster;
     $cell_value = '';
     // Don't proceed for characters without data
     if (!isset($row['talents']) || $row['talents'] == '') {
         return '<img class="middle" width="24" height="24" src="' . $roster->config['img_url'] . 'pixel.gif" alt="" />';
     }
     $talents = explode(',', $row['talents']);
     $talent2 = explode(',', $row['talents2']);
     $_d = array();
     foreach ($talent2 as $tal) {
         list($name, $role, $icon) = explode('|', $tal);
         $_d[$name]['role'] = $role;
         $_d[$name]['name'] = $name;
         $_d[$name]['icon'] = $icon;
     }
     $_t = array();
     $specicon = '';
     $notalent = true;
     foreach ($talents as $talent) {
         list($_s, $name, $points, $icon, $_b) = explode('|', $talent);
         $_t[$_b]['tip'][] = $name . ' - ' . $points;
         if (!isset($_t[$_b]['point']) || $points > $_t[$_b]['point']) {
             $_t[$_b]['point'] = $points;
             $_t[$_b]['name'] = $name;
             $_t[$_b]['icon'] = strtolower($_d[$name]['icon']);
             $notalent = false;
         }
     }
     if (!$notalent) {
         $tooltip = $icon = '';
         foreach ($_t as $idx => $build) {
             $icon = '<span class="item-sm"><img src="' . $roster->config['interface_url'] . 'Interface/Icons/' . $build['icon'] . '.' . $roster->config['img_suffix'] . '" alt="" /><span class="mask"></span></span> ';
             $tooltip .= $icon . implode(' / ', $build['tip']) . '<br />';
         }
         $tooltip = '<div style="font-size:12px;font-weight:bold;">' . $tooltip . '</div>';
         $specicon = '<div class="item-sm" ' . makeOverlib($tooltip, $_t[1]['name'], '', 2, '', ',WRAP') . '><img src="' . $roster->config['interface_url'] . 'Interface/Icons/' . $_t[1]['icon'] . '.' . $roster->config['img_suffix'] . '" alt="" /><div class="mask"></div></div>';
     }
     if (active_addon('info')) {
         $cell_value .= '<a href="' . makelink('char-info&amp;a=c:' . $row['member_id'] . '&amp;t=talents') . '">' . $specicon . '</a>';
     } else {
         $cell_value .= $specicon;
     }
     return $cell_value;
 }
Пример #13
0
 function charsPage()
 {
     global $roster, $addon, $user;
     // Disallow viewing of the page
     if (!$roster->auth->allow_login) {
         print '<span class="title_text">' . $roster->locale->act['user_page']['chars'] . '</span><br />' . $roster->auth->getMessage() . $roster->auth->getLoginForm();
     } else {
         $query = "SELECT * FROM `" . $roster->db->table('user_link', 'user') . "` WHERE `uid` = '" . $roster->auth->user['id'] . "';";
         $result = $roster->db->query($query);
         if (!$result) {
             die_quietly($roster->db->error, 'claim alt', __FILE__, __LINE__, $query);
         }
         while ($row = $roster->db->fetch($result)) {
             $roster->tpl->assign_block_vars('chars', array('THUMB' => 'http://us.battle.net/static-render/us/' . $row['thumbnail'], 'NAME' => $row['name'], 'LEVEL' => $row['level'], 'RACE' => $row['race'], 'GENDER' => $row['gender'], 'SERVER' => $row['realm'], 'GUILD' => $row['guild'], 'IS_MAIN' => (bool) $row['is_main'], 'CLASS' => $roster->locale->act['id_to_class'][$row['class']], 'PROFILE' => active_addon('info') && $row['realm'] && $row['member_id'] != 0 ? makelink('char-info&amp;a=c:' . $row['member_id']) : ''));
         }
         $roster->tpl->set_filenames(array('user_chars' => $addon['basename'] . '/chars.html'));
         $roster->tpl->display('user_chars');
     }
 }
Пример #14
0
function processPlugin()
{
    global $roster, $installer;
    $addon_name = $_POST['addon'];
    $addon_parent = $_POST['addonparent'];
    $addon_file = $_POST['addonfile'];
    if (preg_match('/[^a-zA-Z0-9_]/', $addon_name)) {
        $installer->seterrors($roster->locale->act['invalid_char_module'], $roster->locale->act['installer_error']);
        return;
    }
    if (false === $roster->db->query("CREATE TEMPORARY TABLE `test` (id int);")) {
        $installer->temp_tables = false;
        $roster->db->query("UPDATE `" . $roster->db->table('config') . "` SET `config_value` = '0' WHERE `id` = 1180;");
    } else {
        $installer->temp_tables = true;
    }
    $addonDir = ROSTER_PLUGINS . $addon_name . DIR_SEP;
    $addon_install_file = $addonDir . 'install.def.php';
    $install_class = $addon_name . 'Install';
    if (!file_exists($addon_install_file)) {
        $installer->seterrors(sprintf($roster->locale->act['installer_no_installdef'], $addon_name), $roster->locale->act['installer_error']);
        return;
    }
    require $addon_install_file;
    $addon = new $install_class();
    $addata = escape_array((array) $addon);
    $addata['basename'] = $addon_name;
    if ($addata['basename'] == '') {
        $installer->seterrors($roster->locale->act['installer_no_empty'], $roster->locale->act['installer_error']);
        return;
    }
    // Get existing addon record if available
    $query = 'SELECT * FROM `' . $roster->db->table('plugin') . '` WHERE `basename` = "' . $addata['basename'] . '";';
    $result = $roster->db->query($query);
    if (!$result) {
        $installer->seterrors(sprintf($roster->locale->act['installer_fetch_failed'], $addata['basename']) . '.<br />MySQL said: ' . $roster->db->error(), $roster->locale->act['installer_error']);
        return;
    }
    $previous = $roster->db->fetch($result);
    $roster->db->free_result($result);
    // Give the installer the addon data
    $installer->addata = $addata;
    $success = false;
    // Collect data for this install type
    switch ($_POST['type']) {
        case 'install':
            if ($previous) {
                $installer->seterrors(sprintf($roster->locale->act['installer_addon_exist'], $installer->addata['basename'], $previous['fullname']));
                break;
            }
            // check to see if any requred addons if so and not enabled disable addon after install and give a message
            if (isset($installer->addata['requires'])) {
                if (!active_addon($installer->addata['requires'])) {
                    $installer->addata['active'] = false;
                    $installer->setmessages('Addon Dependency "' . $installer->addata['requires'] . '" not active or installed, "' . $installer->addata['fullname'] . '" has been disabled');
                    break;
                }
            }
            $query = 'INSERT INTO `' . $roster->db->table('plugin') . '` VALUES 
				(NULL,"' . $installer->addata['basename'] . '",
				"' . $installer->addata['parent'] . '",
				"' . $installer->addata['scope'] . '",
				"' . $installer->addata['version'] . '",
				"' . (int) $installer->addata['active'] . '",
				0,
				"' . $installer->addata['fullname'] . '",
				"' . $installer->addata['description'] . '",
				"' . $roster->db->escape(serialize($installer->addata['credits'])) . '",
				"' . $installer->addata['icon'] . '",
				"' . $installer->addata['wrnet_id'] . '",NULL);';
            $result = $roster->db->query($query);
            if (!$result) {
                $installer->seterrors('DB error while creating new addon record. <br /> MySQL said:' . $roster->db->error(), $roster->locale->act['installer_error']);
                break;
            }
            $installer->addata['addon_id'] = $roster->db->insert_id();
            // We backup the addon config table to prevent damage
            $installer->add_backup($roster->db->table('plugin_config'));
            $success = $addon->install();
            // Delete the addon record if there is an error
            if (!$success) {
                $query = 'DELETE FROM `' . $roster->db->table('plugin') . "` WHERE `addon_id` = '" . $installer->addata['addon_id'] . "';";
                $result = $roster->db->query($query);
            } else {
                $installer->sql[] = 'UPDATE `' . $roster->db->table('plugin') . '` SET `active` = ' . (int) $installer->addata['active'] . " WHERE `addon_id` = '" . $installer->addata['addon_id'] . "';";
            }
            break;
        case 'upgrade':
            if (!$previous) {
                $installer->seterrors(sprintf($roster->locale->act['installer_no_upgrade'], $installer->addata['basename']));
                break;
            }
            $query = "UPDATE `" . $roster->db->table('plugin') . "` SET `basename`='" . $installer->addata['basename'] . "', `version`='" . $installer->addata['version'] . "', `active`=" . (int) $installer->addata['active'] . ", `fullname`='" . $installer->addata['fullname'] . "', `description`='" . $installer->addata['description'] . "', `credits`='" . serialize($installer->addata['credits']) . "', `icon`='" . $installer->addata['icon'] . "', `wrnet_id`='" . $installer->addata['wrnet_id'] . "' WHERE `addon_id`=" . $previous['addon_id'] . ';';
            $result = $roster->db->query($query);
            if (!$result) {
                $installer->seterrors('DB error while updating the addon record. <br /> MySQL said:' . $roster->db->error(), $roster->locale->act['installer_error']);
                break;
            }
            $installer->addata['addon_id'] = $previous['addon_id'];
            // We backup the addon config table to prevent damage
            $installer->add_backup($roster->db->table('plugin_config'));
            $success = $addon->upgrade($previous['version']);
            break;
        case 'uninstall':
            if (!$previous) {
                $installer->seterrors(sprintf($roster->locale->act['installer_no_uninstall'], $installer->addata['basename']));
                break;
            }
            if ($previous['basename'] != $installer->addata['basename']) {
                $installer->seterrors(sprintf($roster->locale->act['installer_not_uninstallable'], $installer->addata['basename'], $previous['fullname']));
                break;
            }
            $query = 'DELETE FROM `' . $roster->db->table('plugin') . '` WHERE `addon_id`=' . $previous['addon_id'] . ';';
            $result = $roster->db->query($query);
            if (!$result) {
                $installer->seterrors('DB error while deleting the addon record. <br /> MySQL said:' . $roster->db->error(), $roster->locale->act['installer_error']);
                break;
            }
            $installer->addata['addon_id'] = $previous['addon_id'];
            // We backup the addon config table to prevent damage
            $installer->add_backup($roster->db->table('plugin_config'));
            $success = $addon->uninstall();
            break;
        case 'purge':
            $success = purge($installer->addata['basename']);
            break;
        default:
            $installer->seterrors($roster->locale->act['installer_invalid_type']);
            $success = false;
            break;
    }
    if (!$success) {
        $installer->seterrors($roster->locale->act['installer_no_success_sql']);
        return false;
    } else {
        $success = $installer->install();
        $installer->setmessages(sprintf($roster->locale->act['installer_' . $_POST['type'] . '_' . $success], $installer->addata['basename']));
    }
    unset($addon);
    // Restore our locale array
    return true;
}
Пример #15
0
 function setAvSig($id = '', $mid, $src = '')
 {
     global $roster, $addon, $user;
     //echo $id.' - '.$mid.'<br>';
     if (!is_null($id) || $id > 0) {
         $uid = $id;
     } else {
         $uid = $user->session->getVal('uid');
     }
     $user = $user->user->getUser($uid);
     if ($mid > 0 && $mid != '') {
         $sql = 'SELECT `name` FROM `' . $roster->db->table('members') . '` WHERE `member_id` = ' . $mid;
         $query = $roster->db->query($sql);
         while ($row = $roster->db->fetch($query)) {
             $char = $row['name'];
         }
     } elseif ($mid != '') {
         $char = $mid;
     }
     $hasMain = $this->getMain($uid);
     if (is_null($src)) {
         $this->getConfigData($uid);
         $src = $this->configData['avsig_src'];
     }
     $is_active = active_addon('siggen');
     $c = array('signature', 'avatar');
     foreach ($c as $case) {
         if ($hasMain == false) {
             die_quietly("You do not have a main character set. Please set your main character and try again.");
         } else {
             if ($is_active == 1 && $src == 'SigGen') {
                 $sql = 'SELECT `region`, `realm` FROM `' . $roster->db->table('user_link', 'user') . '` WHERE `uid` = ' . $uid . ' AND `member_id` = ' . $mid;
                 $query = $roster->db->query($sql);
                 while ($row = $roster->db->fetch($query)) {
                     $link = makelink('util-siggen-' . $case . '&amp;member=' . $char . '@' . $row['region'] . '-' . $row['realm'], 'url');
                 }
             } elseif ($is_active == 0 && $src == 'SigGen') {
                 die_quietly("SigGen is not installed! Please install SigGen and try again.<br />");
             } elseif ($src == 'default') {
                 $sql = 'SELECT `race`, `sex` FROM `' . $roster->db->table('players') . '` WHERE `member_id` = ' . $mid;
                 $query = $roster->db->query($sql);
                 while ($row = $roster->db->fetch($query)) {
                     $link = $addon['image_url'] . str_replace(' ', '', $row['race']) . '-' . $row['sex'] . '.png';
                 }
             }
         }
         switch ($case) {
             case 'signature':
                 $sql = 'UPDATE `' . $roster->db->table('profile', 'user') . '` SET `signature` = "' . urlencode($link) . '" WHERE `uid` = ' . $uid;
                 $roster->db->query($sql);
                 break;
             case 'avatar':
                 $sql = 'UPDATE `' . $roster->db->table('profile', 'user') . '` SET `avatar` = "' . urlencode($link) . '" WHERE `uid` = ' . $uid;
                 $roster->db->query($sql);
                 break;
             default:
                 $sql = 'UPDATE `' . $roster->db->table('profile', 'user') . '` SET `avatar` = "' . urlencode($link) . '" WHERE `uid` = ' . $uid;
                 $roster->db->query($sql);
                 break;
         }
     }
     //echo 'i worked<br>';
     return true;
 }
Пример #16
0
$FIELD['level'] = array('lang_field' => 'level', 'filt_field' => '`members`.`level`', 'order_d' => array('`members`.`level` DESC'), 'order_d' => array('`members`.`level` ASC'), 'value' => array($memberlist, 'level_value'), 'display' => $addon['config']['honor_level']);
$FIELD['sessionHK'] = array('lang_field' => 'todayhk', 'order' => array('`players`.`sessionHK` DESC'), 'order_d' => array('`players`.`sessionHK` ASC'), 'display' => $addon['config']['honor_thk']);
$FIELD['sessionCP'] = array('lang_field' => 'todaycp', 'order' => array('`players`.`sessionCP` DESC'), 'order_d' => array('`players`.`sessionCP` ASC'), 'display' => $addon['config']['honor_tcp']);
$FIELD['yesterdayHK'] = array('lang_field' => 'yesthk', 'order' => array('`players`.`yesterdayHK` DESC'), 'order_d' => array('`players`.`yesterdayHK` ASC'), 'display' => $addon['config']['honor_yhk']);
$FIELD['yesterdayContribution'] = array('lang_field' => 'yestcp', 'order' => array('`players`.`yesterdayContribution` DESC'), 'order_d' => array('`players`.`yesterdayContribution` ASC'), 'display' => $addon['config']['honor_ycp']);
$FIELD['lifetimeHK'] = array('lang_field' => 'lifehk', 'order' => array('`players`.`lifetimeHK` DESC'), 'order_d' => array('`players`.`lifetimeHK` ASC'), 'display' => $addon['config']['honor_lifehk']);
$FIELD['lifetimeRankName'] = array('lang_field' => 'highestrank', 'order' => array('risnull', '`players`.`lifetimeHighestRank` DESC'), 'order_d' => array('risnull', '`players`.`lifetimeHighestRank` ASC'), 'value' => array($memberlist, 'honor_value'), 'display' => $addon['config']['honor_hrank']);
$FIELD['honorpoints'] = array('lang_field' => 'honorpoints', 'order' => array('`players`.`honorpoints` DESC'), 'order_d' => array('`players`.`honorpoints` ASC'), 'display' => $addon['config']['honor_hp']);
$FIELD['arenapoints'] = array('lang_field' => 'arenapoints', 'order' => array('`players`.`arenapoints` DESC'), 'order_d' => array('`players`.`arenapoints` ASC'), 'display' => $addon['config']['honor_ap']);
$memberlist->prepareData($mainQuery, $where, $group, $order_first, $order_last, $FIELD, 'memberslist');
// Start output
if ($addon['config']['honor_motd'] == 1) {
    echo $memberlist->makeMotd();
}
if ($addon['config']['honor_hslist'] == 1 || $addon['config']['honor_pvplist'] == 1) {
    echo "<table style=\"width:100%\">\n  <tr>\n";
    if ($addon['config']['honor_hslist'] == 1) {
        echo '    <td valign="top">';
        include_once ROSTER_LIB . 'hslist.php';
        echo generateHsList();
        echo "    </td>\n";
    }
    if (active_addon('pvplog') && $addon['config']['honor_pvplist'] == 1) {
        echo '    <td valign="top">';
        include_once ROSTER_ADDONS . 'pvplog' . DIR_SEP . 'inc' . DIR_SEP . 'pvplist.php';
        echo generatePvpList();
        echo "    </td>\n";
    }
    echo "  </tr>\n</table>\n";
}
echo $memberlist->makeMembersList('syellow');
Пример #17
0
<?php

/**
 * WoWRoster.net WoWRoster
 *
 *
 * @copyright  2002-2011 WoWRoster.net
 * @license    http://www.gnu.org/licenses/gpl.html   Licensed under the GNU General Public License v3.
 * @version    SVN: $Id$
 * @link       http://www.wowroster.net
 * @package    IntanceKeys
 */
if (!defined('IN_ROSTER')) {
    exit('Detected invalid access to this file!');
}
if (!active_addon('memberslist')) {
    // Memberslist not installed. Just die for now.
    roster_die("You will need to install memberslist to use the keys addon display component");
}
$memberslist_addon = getaddon('memberslist');
// Include addon's locale files if they exist
foreach ($roster->multilanguages as $lang) {
    $roster->locale->add_locale_file($memberslist_addon['locale_dir'] . $lang . '.php', $lang);
}
// Apply memberslist style
roster_add_css($memberslist_addon['tpl_css_url'], 'theme');
include_once $memberslist_addon['inc_dir'] . 'memberslist.php';
include_once ROSTER_LIB . 'item.php';
$memberlist = new memberslist(array(), $memberslist_addon);
// First define static data
$mainSelect = 'SELECT ' . '`members`.`member_id`, ' . '`members`.`name`, ' . '`members`.`class`, ' . '`members`.`level`, ' . '`members`.`zone`, ' . '`members`.`online`, ' . '`members`.`last_online`, ' . "UNIX_TIMESTAMP(`members`.`last_online`) AS 'last_online_stamp', " . "DATE_FORMAT(  DATE_ADD(`members`.`last_online`, INTERVAL " . $roster->config['localtimeoffset'] . " HOUR ), '" . $roster->locale->act['timeformat'] . "' ) AS 'last_online_format', " . '`members`.`note`, ' . '`members`.`guild_title`, ' . '`alts`.`main_id`, ' . '`guild`.`update_time`, ' . "IF( `members`.`note` IS NULL OR `members`.`note` = '', 1, 0 ) AS 'nisnull', " . '`members`.`officer_note`, ' . "IF( `members`.`officer_note` IS NULL OR `members`.`officer_note` = '', 1, 0 ) AS 'onisnull', " . '`members`.`guild_rank`, ' . '`players`.`server`, ' . '`players`.`race`, ' . '`players`.`sex`, ' . '`players`.`exp`, ' . '`players`.`clientLocale`, ' . '`players`.`lifetimeRankName`, ' . '`players`.`lifetimeHighestRank`, ' . "IF( `players`.`lifetimeHighestRank` IS NULL OR `players`.`lifetimeHighestRank` = '0', 1, 0 ) AS 'risnull', " . '`players`.`hearth`, ' . "IF( `players`.`hearth` IS NULL OR `players`.`hearth` = '', 1, 0 ) AS 'hisnull', " . "UNIX_TIMESTAMP( `players`.`dateupdatedutc`) AS 'last_update_stamp', " . "DATE_FORMAT(  DATE_ADD(`players`.`dateupdatedutc`, INTERVAL " . $roster->config['localtimeoffset'] . " HOUR ), '" . $roster->locale->act['timeformat'] . "' ) AS 'last_update_format', " . "IF( `players`.`dateupdatedutc` IS NULL OR `players`.`dateupdatedutc` = '', 1, 0 ) AS 'luisnull', ";
Пример #18
0
/**
 * Controls Output of the Tradeskill Icons Column
 *
 * @param array $row - of character data
 * @return string - Formatted output
 */
function tradeskill_icons($row)
{
    global $roster, $addon;
    $cell_value = '';
    // Don't proceed for characters without data
    if ($row['clientLocale'] == '') {
        return '<div>&nbsp;</div>';
    }
    $lang = $row['clientLocale'];
    $profs = explode(',', $row['professions']);
    foreach ($profs as $prof) {
        $r_prof = explode('|', $prof);
        $value = isset($r_prof[1]) ? explode(':', $r_prof[1]) : array(1, 1);
        $curr = $value[0];
        $max = isset($value[1]) ? $value[1] : floor($skill_curr / 75) * 75;
        $toolTip = $curr . "/" . $max;
        $toolTiph = $r_prof[0];
        if ($r_prof[0] == $roster->locale->wordings[$lang]['riding']) {
            // Flying
            if ($curr > 150) {
                // Class-specific flying mount
                if (isset($roster->locale->wordings[$lang]['ts_flyingIcon'][$row['class']])) {
                    $icon = $roster->locale->wordings[$lang]['ts_flyingIcon'][$row['class']];
                } else {
                    $icon = $roster->locale->wordings[$lang]['ts_flyingIcon'][$row['factionEn']];
                }
            } else {
                // Class-specific riding mount
                if (isset($roster->locale->wordings[$lang]['ts_ridingIcon'][$row['class']])) {
                    $icon = $roster->locale->wordings[$lang]['ts_ridingIcon'][$row['class']];
                } else {
                    $icon = $roster->locale->wordings[$lang]['ts_ridingIcon'][$row['race']];
                }
            }
        } else {
            $icon = isset($roster->locale->wordings[$lang]['ts_iconArray'][$r_prof[0]]) ? $roster->locale->wordings[$lang]['ts_iconArray'][$r_prof[0]] : '';
        }
        // Don't add professions we don't have an icon for. This keeps other skills out.
        if ($icon != '') {
            $icon = '<div class="item-sm" ' . makeOverlib($toolTip, $toolTiph, '', 2, '', ',WRAP') . '><img src="' . $roster->config['interface_url'] . 'Interface/Icons/' . $icon . '.' . $roster->config['img_suffix'] . '" alt="" /><div class="mask"></div></div>';
            if (active_addon('info')) {
                $cell_value .= '<a href="' . makelink('char-info-recipes&amp;a=c:' . $row['member_id'] . '#' . strtolower(str_replace(' ', '', $r_prof[0]))) . '">' . $icon . '</a>';
            } else {
                $cell_value .= $icon;
            }
        }
    }
    return $cell_value;
}
Пример #19
0
    function display()
    {
        global $roster;
        $output = '';
        $bots = array(array('agent' => 'AdsBot-Google', 'name' => 'AdsBot [Google]'), array('agent' => 'ia_archiver', 'name' => 'Alexa [Bot]'), array('agent' => 'Scooter/', 'name' => 'Alta Vista [Bot]'), array('agent' => 'Ask Jeeves', 'name' => 'Ask Jeeves [Bot]'), array('agent' => 'Baiduspider+(', 'name' => 'Baidu [Spider]'), array('agent' => 'Exabot/', 'name' => 'Exabot [Bot]'), array('agent' => 'FAST Enterprise Crawler', 'name' => 'FAST Enterprise [Crawler]'), array('agent' => 'FAST-WebCrawler/', 'name' => 'FAST WebCrawler [Crawler]'), array('agent' => 'http://www.neomo.de/', 'name' => 'Francis [Bot]'), array('agent' => 'Gigabot/', 'name' => 'Gigabot [Bot]'), array('agent' => 'Mediapartners-Google', 'name' => 'Google Adsense [Bot]'), array('agent' => 'Google Desktop', 'name' => 'Google Desktop'), array('agent' => 'Feedfetcher-Google', 'name' => 'Google Feedfetcher'), array('agent' => 'Googlebot', 'name' => 'Google [Bot]'), array('agent' => 'heise-IT-Markt-Crawler Heise', 'name' => 'IT-Markt [Crawler]'), array('agent' => 'heritrix/1.', 'name' => 'Heritrix [Crawler]'), array('agent' => 'ibm.com/cs/crawler', 'name' => 'IBM Research [Bot]'), array('agent' => 'ICCrawler - ICjobs', 'name' => 'ICCrawler - ICjobs'), array('agent' => 'ichiro/', 'name' => 'ichiro [Crawler]'), array('agent' => 'MJ12bot/', 'name' => 'Majestic-12 [Bot]'), array('agent' => 'MetagerBot/', 'name' => 'Metager [Bot]'), array('agent' => 'msnbot-NewsBlogs/', 'name' => 'MSN NewsBlogs'), array('agent' => 'msnbot/', 'name' => 'MSN [Bot]'), array('agent' => 'msnbot-media/', 'name' => 'MSNbot Media'), array('agent' => 'NG-Search/', 'name' => 'NG-Search [Bot]'), array('agent' => 'http://lucene.apache.org/nutch/', 'name' => 'Nutch [Bot]'), array('agent' => 'NutchCVS/', 'name' => 'Nutch/CVS [Bot]'), array('agent' => 'OmniExplorer_Bot/', 'name' => 'OmniExplorer [Bot]'), array('agent' => 'online link validator', 'name' => 'Online link [Validator]'), array('agent' => 'psbot/0', 'name' => 'psbot [Picsearch]'), array('agent' => 'Seekbot/', 'name' => 'Seekport [Bot]'), array('agent' => 'Sensis Web Crawler', 'name' => 'Sensis [Crawler]'), array('agent' => 'SEO search Crawler/', 'name' => 'SEO Crawler'), array('agent' => 'Seoma [SEO Crawler]', 'name' => 'Seoma [Crawler]'), array('agent' => 'SEOsearch/', 'name' => 'SEOSearch [Crawler]'), array('agent' => 'Snappy/1.1 ( http://www.urltrends.com/ )', 'name' => 'Snappy [Bot]'), array('agent' => 'http://www.tkl.iis.u-tokyo.ac.jp/~crawler/', 'name' => 'Steeler [Crawler]'), array('agent' => 'SynooBot/', 'name' => 'Synoo [Bot]'), array('agent' => '*****@*****.**', 'name' => 'Telekom [Bot]'), array('agent' => 'TurnitinBot/', 'name' => 'TurnitinBot [Bot]'), array('agent' => 'voyager/1.0', 'name' => 'Voyager [Bot]'), array('agent' => 'W3 SiteSearch', 'name' => 'Crawler W3 [Sitesearch]'), array('agent' => 'W3C-checklink/', 'name' => 'W3C [Linkcheck]'), array('agent' => 'W3C_*Validator', 'name' => 'W3C [Validator]'), array('agent' => 'http://www.WISEnutbot.com', 'name' => 'WiseNut [Bot]'), array('agent' => 'yacybot', 'name' => 'YaCy [Bot]'), array('agent' => 'Yahoo-MMCrawler/', 'name' => 'Yahoo MMCrawler [Bot]'), array('agent' => 'Yahoo! DE Slurp', 'name' => 'Yahoo Slurp [Bot]'), array('agent' => 'Yahoo! Slurp', 'name' => 'Yahoo [Bot]'), array('agent' => 'YahooSeeker/', 'name' => 'YahooSeeker [Bot]'), array('agent' => 'bingbot/', 'name' => 'Bing [Bot]'));
        $userlist_ary = $userlist_visible = array();
        $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0;
        $prev_session_ip = '';
        $sqlg = "SELECT COUNT(DISTINCT session_ip) as num_guests , session_browser\n\t\t\t\t\tFROM " . $roster->db->table('sessions') . " WHERE `session_user_id` = '0'\n\t\t\t\t\tAND `session_time` >= '" . (time() - 60 * 10) . "';";
        $resultg = $roster->db->query($sqlg);
        $guest = $roster->db->fetch($resultg);
        $guests_online = $guest['num_guests'];
        // lets get the bots..
        $sx = "SELECT * FROM " . $roster->db->table('sessions') . " WHERE `session_user_id` = '0'\n\t\t\t\t\tAND `session_time` >= '" . (time() - 60 * 10) . "';";
        $d = $roster->db->query($sx);
        $bot = array();
        while ($r = $roster->db->fetch($d)) {
            foreach ($bots as $rx) {
                if ($rx['agent'] && preg_match('#' . str_replace('\\*', '.*?', preg_quote($rx['agent'], '#')) . '#i', $r['session_browser'])) {
                    $bot[] = $rx['name'];
                }
            }
        }
        unset($sqlg);
        $roster->db->free_result($resultg);
        $sql = 'SELECT u.usr, u.id, s.*
			FROM ' . $roster->db->table('user_members') . ' u, ' . $roster->db->table('sessions') . ' s
			WHERE s.session_time >= ' . (time() - 60 * 15) . ' AND u.id = s.session_user_id AND s.session_user_id != 0
			ORDER BY u.usr ASC, s.session_ip ASC';
        $result = $roster->db->query($sql);
        $user_online_link = array();
        while ($row = $roster->db->fetch($result)) {
            // User is logged in and therefore not a guest
            if ($row['id'] != 0) {
                // Skip multiple sessions for one user
                if ($row['id'] != $prev_user_id) {
                    if (active_addon('user')) {
                        $user_online_link[] = '<a href="' . makelink('user-user-profile&amp;a=c:' . $row['id']) . '">' . $row['usr'] . '</a> ';
                    } else {
                        $user_online_link[] = $row['usr'];
                    }
                    $logged_visible_online++;
                }
                $prev_user_id = $row['id'];
            } else {
                // Skip multiple sessions for one user
                if ($row['session_ip'] != $prev_session_ip) {
                    $guests_online++;
                }
            }
            $prev_session_ip = $row['session_ip'];
        }
        unset($sql);
        $roster->db->free_result($result);
        $output .= '<div class="whos-online">
			<span class="left">' . $roster->locale->act['total'] . ':</span>
			<span class="right">' . ($logged_visible_online + $guests_online) . '</span>
		</div>
		<hr />
		<div class="whos-online">
			<span class="left">' . $roster->locale->act['reg'] . ':</span>
			<span class="right">' . $logged_visible_online . '</span>
		</div>
		';
        if (count($user_online_link) > 0) {
            $output .= '<div class="online-users">' . implode(', ', $user_online_link) . '</div>';
        }
        $output .= '
		<div class="whos-online">
			<span class="left">' . $roster->locale->act['guests'] . ':</span>
			<span class="right">' . $guests_online . '</span>
		</div>
		';
        if (count($bot) > 0) {
            $output .= '<div class="online-bots">' . $roster->locale->act['bots'] . ': ' . implode(', ', $bot) . '</div>';
        }
        $this->output = $output;
    }