function showPlayerReputation($guid, $class, $race)
{
    global $lang, $game_text, $cDB;
    // Load player reputation
    $repdata = array();
    $rep_tree = array();
    $reputation = $cDB->select("SELECT\n  `faction` AS ARRAY_KEY,\n  `standing`,\n  `flags`\n  FROM `character_reputation` WHERE `guid` = ?d", $guid);
    if (!$reputation) {
        echo "Error";
        return;
    }
    // Load reputation tree
    foreach ($reputation as $id => $r) {
        $rep =& $reputation[$id];
        // Skip hidden
        if (!($rep['flags'] & FACTION_FLAG_VISIBLE) or $rep['flags'] & (FACTION_FLAG_HIDDEN | FACTION_FLAG_INVISIBLE_FORCED)) {
            continue;
        }
        // Upload faction if not set
        if (!isset($rep_tree[$id])) {
            $rep_tree[$id] = getFaction($id);
        }
        // Correct reputation amount
        $rep['standing'] += getBaseReputationForFaction($rep_tree[$id], $race, $class);
        // Insert faction in tree if exist parent
        while ($tid = $rep_tree[$id]['team']) {
            // Load parent faction data if not loaded
            if (!isset($rep_tree[$tid])) {
                $rep_tree[$tid] = getFaction($tid);
            }
            // Insert child if not inserted
            if (!isset($rep_tree[$tid]['childs'][$id])) {
                $rep_tree[$tid]['childs'][$id] =& $rep_tree[$id];
            }
            $id = $tid;
        }
    }
    // Remove inserted as childs nodes
    foreach ($rep_tree as $id => $r) {
        if ($r['team']) {
            unset($rep_tree[$id]);
        }
    }
    if (empty($rep_tree)) {
        echo "Error";
        return;
    }
    echo '<TABLE class=report cellSpacing=0 cellPadding=0><TBODY>';
    echo '<TR><TD class=head colspan=3>' . $lang['player_reputation'] . '</TD></TR>';
    dumpRep(0, $rep_tree, $reputation);
    echo '</tbody></table>';
}
Example #2
0
function getFactionName($faction_id, $as_ref = 1)
{
    if ($faction = getFaction($faction_id, "`name`")) {
        $name = $faction['name'];
    } else {
        $name = "Faction ({$faction_id})";
    }
    if ($as_ref) {
        $name = '<a href="?faction=' . $faction_id . '">' . $name . '</a>';
    }
    return $name;
}
    // Показ энчанта
    case "e":
        if ($enc = getEnchantment($entry)) {
            noBorderEnchantTable($enc);
        } else {
            echo "Error enchant {$entry}";
        }
        break;
        // Показ таланта
    // Показ таланта
    case "t":
        $rank = intval(substr($str, 1, 1));
        $entry = intval(substr($str, 2, 5));
        $talentTab = $wDB->selectRow("SELECT * FROM `wowd_talents` WHERE `TalentID` = ?d", $entry);
        if ($talentTab) {
            noBorderTalentTable($talentTab, $rank);
        } else {
            echo "Error talent {$entry} - {$rank}";
        }
        break;
        // Показ фракции
    // Показ фракции
    case "f":
        if ($faction = getFaction($entry)) {
            include_once "include/faction_table.php";
            noBorderFactionTable($faction);
        } else {
            echo "Error faction {$entry}";
        }
        break;
}
     if ($lang['www_faction']) {
         echo "<a href=\"" . sprintf($lang['www_faction'], $entry) . "\" target=\"_blank\"\">" . sprintf($lang['www_faction'], $entry) . "</a><br>";
     }
     generateFactionTable($faction);
     createReportTab();
     // Входящие в состав фракции
     $page_seek = init_pagePerMark($mark, "teamLIST", $page);
     $rows = $wDB->selectPage($totalRecords, 'SELECT
  *
  FROM `wowd_faction`
  WHERE `team` = ?d
  LIMIT ?d, ?d', $entry, $page_seek, $config['fade_limit']);
     renderFactionGroupList($faction, $rows, $lang['faction_contain'], $page_seek, $totalRecords, $baseLink, 'teamLIST');
     // Входит в группу фракций
     if ($faction['team']) {
         $parent = getFaction($faction['team']);
         $page_seek = init_pagePerMark($mark, "cteamLIST", $page);
         $rows = $wDB->selectPage($totalRecords, 'SELECT
    *
    FROM `wowd_faction`
    WHERE `team` = ?d
    LIMIT ?d, ?d', $faction['team'], $page_seek, $config['fade_limit']);
         renderFactionGroupList($parent, $rows, $lang['faction_in'], $page_seek, $totalRecords, $baseLink, 'cteamLIST');
     }
     /**/
 }
 $templatesId = 0;
 // Состав фракции
 // НИП из данной фракции
 $npc =& new CreatureReportGenerator();
 $fields = array('NPC_REPORT_LEVEL', 'NPC_REPORT_NAME', 'NPC_REPORT_REACTION', 'NPC_REPORT_MAP');