Rep Catagorzation a how to...

100 Night Elf Hunter
13815
so it was asked one time befor and we got no answer from station if this would be added so i made a script my self this uses php and my sql but can be changed for any platform.

first you need an uptodate array of the catagories
$rep = array (

"Cataclysm" => array(
"Wildhammer Clan" => array(),
"Baradin's Wardens" => array(),
"The Earthen Ring" => array(),
"Ramkahen" => array(),
"Guardians of Hyjal" => array(),
"Avengers of Hyjal" => array(),
"Therazane" => array(),
"Dragonmaw Clan" => array(),
"Hellscream's Reach" => array(),
),
"Wrath of the Lich King" => array(

"Knights of the Ebon Blade" => array(),
"Argent Crusade" => array(),
"The Kalu'ak" => array(),
"The Sons of Hodir" => array(),
"Alliance Vanguard" => array(
"Alliance Vanguard" => array(),
"Valiance Expedition" => array(),
"Explorers' League" => array(),
"The Silver Covenant" => array(),
"The Frostborn" => array(),
),
"Horde Expedition" => array(
"Horde Expedition" => array(),
"The Hand of Vengeance" => array(),
"The Sunreavers" => array(),
"The Taunka" => array(),
"Warsong Offensive" => array(),
),
"Kirin Tor" => array(),
"Sholazar Basin" => array(
"Frenzyheart Tribe" => array(),
"The Oracles" => array(),
),
"The Wyrmrest Accord" => array(),
"The Ashen Verdict" => array(),

),
"The Burning Crusade" => array(
"The Violet Eye" => array(),
"Sporeggar" => array(),
"Ashtongue Deathsworn" => array(),
"Ogri'la" => array(),
"The Scale of the Sands" => array(),
"Shattrath City" => array(
"The Sha'tar" => array(),
"Shattered Sun Offensive" => array(),
"The Scryers" => array(),
"Lower City" => array(),
"The Aldor" => array(),
"Sha'tari Skyguard" => array(),
),
"Kurenai" => array(),
"Netherwing" => array(),
"The Consortium" => array(),
"Keepers of Time" => array(),
"Honor Hold" => array(),
"Cenarion Expedition" => array(),
"Ashtongue Deathsworn" => array(),
"The Mag'har" => array(),
"Thrallmar" => array(),
"Tranquillien" => array(),
),
"Classic" => array(
"Thorium Brotherhood" => array(),
"Bloodsail Buccaneers" => array(),
"Cenarion Circle" => array(),
"Darkmoon Faire" => array(),
"Gelkis Clan Centaur" => array(),
"Magram Clan Centaur" => array(),
"Alliance Forces" => array(
"Stormpike Guard" => array(),
"Silverwing Sentinels" => array(),
"The League of Arathor" => array(),
),
"Timbermaw Hold" => array(),
"Zandalar Tribe" => array(),
"Alliance" => array(
"Exodar" => array(),
"Gilneas" => array(),
"Gnomeregan" => array(),
"Stormwind" => array(),
"Ironforge" => array(),
"Darnassus" => array(),
),
"Horde" => array(
"Bilgewater Cartel" => array(),
"Darkspear Trolls" => array(),
"Orgrimmar" => array(),
"Silvermoon City" => array(),
"Thunder Bluff" => array(),
"Undercity" => array(),
),
"Horde Forces" => array(
"Frostwolf Clan" => array(),
"The Defilers" => array(),
"Warsong Outriders" => array(),
),
"Shen'dralar" => array(),
"Brood of Nozdormu" => array(),
"Ravenholdt" => array(),
"Steamwheedle Cartel" => array(
"Everlook" => array(),
"Gadgetzan" => array(),
"Ratchet" => array(),
"Booty Bay" => array(),
),
"Hydraxian Waterlords" => array(),
"Argent Dawn" => array(),
"Wintersaber Trainers" => array(),
"Syndicate" => array(),
),
"Guild" => array(
"" => array(),
),

);


now your database should have the following fields
faction parent name (these are just the main one standing value atwar are at your discression) once you process the rep from the api inseting them in to the table parent and faction will be empty because we dont have them in the api

so we do this...

foreach ($rep as $mcat => $name)
{
foreach ($name as $faction1 => $f1d)
{
$querystr1 = "UPDATE `api_reputation` SET (`faction = '".$mcat."') WHERE `char_id` = 'player_id' and `name` = 'addslashes($faction1)."';";

foreach ($f1d as $faction2 => $f2d)
{
$querystr2 = "UPDATE `api_reputation` SET (`faction = '".$mcat."', `parent` = '".$faction1."') WHERE `player_id` = 'player_id' and `name` = '".addslashes($faction2)."';";
}
}
}


then then just output your rep in a tirerd array and there you have it!
Edited by Ulminia on 12/8/2011 12:18 PM PST
Reply Quote
90 Night Elf Hunter
16035
This is only the Alliance factions - horde are significantly different!
Reply Quote
100 Night Elf Hunter
13815
opps ial edit and add my hord ones in lol
Reply Quote

Please report any Code of Conduct violations, including:

Threats of violence. We take these seriously and will alert the proper authorities.

Posts containing personal information about other players. This includes physical addresses, e-mail addresses, phone numbers, and inappropriate photos and/or videos.

Harassing or discriminatory language. This will not be tolerated.

Forums Code of Conduct

Report Post # written by

Reason
Explain (256 characters max)

Reported!

[Close]