Nice server specific charts

Questions and discussions on development tools for WarcraftRealms
Post Reply
User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Nice server specific charts

Post by Rollie »

to http://www.khazgoroth.de/modules/cjayco ... x.php?id=7

Someone over at EU - Khazgoroth has coded up this nice page for his server! Very sharp! Hopefully he'll post here soon so others can possibly use his handiwork!
phpbb:phpinfo()

User avatar
Rollie
Site Admin
Posts: 4783
Joined: Sun Nov 28, 2004 11:52 am
Location: Austin, TX
Contact:

Post by Rollie »

The creator of this page emailed me the code to share! Here you go:
--------------------------------------------------------------------------------

Realm-Census with graphical output



code by Dan - for questions and suggestions please [email protected]

--------------------------------------------------------------------------------





DEMO: http://www.daniel-cron.de/census/census.php

SCRIPT and FILES: http://www.daniel-cron.de/census/census.zip







First of all, i`m an Flash-Actor an not an PHP-Expert, so this whole thing might be codes much clearer and faster.

But as i`m learning PHP at this time i started coding as i thought i might work. :-)

And it works. *g*





All needed Files are Included in the census.zip.

Simply extract all files to a Folder of your webspace.



FOR GETTING THE UPDATES OF THE SOURCE FILE, YOU NEED TO CHMOD 666 THE FOLLOWING FILES:

--> status.txt

--> kgroster.csv





This Census-Code is for the EU Khaz`goroth Realm, its getting an Update 1 time a Day.

To show the Census of Your Realm, you have to change the Source-Census-File.

You can find it at about line 140 in the census-php, simply look for:



$filename = "http://www.warcraftrealms.com/exports/d ... oth.csv.gz";



and change it to the URL of your census file. You can find a list of all URLS at

http://www.warcraftrealms.com/dataexport.php .





My census shows Race and Class Names in German. If you need it in other languages, search the code for the german

Names - But ONLY in the HTML-ECHO part. Normally its simply to find.







Last but not least, if you find this Script useful and you use it on your page, plase mail me the URL of your Site.

So i can inform you, if i change something on my code or i build an new version.





Greeting,

Dan from EU-Khaz'Goroth,

Admin of www.khazgoroth.de















-----------------------------------------------------------------------------------

The Code - Save it in a single .php file !!!

-----------------------------------------------------------------------------------



Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http&#58;//www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>WoW Server-Census - sponsored by WarcraftRealms.com</title>

<meta name='keywords' content='world of warcraft, warcraft, warcraft census, warcraft realm, warcraft realms, world, wow, wow census, wow realm, wow realms, bloodscalp'>

<meta name='description' content='World of Warcraft Census Information and Data'>

</head>

 

 

 

<style type='text/css'>td.bar0&#123;  font-family&#58; Verdana; color&#58; #000000;         font-size&#58; 10px;  vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg0&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar1&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg1&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar2&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg2&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar3&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg3&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar4&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg4&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar5&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg5&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar6&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg6&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar7&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg7&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar0&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img0&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar1&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img1&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar2&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img2&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar3&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img3&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar4&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img4&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar5&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img5&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar6&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img6&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar7&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img7&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar8&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img8&#123; width&#58;40px;&#125;</style>

 

<style type='text/css'>td.innertopleft&#123;background-image&#58; url&#40;inner-top-left.gif&#41;; width&#58; 20px;&#125;</style>

<style type='text/css'>td.innertop&#123;background-image&#58; url&#40;inner-top.gif&#41;; height&#58; 20px;&#125;</style>

<style type='text/css'>td.innertopright&#123;background-image&#58; url&#40;inner-top-right.gif&#41;;      width&#58; 20px;&#125;</style>

 

<style type='text/css'>td.innerleft&#123;background-image&#58; url&#40;inner-left.gif&#41;; width&#58; 20px;&#125;</style>

<style type='text/css'>td.innerright&#123;background-image&#58; url&#40;inner-right.gif&#41;; width&#58; 20px;&#125;</style>

 

<style type='text/css'>td.innerbottomleft&#123;background-image&#58; url&#40;inner-bottom-left.gif&#41;; width&#58; 20px;&#125;</style>

<style type='text/css'>td.innerbottom&#123;background-image&#58; url&#40;inner-bottom.gif&#41;; height&#58; 20px;&#125;</style>

<style type='text/css'>td.innerbottomright&#123;background-image&#58; url&#40;inner-bottom-right.gif&#41;;       width&#58; 20px;&#125;</style>

 

<style type='text/css'>table.censusinfo&#123;background-image&#58; url&#40;newsback.gif&#41;;&#125;</style>

<style type='text/css'>td.levelbar&#123;vertical-align&#58; bottom; padding&#58; 1px;&#125;</style>

 

<style type='text/css'>td.category&#123;font-family&#58; Verdana; color&#58; #000000;     font-size&#58; 10px;&#125;</style>

<style type='text/css'>body&#123; background-image&#58;url&#40;hintergrund.jpg&#41;; font-family&#58; Verdana; color&#58; #000000;     font-size&#58; 10px; &#125;</style>

 

<body>

 

<?php 

 

//  -------------------------------------------------------------------------------

// CHECKING STATUS FILE AND GETTING NEW CENSUS DATA, IF NEWER FILE EXISTS

//  -------------------------------------------------------------------------------

 

    //  Remember to check the status file so that you are not pulling data 

    //  more than once per day 

    // 

    $localstatusfile = "status.txt"; 

    $infile = fopen &#40;$localstatusfile, "r"&#41;; 

    $current_timestamp = 0; 

    if &#40;!$infile&#41; 

    &#123; 

        echo "<p>No status file available, assuming this is the first run<br>"; 

    &#125; 

    else 

    &#123; 

        //  read our status file time 

        $buffer = fgets&#40;$infile, 4096&#41;; 

        $current_timestamp = trim&#40; $buffer &#41;; 

                        

                        // Output of last Update on top if the page

        echo '<p align="center">Letzte Aktualisierung&#58; ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$current_timestamp&#41; . '</p><br>'; 

    &#125; 

    fclose&#40; $infile &#41;;         //  close our local status file 

    

    $filename = "http&#58;//www.warcraftrealms.com/exports/status.txt"; 

    $infile = fopen &#40;$filename, "r"&#41;;   // open remote status file 

    if &#40;!$infile&#41; 

    &#123; 

        echo "<p>Unable to open status file.<br>"; 

        exit; 

    &#125; 

 

    $remote_timestamp = 0; 

    if&#40;!feof &#40;$infile&#41;&#41;   // only 1 read should be needed for the status file 

    &#123; 

        $buffer = fgets&#40;$infile, 4096&#41;; 

        $remote_timestamp = trim&#40; $buffer &#41;; 

 

            //    Output of last Update of the original Census File. Not needed, if code is working. maybe god for Update-Testing

   //     echo '<p align="center">Originale Census Datenfile&#58; ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$remote_timestamp&#41; . '</p><br>'; 

 

    &#125; 

    fclose&#40; $infile &#41;;  //  close the remote status file 

 

    if&#40; $remote_timestamp - $current_timestamp > 86400 &#41; //  1 day = 60*60*24 

    &#123; 

        // 

        //  We can do a full get 

        // 

 

        //  write our new status file 

        $outfilename = "status.txt"; 

        $outfile = fopen&#40;$outfilename, "w"&#41;; 

        if&#40; !$outfile &#41; 

        &#123; 

            echo "<p>Unable to open save file => " . $outfilename . "<br>"; 

            exit; 

        &#125; 

 

        fputs&#40;$outfile, $buffer&#41;; 

        fclose&#40;$outfile&#41;; 

 

 

        // 

        //  Now get our guild roster file 

        // 

 

                        //  -------------------------------------------------------------------------------

                        //    REPLACE THE URL FOR YOUR REALM FILE

        $filename = "http&#58;//www.warcraftrealms.com/exports/download.php?fname=EU-Khaz'goroth.csv.gz"; 

                        //  -------------------------------------------------------------------------------

 

        $infile = gzopen &#40;$filename, "r"&#41;; 

 

        if &#40;!$infile&#41; 

        &#123; 

            echo "<p>Unable to open remote file.<br>\n"; 

            exit; 

        &#125; 

 

        $outfilename = "kgroster.csv";    // Local filename for downloaded Census Data - Normaly no need to change

        $outfile = fopen&#40;$outfilename, "w"&#41;; 

        if&#40; !$outfile &#41; 

        &#123; 

            echo "<p>Unable to open save file => " . $outfilename . "<br>\n"; 

            exit; 

        &#125; 

 

        while &#40;!feof &#40;$infile&#41;&#41; 

        &#123; 

            $buffer = fgets&#40;$infile, 4096&#41;; 

            fputs&#40;$outfile, $buffer&#41;; 

        &#125; 

 

        fclose&#40;$outfile&#41;; 

        fclose&#40;$infile&#41;; 

    &#125; 

 

 

//  -------------------------------------------------------------------------------

//  Data download and checking is now done. Now the Data-Processing can begin.

//  -------------------------------------------------------------------------------

 

 

 

 

 

    $filename = "kgroster.csv"; 

    $infile = fopen &#40;$filename, "r"&#41;; 

    if &#40;!$infile&#41; 

    &#123; 

        echo "<p>Unable to open local roster file.<br>"; 

        exit; 

    &#125; 

    //  do one read to get the header 

    $buffer = fgets&#40;$infile, 4096&#41;; 

            $lines = 0;

    //  read the entries 

    while &#40;!feof &#40;$infile&#41;&#41; 

    &#123; 

        $buffer = fgets&#40;$infile, 4096&#41;; 

        list&#40; $name, $race, $class, $level, $last_seen, $rank &#41; = explode&#40;",",$buffer&#41;; 

                        $lines = $lines + 1;

    &#125; 

 

            //-------------DANS SCRIPT --------------------------------

            

            // declaring main vars

            $horde = 0;

            $alliance = 0;

            $allianceprozent = 0;

            $hordeprozent = 0;

            $allianceratio = 0;

            $horderatio = 0;

            $druid = 0;

            $hunter = 0;

            $mage = 0;

            $paladin = 0;

            $priest = 0;

            $rogue = 0;

            $shaman = 0;

            $warlock = 0;

            $warrior = 0;

            

            // declaring sub-vars and vars with Strings of the Races and classes

            $rasse = array&#40;dwarf, gnome, human, nightelf, orc, tauren, troll, undead&#41;;

            $rassecaps = array&#40;"Dwarf", "Gnome", "Human", "Night Elf", "Orc", "Tauren", "Troll", "Undead"&#41;;

            $rassedeutsch = array&#40;Zwergen, Gnomen, Menschen, Nachtelfen, Ork, Tauren, Troll, Untoten&#41;;

            $klasse = array&#40;druid, hunter, mage, paladin, priest, rogue, shaman, warlock, warrior&#41;;

            

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                        $&#123;$rasse&#91;$i&#93;&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.druid&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.hunter&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.mage&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.paladin&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.priest&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.rogue&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.shaman&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.warlock&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.warrior&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.unknown&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.prozent&#125; = 0;

            &#125;

            

            $csv = file_get_contents&#40;"kgroster.csv"&#41;; 

            $csv = explode&#40;"\n",$csv&#41;; 

 

 

 

            $count = 0 ;   // Z?hlt durch bis Ende Hauptarray

            while &#40;$count <= $lines&#41; 

    &#123; 

                        $csv&#91;$count&#93; = explode&#40;",",$csv&#91;$count&#93;&#41;;  

 

//-----------Allianz Horde---------------

                        if &#40;$csv&#91;$count&#93;&#91;1&#93; == "Alliance"&#41; &#123;

                                      $alliance = $alliance + $csv&#91;$count&#93;&#91;5&#93;;

                        &#125; else &#123;

                                      $horde = $horde + $csv&#91;$count&#93;&#91;5&#93;;

                        &#125;

//---------------------------------------

 

                        for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

 

                        // cycle through all races

                        if &#40;$csv&#91;$count&#93;&#91;2&#93; == $rassecaps&#91;$i&#93;&#41; &#123;

                        

                                                // cycle through all classes of a race and add the number of class-race-chars to the class-racespecific countervar

                                      $&#123;$rasse&#91;$i&#93;&#125; = $&#123;$rasse&#91;$i&#93;&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                                                                                          

                                                if &#40;$csv&#91;$count&#93;&#91;3&#93; == "Druid"&#41; &#123;

                                                              $&#123;$rasse&#91;$i&#93;.druid&#125; = $&#123;$rasse&#91;$i&#93;.druid&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Hunter"&#41; &#123;

                                                              $&#123;$rasse&#91;$i&#93;."hunter"&#125; = $&#123;$rasse&#91;$i&#93;."hunter"&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Mage"&#41; &#123;

                                                             $&#123;$rasse&#91;$i&#93;.mage&#125; = $&#123;$rasse&#91;$i&#93;.mage&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Paladin"&#41; &#123;

                                                             $&#123;$rasse&#91;$i&#93;.paladin&#125; = $&#123;$rasse&#91;$i&#93;.paladin&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Priest"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.priest&#125; = $&#123;$rasse&#91;$i&#93;.priest&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Rogue"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.rogue&#125; = $&#123;$rasse&#91;$i&#93;.rogue&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Shaman"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.shaman&#125; = $&#123;$rasse&#91;$i&#93;.shaman&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Warlock"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.warlock&#125; = $&#123;$rasse&#91;$i&#93;.warlock&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Warrior"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.warrior&#125; = $&#123;$rasse&#91;$i&#93;.warrior&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; else &#123;

                                                            $&#123;$rasse&#91;$i&#93;.unknown&#125; = $&#123;$rasse&#91;$i&#93;.unknown&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125;

                        

                                                // add the levels of a race to a race-level array

                                                $levelhelper = $csv&#91;$count&#93;&#91;4&#93;;

                                                $&#123;$rasse&#91;$i&#93;.level&#125;&#91;$levelhelper&#93; = $&#123;$rasse&#91;$i&#93;.level&#125;&#91;$levelhelper&#93; + $csv&#91;$count&#93;&#91;5&#93;;

 

                        &#125; else &#123;

                        &#125;

                        &#125;

                        $count = $count + 1;

            &#125;

 

            // sum all race-class-chars to a single race variable

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                    $druid = $druid + $&#123;$rasse&#91;$i&#93;.druid&#125;;

                                    $hunter = $hunter + $&#123;$rasse&#91;$i&#93;.hunter&#125;;

                                    $mage = $mage + $&#123;$rasse&#91;$i&#93;.mage&#125;;

                                    $paladin = $paladin + $&#123;$rasse&#91;$i&#93;.paladin&#125;;

                                    $priest = $priest + $&#123;$rasse&#91;$i&#93;.priest&#125;;

                                    $rogue = $rogue + $&#123;$rasse&#91;$i&#93;.rogue&#125;;

                                    $shaman = $shaman + $&#123;$rasse&#91;$i&#93;.shaman&#125;;

                                    $warlock = $warlock + $&#123;$rasse&#91;$i&#93;.warlock&#125;;

                                    $warrior = $warrior + $&#123;$rasse&#91;$i&#93;.warrior&#125;;

                        &#125;

                        

// End of Data reading and writing main arrays.

 

 

 

//  -------------------------------------------------------------------------------

//  mathematics

//  -------------------------------------------------------------------------------

 

            // count all palyers an get the A-H-Ratio

            $player = $alliance + $horde;

            $allianceprozent = round&#40;$alliance / $player * 100&#41;;

            $hordeprozent = 100 - $allianceprozent;

            $allianceratio = round&#40;$allianceprozent / $hordeprozent,1&#41;;

            $horderatio = 1;

            

//  Get all race-Percantages and make a race-multiplier for adequate Ber-Height in the Output-Table 

//  z.B. dwarfprozent

            $rasseprozentmax = 0;

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

            $&#123;$rasse&#91;$i&#93;.prozent&#125; = round&#40;$&#123;$rasse&#91;$i&#93;&#125; / $player * 100&#41;;

                        if &#40;$&#123;$rasse&#91;$i&#93;.prozent&#125; > $rasseprozentmax&#41; &#123;

                                    $rasseprozentmax = $&#123;$rasse&#91;$i&#93;.prozent&#125;;

                        &#125;

            &#125;

            $rasseprozentmulti = floor&#40;100 / $rasseprozentmax&#41;;

            

            

// Sum all Classes from Race-Class-counter

            for &#40;$j = 0; $j <= 8; $j++&#41; &#123;           

                        $&#123;$klasse&#91;$j&#93;.prozent&#125; = 0;

                        for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                    $&#123;$klasse&#91;$j&#93;&#125; = $&#123;$klasse&#91;$j&#93;&#125; + $&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;&#125;;

                        &#125;

            &#125;

 

//  Get all Class-Percantages and make a Class-multiplier for adequate Ber-Height in the Output-Table         

//  z.B. druidprozent

            $klasseprozentmax = 0;

            for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

            $&#123;$klasse&#91;$i&#93;.prozent&#125; = round&#40;$&#123;$klasse&#91;$i&#93;&#125; / $player * 100&#41;;

                        if &#40;$&#123;$klasse&#91;$i&#93;.prozent&#125; > $klasseprozentmax&#41; &#123;

                                    $klasseprozentmax = $&#123;$klasse&#91;$i&#93;.prozent&#125;;

                        &#125;

            &#125;

            $klasseprozentmulti = floor&#40;100 / $klasseprozentmax&#41;;

 

 

//  Get all race-class-Percantages and make a race-class-multiplier for adequate Ber-Height in the Output-Table        

//  z.B. drwarfdruidprozent

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

            $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125; = 0;

            for &#40;$j = 0; $j <= 8; $j++&#41; &#123;

            $&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;.prozent&#125; = round&#40;$&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;&#125; / $&#123;$rasse&#91;$i&#93;&#125; * 100&#41;;

                        if &#40;$&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;.prozent&#125; > $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125;&#41; &#123;

                                    $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125; = $&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;.prozent&#125;;

                        &#125;

            &#125;

            $&#123;$rasse&#91;$i&#93;.klasseprozentmulti&#125; = floor&#40;100 / $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125;&#41;;

            &#125;

            

//  get all Race-level-percentages and its multiplier

//  rassenlevelprozent

            for &#40;$j = 0; $j <= 7; $j++&#41; &#123;

 

            $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125; = 0;

            for &#40;$i = 10; $i <= 60; $i++&#41; &#123;

            $&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$i&#93; = round&#40;$&#123;$rasse&#91;$j&#93;.level&#125;&#91;$i&#93; / $&#123;$rasse&#91;$j&#93;&#125; * 100,3&#41;;

                        if &#40;$&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$i&#93; > $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125;&#41; &#123;

                                    $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125; = $&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$i&#93;;

                        &#125;

            &#125;

            $&#123;$rasse&#91;$j&#93;.levelprozentmulti&#125; = floor&#40;50 / $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125;&#41;;

            

            &#125;

            

 

//  get all levels from race-levels

            for &#40;$j = 10; $j <= 60; $j++&#41; &#123;

                        $level&#91;$j&#93; = 0;

                        for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                        $level&#91;$j&#93; = $level&#91;$j&#93; + $&#123;$rasse&#91;$i&#93;.level&#125;&#91;$j&#93;;

                        &#125;

            //          echo "  Level " . $j . " = " . $level&#91;$j&#93; . " !";

            &#125;

            

            

//  get all level percentages

            $levelprozentmax = 0;

            for &#40;$i = 10; $i <= 60; $i++&#41; &#123;

            $levelprozent&#91;$i&#93; = round&#40;$level&#91;$i&#93; / $player * 100,3&#41;;

                        if &#40;$levelprozent&#91;$i&#93; > $levelprozentmax&#41; &#123;

                                    $levelprozentmax = $levelprozent&#91;$i&#93;;

                        &#125;

            &#125;

            $levelprozentmulti = floor&#40;50 / $levelprozentmax&#41;;

//  --------------------------------------------------------------------------------------------

//  End of Mathematics part. Now all Vars are written an can be used f?r output

//  --------------------------------------------------------------------------------------------

 

 

 

 

//  --------------------------------------------------------------------------------------------

//  --------------------------------------------------------------------------------------------

//   GRAPHICAL OUTPUT BEGINGS. 

//  --------------------------------------------------------------------------------------------

//  --------------------------------------------------------------------------------------------

 

 

//  --------------------------------------------------------------------------------------------

//  First Table with general Stats and Race and class overview, as well as all-chars-levels

//  --------------------------------------------------------------------------------------------

echo "<center>

<p>&nbsp;</p>

<table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table1">

<tr>

    <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=2></td><td class=\"innertopright\"></td>

</tr>

<tr>

<td class=\"innerleft\"></td>

<td> <img src=\"kgcensuslogo.jpg\"> &nbsp;    </td>

<td>

    <table align=\"right\" cellpadding=0 cellspacing=0 class=\"censusinfo\" ID="Table2">

        <tr>

            <td class=\"category\">Total Characters&#58;</td>

            <td class=\"category\"><b>$player</b></td>

        </tr>

        <tr>

            <td class=\"category\">Total Alliance&#58;</td>

            <td class=\"category\"><b>$alliance - $allianceprozent %</b></td>

        </tr>

        <tr>

            <td class=\"category\">Total Horde&#58;</td>

            <td class=\"category\"><b>$horde - $hordeprozent %</b></td>

        </tr>

        <tr>

            <td class=\"category\">A to H Ratio&#58;</td>

            <td class=\"category\"><b>$allianceratio &#58; $horderatio</b></td>

        </tr>

           </table>

</td>

<td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

        <table class=\"censusinfo\" ID="Table3"><tr><td align=\"center\">

        <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table4">

            <tr>

                <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=8></td><td class=\"innertopright\"></td>

            </tr>

<!--            <tr>

                <td class=\"innerleft\"></td>

                <td align=\"center\" colspan=4>Alliance</td>

                <td  align=\"center\" colspan=4>Horde</td>

                <td class=\"innerright\"></td>

            </tr>

-->            <tr>

                <td class=\"innerleft\" height=100></td>

                                                ";

           

                                                for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                                            echo "<td class=\"bar" . $i . "\"><img class=\"raceimg" . $i . "\" src='Census_Bar.jpg' height=\"" . $&#123;$rasse&#91;$i&#93;.prozent&#125; * $rasseprozentmulti . "\" alt=\"" . $&#123;$rasse&#91;$i&#93;&#125; . " - " . $&#123;$rasse&#91;$i&#93;.prozent&#125; . " %\"></td>";

                                                &#125;                                      

                                       

                                       echo "

                                        <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\"></td>

                                                ";

 

                                                for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                                            echo "<td class=\"bar" . $i . "\">" . $&#123;$rasse&#91;$i&#93;&#125; . "<BR />" . $&#123;$rasse&#91;$i&#93;.prozent&#125; . "%</td>";

                                                &#125;                       

 

 

                        echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=8></td><td class=\"innerbottomright\"></td>

            </tr>

            <tr>

                <td width=20></td>

                <td class=\"bar0\" align=\"center\"><img src='Census_Dwarf.jpg' border=0 alt=\"Zwerg\"><br>Zwerg</td>

                <td class=\"bar1\" align=\"center\"><img src='Census_Gnome.jpg' border=0 alt=\"Gnom\"><br>Gnom</td>

                <td class=\"bar2\" align=\"center\"><img src='Census_Human.jpg' border=0 alt=\"Mensch\"><br>Mensch</td>

                <td class=\"bar3\" align=\"center\"><img src='Census_NightElf.jpg' border=0 alt=\"Nacht Elf\"><br>N-Elf</td>

                <td class=\"bar4\" align=\"center\"><img src='Census_Orc.jpg' border=0 alt=\"Ork\"><br>Ork</td>

                <td class=\"bar5\" align=\"center\"><img src='Census_Tauren.jpg' border=0 alt=\"Taure\"><br>Taure</td>

                <td class=\"bar6\" align=\"center\"><img src='Census_Troll.jpg' border=0 alt=\"Troll\"><br>Troll</td>

                <td class=\"bar7\" align=\"center\"><img src='Census_Undead.jpg' border=0 alt=\"Untoter\"><br>Untoter</td>

                <td width=20></td>

            </tr>

                                    <tr><td>&nbsp;</td></tr>

        </table> 

        </td>

            <td rowspan='2' height='100%'>&nbsp;</td>

        </tr><tr>

        <td align=\"center\">

        <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table5">

            <tr>

                <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=9></td><td class=\"innertopright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\" height=100></td>

                                                ";

 

                                                for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                            echo "<td class=\"class_bar" . $i . "\"><img class=\"class_img" . $i . "\" src='Census_Bar.jpg' height=\"" . $&#123;$klasse&#91;$i&#93;.prozent&#125; * $klasseprozentmulti . "\" alt=\"" . $&#123;$klasse&#91;$i&#93;&#125; . " - " . $&#123;$klasse&#91;$i&#93;.prozent&#125; . " %\"></td>";

                                                &#125;                       

 

                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\"></td>

                                                ";

 

                                    for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                echo "<td class=\"class_bar" . $i . "\">" . $&#123;$klasse&#91;$i&#93;&#125; . "<BR />" . $&#123;$klasse&#91;$i&#93;.prozent&#125; . "%</td>";

                                                &#125;

 

                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=9></td><td class=\"innerbottomright\"></td>

            </tr>

            <tr>

                <td width=20></td>

                <td class=\"class_bar0\" align=\"center\"><img src='Census_Druid.jpg' border=0 alt=\"Druide\"><br>Druide</td>

                <td class=\"class_bar1\" align=\"center\"><img src='Census_Hunter.jpg' border=0 alt=\"J?ger\"><br>J?ger</td>

                <td class=\"class_bar2\" align=\"center\"><img src='Census_Mage.jpg' border=0 alt=\"Magier\"><br>Magier</td>

                <td class=\"class_bar3\" align=\"center\"><img src='Census_Paladin.jpg' border=0 alt=\"Paladin\"><br>Paladin</td>

                <td class=\"class_bar4\" align=\"center\"><img src='Census_Priest.jpg' border=0 alt=\"Priester\"><br>Priest</td>

                <td class=\"class_bar5\" align=\"center\"><img src='Census_Rogue.jpg' border=0 alt=\"Schurke\"><br>Rogue</td>

                <td class=\"class_bar6\" align=\"center\"><img src='Census_Shaman.jpg' border=0 alt=\"Schamane\"><br>Shaman</td>

                <td class=\"class_bar7\" align=\"center\"><img src='Census_Warlock.jpg' border=0 alt=\"Hexenmeister\"><br>Warlock</td>

                <td class=\"class_bar8\" align=\"center\"><img src='Census_Warrior.jpg' border=0 alt=\"Krieger\"><br>Krieger</td>

                <td width=20></td>

            </tr>

        </table>

        </td>

        </tr>

        </table> 

        </td> 

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\" height=15></td>

    <td colspan=2>

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

    <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table6">

        <tr>

            <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=51></td><td class=\"innertopright\"></td>

        </tr>

        <tr>

            <td class=\"innerleft\" height=50></td>

                                    ";

                                    

                                    

            for &#40;$j = 10; $j <= 60; $j++&#41; &#123;

                        echo "<td class='levelbar'> <img src='Census_LevelBar.jpg' height=" . $levelprozent&#91;$j&#93; * $levelprozentmulti  . " alt=\"" . $level&#91;$j&#93; . "\" width=6  border=0> </td>";

            &#125;

 

 

echo "

<td class='innerright'></td></tr><tr><td class='innerleft'></td><td class=\"category\" colspan=2 align='left'>10</td><td colspan=2></td><td class='category' colspan=3>15</td><td colspan=2></td><td class='category' colspan=3>20</td><td colspan=2></td><td class='category' colspan=3>25</td><td colspan=2></td><td class='category' colspan=3>30</td><td colspan=2></td><td class='category' colspan=3>35</td><td colspan=2></td><td class='category' colspan=3>40</td><td colspan=2></td><td class='category' colspan=3>45</td><td colspan=2></td><td class='category' colspan=3>50</td><td colspan=2></td><td class='category' colspan=3>55</td><td colspan=2></td><td class='category' colspan=2 align='right'>60</td>

            <td class=\"innerright\"></td>

        </tr>

        <tr>

            <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=51></td><td class=\"innerbottomright\"></td>

        </tr>

    </table>       

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=\"2\"></td><td class=\"innerbottomright\"></td>

</tr>

</table>

<p>&nbsp;</p>

</center>";

 

 

 

//  --------------------------------------------------------------------------------------------

//  The 8 Tables with Race-Specific data. Only 1 Code, but repeated 8 times by the "For"-Code

//  --------------------------------------------------------------------------------------------

for &#40;$j = 0; $j <= 7; $j++&#41; &#123;

 

echo "<center>

<p>&nbsp;</p>

<table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table7">

<tr>

    <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=2></td><td class=\"innertopright\"></td>

</tr>

<tr>

<td class=\"innerleft\"></td>

";

 

echo "<td> <img src='" . $rasse&#91;$j&#93; . ".jpg '> </td><td>&nbsp;</td>";

 

 

 

 

echo "

<td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

        <table class=\"censusinfo\" ID="Table8">

                        <tr>

        <td align=\"center\">

        <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table9">

            <tr>

                <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=9></td><td class=\"innertopright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\" height=100></td>

                                                ";

 

                                                for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                            echo "<td class=\"class_bar" . $i . "\"><img class=\"class_img" . $i . "\" src='Census_Bar.jpg' height=\"" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;.prozent&#125; * $&#123;$rasse&#91;$j&#93;.klasseprozentmulti&#125; . "\" alt=\"" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;&#125; . " - " . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;.prozent&#125; . " %\"></td>";

                                                &#125;                       

 

                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\"></td>

                                                ";

 

                                    for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                echo "<td class=\"class_bar" . $i . "\">" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;&#125; . "<BR />" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;.prozent&#125; . "%</td>";

                                                &#125;

 

                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=9></td><td class=\"innerbottomright\"></td>

            </tr>

            <tr>

                <td width=20></td>

                <td class=\"class_bar0\" align=\"center\"><img src='Census_Druid.jpg' border=0 alt=\"Druide\"><br>Druide</td>

                <td class=\"class_bar1\" align=\"center\"><img src='Census_Hunter.jpg' border=0 alt=\"J?ger\"><br>J?ger</td>

                <td class=\"class_bar2\" align=\"center\"><img src='Census_Mage.jpg' border=0 alt=\"Magier\"><br>Magier</td>

                <td class=\"class_bar3\" align=\"center\"><img src='Census_Paladin.jpg' border=0 alt=\"Paladin\"><br>Paladin</td>

                <td class=\"class_bar4\" align=\"center\"><img src='Census_Priest.jpg' border=0 alt=\"Priester\"><br>Priest</td>

                <td class=\"class_bar5\" align=\"center\"><img src='Census_Rogue.jpg' border=0 alt=\"Schurke\"><br>Rogue</td>

                <td class=\"class_bar6\" align=\"center\"><img src='Census_Shaman.jpg' border=0 alt=\"Schamane\"><br>Shaman</td>

                <td class=\"class_bar7\" align=\"center\"><img src='Census_Warlock.jpg' border=0 alt=\"Hexenmeister\"><br>Warlock</td>

                <td class=\"class_bar8\" align=\"center\"><img src='Census_Warrior.jpg' border=0 alt=\"Krieger\"><br>Krieger</td>

                <td width=20></td>

            </tr>

        </table>

        </td>

        </tr>

        </table> 

        </td> 

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\" height=15></td>

    <td colspan=2>

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

    <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID="Table10">

        <tr>

            <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=51></td><td class=\"innertopright\"></td>

        </tr>

        <tr>

            <td class=\"innerleft\" height=50></td>

                                    ";

                                    

                                    

            for &#40;$k = 10; $k <= 60; $k++&#41; &#123;

                        echo "<td class='levelbar'> <img src='Census_LevelBar.jpg' height=" . $&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$k&#93; * $levelprozentmulti  . " alt=\"" . $&#123;$rasse&#91;$j&#93;.level&#125;&#91;$k&#93; . "\" width=6  border=0> </td>";

            &#125;

 

 

echo "

<td class='innerright'></td></tr><tr><td class='innerleft'></td><td class=\"category\" colspan=2 align='left'>10</td><td colspan=2></td><td class='category' colspan=3>15</td><td colspan=2></td><td class='category' colspan=3>20</td><td colspan=2></td><td class='category' colspan=3>25</td><td colspan=2></td><td class='category' colspan=3>30</td><td colspan=2></td><td class='category' colspan=3>35</td><td colspan=2></td><td class='category' colspan=3>40</td><td colspan=2></td><td class='category' colspan=3>45</td><td colspan=2></td><td class='category' colspan=3>50</td><td colspan=2></td><td class='category' colspan=3>55</td><td colspan=2></td><td class='category' colspan=2 align='right'>60</td>

            <td class=\"innerright\"></td>

        </tr>

        <tr>

            <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=51></td><td class=\"innerbottomright\"></td>

        </tr>

    </table>       

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=\"2\"></td><td class=\"innerbottomright\"></td>

</tr>

</table>

<p>&nbsp;</p>

</center>";

 

&#125;

    //  don't forget our credit link =&#41; 

            echo "<center>";

    echo "Sourcedata by <a href='http&#58;//www.warcraftrealms.com/'>WarcraftRealms.com</a>."; 

    echo "Data-handling and output by <a href='http&#58;//www.beat-solutions.de/'>D.Cron Beat-Solutions</a>."; 

            echo "</center>";

 

?>

</body>

</html>

phpbb:phpinfo()

Botti
Posts: 1
Joined: Sat Oct 08, 2005 6:54 am
Location: AC, Germany
Contact:

Post by Botti »

I found some errors in the code and the linked ZIP-package is not online anymore. However this following code should do for the EU-Krag'jin Server:

Code: Select all

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http&#58;//www.w3.org/TR/html4/loose.dtd">

<html>

<head>

<title>WoW Server-Census - sponsored by WarcraftRealms.com</title>

<meta name='keywords' content='world of warcraft, warcraft, warcraft census, warcraft realm, warcraft realms, world, wow, wow census, wow realm, wow realms, bloodscalp'>

<meta name='description' content='World of Warcraft Census Information and Data'>

</head>







<style type='text/css'>td.bar0&#123;  font-family&#58; Verdana; color&#58; #000000;         font-size&#58; 10px;  vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg0&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar1&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg1&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar2&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg2&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar3&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg3&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar4&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg4&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar5&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg5&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar6&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg6&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.bar7&#123; font-family&#58; Verdana; color&#58; #000000;          font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.raceimg7&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar0&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img0&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar1&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img1&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar2&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img2&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar3&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img3&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar4&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img4&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar5&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img5&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar6&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img6&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar7&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img7&#123; width&#58;40px;&#125;</style>

<style type='text/css'>td.class_bar8&#123; font-family&#58; Verdana; color&#58; #000000; font-size&#58; 10px; vertical-align&#58;bottom;text-align&#58;center;padding-left&#58; 2px;padding-right&#58; 2px; width&#58;40px;&#125;

img.class_img8&#123; width&#58;40px;&#125;</style>



<style type='text/css'>td.innertopleft&#123;background-image&#58; url&#40;inner-top-left.gif&#41;; width&#58; 20px;&#125;</style>

<style type='text/css'>td.innertop&#123;background-image&#58; url&#40;inner-top.gif&#41;; height&#58; 20px;&#125;</style>

<style type='text/css'>td.innertopright&#123;background-image&#58; url&#40;inner-top-right.gif&#41;;      width&#58; 20px;&#125;</style>



<style type='text/css'>td.innerleft&#123;background-image&#58; url&#40;inner-left.gif&#41;; width&#58; 20px;&#125;</style>

<style type='text/css'>td.innerright&#123;background-image&#58; url&#40;inner-right.gif&#41;; width&#58; 20px;&#125;</style>



<style type='text/css'>td.innerbottomleft&#123;background-image&#58; url&#40;inner-bottom-left.gif&#41;; width&#58; 20px;&#125;</style>

<style type='text/css'>td.innerbottom&#123;background-image&#58; url&#40;inner-bottom.gif&#41;; height&#58; 20px;&#125;</style>

<style type='text/css'>td.innerbottomright&#123;background-image&#58; url&#40;inner-bottom-right.gif&#41;;       width&#58; 20px;&#125;</style>



<style type='text/css'>table.censusinfo&#123;background-image&#58; url&#40;newsback.gif&#41;;&#125;</style>

<style type='text/css'>td.levelbar&#123;vertical-align&#58; bottom; padding&#58; 1px;&#125;</style>



<style type='text/css'>td.category&#123;font-family&#58; Verdana; color&#58; #000000;     font-size&#58; 10px;&#125;</style>

<style type='text/css'>body&#123; background-image&#58;url&#40;hintergrund.jpg&#41;; font-family&#58; Verdana; color&#58; #000000;     font-size&#58; 10px; &#125;</style>



<body>



<?php



//  -------------------------------------------------------------------------------

// CHECKING STATUS FILE AND GETTING NEW CENSUS DATA, IF NEWER FILE EXISTS

//  -------------------------------------------------------------------------------



    //  Remember to check the status file so that you are not pulling data

    //  more than once per day

    //

    $localstatusfile = "status.txt";

    $infile = fopen &#40;$localstatusfile, "r"&#41;;

    $current_timestamp = 0;

    if &#40;!$infile&#41;

    &#123;

        echo "<p>No status file available, assuming this is the first run<br>";

    &#125;

    else

    &#123;

        //  read our status file time

        $buffer = fgets&#40;$infile, 4096&#41;;

        $current_timestamp = trim&#40; $buffer &#41;;



                        // Output of last Update on top if the page

        echo '<p align="center">Letzte Aktualisierung&#58; ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$current_timestamp&#41; . '</p><br>';

    &#125;

    fclose&#40; $infile &#41;;         //  close our local status file



    $filename = "http&#58;//www.warcraftrealms.com/exports/status.txt";

    $infile = fopen &#40;$filename, "r"&#41;;   // open remote status file

    if &#40;!$infile&#41;

    &#123;

        echo "<p>Unable to open status file.<br>";

        exit;

    &#125;



    $remote_timestamp = 0;

    if&#40;!feof &#40;$infile&#41;&#41;   // only 1 read should be needed for the status file

    &#123;

        $buffer = fgets&#40;$infile, 4096&#41;;

        $remote_timestamp = trim&#40; $buffer &#41;;



            //    Output of last Update of the original Census File. Not needed, if code is working. maybe god for Update-Testing

   //     echo '<p align="center">Originale Census Datenfile&#58; ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$remote_timestamp&#41; . '</p><br>';



    &#125;

    fclose&#40; $infile &#41;;  //  close the remote status file



    if&#40; $remote_timestamp - $current_timestamp > 86400 &#41; //  1 day = 60*60*24

    &#123;

        //

        //  We can do a full get

        //



        //  write our new status file

        $outfilename = "status.txt";

        $outfile = fopen&#40;$outfilename, "w"&#41;;

        if&#40; !$outfile &#41;

        &#123;

            echo "<p>Unable to open save file => " . $outfilename . "<br>";

            exit;

        &#125;



        fputs&#40;$outfile, $buffer&#41;;

        fclose&#40;$outfile&#41;;





        //

        //  Now get our guild roster file

        //



                        //  -------------------------------------------------------------------------------

                        //    REPLACE THE URL FOR YOUR REALM FILE

        $filename = "http&#58;//www.warcraftrealms.com/exports/download.php?fname=EU-Khaz'goroth.csv.gz";

                        //  -------------------------------------------------------------------------------



        $infile = gzopen &#40;$filename, "r"&#41;;



        if &#40;!$infile&#41;

        &#123;

            echo "<p>Unable to open remote file.<br>\n";

            exit;

        &#125;



        $outfilename = "kragjinroster.csv";    // Local filename for downloaded Census Data - Normaly no need to change

        $outfile = fopen&#40;$outfilename, "w"&#41;;

        if&#40; !$outfile &#41;

        &#123;

            echo "<p>Unable to open save file => " . $outfilename . "<br>\n";

            exit;

        &#125;



        while &#40;!feof &#40;$infile&#41;&#41;

        &#123;

            $buffer = fgets&#40;$infile, 4096&#41;;

            fputs&#40;$outfile, $buffer&#41;;

        &#125;



        fclose&#40;$outfile&#41;;

        fclose&#40;$infile&#41;;

    &#125;





//  -------------------------------------------------------------------------------

//  Data download and checking is now done. Now the Data-Processing can begin.

//  -------------------------------------------------------------------------------











    $filename = "kragjinroster.csv";

    $infile = fopen &#40;$filename, "r"&#41;;

    if &#40;!$infile&#41;

    &#123;

        echo "<p>Unable to open local roster file.<br>";

        exit;

    &#125;

    //  do one read to get the header

    $buffer = fgets&#40;$infile, 4096&#41;;

            $lines = 0;

    //  read the entries

    while &#40;!feof &#40;$infile&#41;&#41;

    &#123;

        $buffer = fgets&#40;$infile, 4096&#41;;

        list&#40; $name, $race, $class, $level, $last_seen, $rank &#41; = explode&#40;",",$buffer&#41;;

                        $lines = $lines + 1;

    &#125;



            //-------------DANS SCRIPT --------------------------------



            // declaring main vars

            $horde = 0;

            $alliance = 0;

            $allianceprozent = 0;

            $hordeprozent = 0;

            $allianceratio = 0;

            $horderatio = 0;

            $druid = 0;

            $hunter = 0;

            $mage = 0;

            $paladin = 0;

            $priest = 0;

            $rogue = 0;

            $shaman = 0;

            $warlock = 0;

            $warrior = 0;



            // declaring sub-vars and vars with Strings of the Races and classes

            $rasse = array&#40;dwarf, gnome, human, nightelf, orc, tauren, troll, undead&#41;;

            $rassecaps = array&#40;"Dwarf", "Gnome", "Human", "Night Elf", "Orc", "Tauren", "Troll", "Undead"&#41;;

            $rassedeutsch = array&#40;Zwergen, Gnomen, Menschen, Nachtelfen, Ork, Tauren, Troll, Untoten&#41;;

            $klasse = array&#40;druid, hunter, mage, paladin, priest, rogue, shaman, warlock, warrior&#41;;



            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                        $&#123;$rasse&#91;$i&#93;&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.druid&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.hunter&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.mage&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.paladin&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.priest&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.rogue&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.shaman&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.warlock&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.warrior&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.unknown&#125; = 0;

                        $&#123;$rasse&#91;$i&#93;.prozent&#125; = 0;

            &#125;



            $csv = file_get_contents&#40;"kragjinroster.csv"&#41;;

            $csv = explode&#40;"\n",$csv&#41;;







            $count = 0 ;   // Z?hlt durch bis Ende Hauptarray

            while &#40;$count <= $lines&#41;

    &#123;

                        $csv&#91;$count&#93; = explode&#40;",",$csv&#91;$count&#93;&#41;;



//-----------Allianz Horde---------------

                        if &#40;$csv&#91;$count&#93;&#91;1&#93; == "Alliance"&#41; &#123;

                                      $alliance = $alliance + $csv&#91;$count&#93;&#91;5&#93;;

                        &#125; else &#123;

                                      $horde = $horde + $csv&#91;$count&#93;&#91;5&#93;;

                        &#125;

//---------------------------------------



                        for &#40;$i = 0; $i <= 7; $i++&#41; &#123;



                        // cycle through all races

                        if &#40;$csv&#91;$count&#93;&#91;2&#93; == $rassecaps&#91;$i&#93;&#41; &#123;



                                                // cycle through all classes of a race and add the number of class-race-chars to the class-racespecific countervar

                                      $&#123;$rasse&#91;$i&#93;&#125; = $&#123;$rasse&#91;$i&#93;&#125; + $csv&#91;$count&#93;&#91;5&#93;;



                                                if &#40;$csv&#91;$count&#93;&#91;3&#93; == "Druid"&#41; &#123;

                                                              $&#123;$rasse&#91;$i&#93;.druid&#125; = $&#123;$rasse&#91;$i&#93;.druid&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Hunter"&#41; &#123;

                                                              $&#123;$rasse&#91;$i&#93;."hunter"&#125; = $&#123;$rasse&#91;$i&#93;."hunter"&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Mage"&#41; &#123;

                                                             $&#123;$rasse&#91;$i&#93;.mage&#125; = $&#123;$rasse&#91;$i&#93;.mage&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Paladin"&#41; &#123;

                                                             $&#123;$rasse&#91;$i&#93;.paladin&#125; = $&#123;$rasse&#91;$i&#93;.paladin&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Priest"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.priest&#125; = $&#123;$rasse&#91;$i&#93;.priest&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Rogue"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.rogue&#125; = $&#123;$rasse&#91;$i&#93;.rogue&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Shaman"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.shaman&#125; = $&#123;$rasse&#91;$i&#93;.shaman&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Warlock"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.warlock&#125; = $&#123;$rasse&#91;$i&#93;.warlock&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; elseif &#40;$csv&#91;$count&#93;&#91;3&#93; == "Warrior"&#41; &#123;

                                                            $&#123;$rasse&#91;$i&#93;.warrior&#125; = $&#123;$rasse&#91;$i&#93;.warrior&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125; else &#123;

                                                            $&#123;$rasse&#91;$i&#93;.unknown&#125; = $&#123;$rasse&#91;$i&#93;.unknown&#125; + $csv&#91;$count&#93;&#91;5&#93;;

                                                &#125;



                                                // add the levels of a race to a race-level array

                                                $levelhelper = $csv&#91;$count&#93;&#91;4&#93;;

                                                $&#123;$rasse&#91;$i&#93;.level&#125;&#91;$levelhelper&#93; = $&#123;$rasse&#91;$i&#93;.level&#125;&#91;$levelhelper&#93; + $csv&#91;$count&#93;&#91;5&#93;;



                        &#125; else &#123;

                        &#125;

                        &#125;

                        $count = $count + 1;

            &#125;



            // sum all race-class-chars to a single race variable

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                    $druid = $druid + $&#123;$rasse&#91;$i&#93;.druid&#125;;

                                    $hunter = $hunter + $&#123;$rasse&#91;$i&#93;.hunter&#125;;

                                    $mage = $mage + $&#123;$rasse&#91;$i&#93;.mage&#125;;

                                    $paladin = $paladin + $&#123;$rasse&#91;$i&#93;.paladin&#125;;

                                    $priest = $priest + $&#123;$rasse&#91;$i&#93;.priest&#125;;

                                    $rogue = $rogue + $&#123;$rasse&#91;$i&#93;.rogue&#125;;

                                    $shaman = $shaman + $&#123;$rasse&#91;$i&#93;.shaman&#125;;

                                    $warlock = $warlock + $&#123;$rasse&#91;$i&#93;.warlock&#125;;

                                    $warrior = $warrior + $&#123;$rasse&#91;$i&#93;.warrior&#125;;

                        &#125;



// End of Data reading and writing main arrays.







//  -------------------------------------------------------------------------------

//  mathematics

//  -------------------------------------------------------------------------------



            // count all palyers an get the A-H-Ratio

            $player = $alliance + $horde;

            $allianceprozent = round&#40;$alliance / $player * 100&#41;;

            $hordeprozent = 100 - $allianceprozent;

            $allianceratio = round&#40;$allianceprozent / $hordeprozent,1&#41;;

            $horderatio = 1;



//  Get all race-Percantages and make a race-multiplier for adequate Ber-Height in the Output-Table

//  z.B. dwarfprozent

            $rasseprozentmax = 0;

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

            $&#123;$rasse&#91;$i&#93;.prozent&#125; = round&#40;$&#123;$rasse&#91;$i&#93;&#125; / $player * 100&#41;;

                        if &#40;$&#123;$rasse&#91;$i&#93;.prozent&#125; > $rasseprozentmax&#41; &#123;

                                    $rasseprozentmax = $&#123;$rasse&#91;$i&#93;.prozent&#125;;

                        &#125;

            &#125;

            $rasseprozentmulti = floor&#40;100 / $rasseprozentmax&#41;;





// Sum all Classes from Race-Class-counter

            for &#40;$j = 0; $j <= 8; $j++&#41; &#123;

                        $&#123;$klasse&#91;$j&#93;.prozent&#125; = 0;

                        for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                    $&#123;$klasse&#91;$j&#93;&#125; = $&#123;$klasse&#91;$j&#93;&#125; + $&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;&#125;;

                        &#125;

            &#125;



//  Get all Class-Percantages and make a Class-multiplier for adequate Ber-Height in the Output-Table

//  z.B. druidprozent

            $klasseprozentmax = 0;

            for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

            $&#123;$klasse&#91;$i&#93;.prozent&#125; = round&#40;$&#123;$klasse&#91;$i&#93;&#125; / $player * 100&#41;;

                        if &#40;$&#123;$klasse&#91;$i&#93;.prozent&#125; > $klasseprozentmax&#41; &#123;

                                    $klasseprozentmax = $&#123;$klasse&#91;$i&#93;.prozent&#125;;

                        &#125;

            &#125;

            $klasseprozentmulti = floor&#40;100 / $klasseprozentmax&#41;;





//  Get all race-class-Percantages and make a race-class-multiplier for adequate Ber-Height in the Output-Table

//  z.B. drwarfdruidprozent

            for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

            $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125; = 0;

            for &#40;$j = 0; $j <= 8; $j++&#41; &#123;

            $&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;.prozent&#125; = round&#40;$&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;&#125; / $&#123;$rasse&#91;$i&#93;&#125; * 100&#41;;

                        if &#40;$&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;.prozent&#125; > $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125;&#41; &#123;

                                    $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125; = $&#123;$rasse&#91;$i&#93;.$klasse&#91;$j&#93;.prozent&#125;;

                        &#125;

            &#125;

            $&#123;$rasse&#91;$i&#93;.klasseprozentmulti&#125; = floor&#40;100 / $&#123;$rasse&#91;$i&#93;.klasseprozentmax&#125;&#41;;

            &#125;



//  get all Race-level-percentages and its multiplier

//  rassenlevelprozent

            for &#40;$j = 0; $j <= 7; $j++&#41; &#123;



            $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125; = 0;

            for &#40;$i = 10; $i <= 60; $i++&#41; &#123;

            $&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$i&#93; = round&#40;$&#123;$rasse&#91;$j&#93;.level&#125;&#91;$i&#93; / $&#123;$rasse&#91;$j&#93;&#125; * 100,3&#41;;

                        if &#40;$&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$i&#93; > $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125;&#41; &#123;

                                    $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125; = $&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$i&#93;;

                        &#125;

            &#125;

            $&#123;$rasse&#91;$j&#93;.levelprozentmulti&#125; = floor&#40;50 / $&#123;$rasse&#91;$j&#93;.levelprozentmax&#125;&#41;;



            &#125;





//  get all levels from race-levels

            for &#40;$j = 10; $j <= 60; $j++&#41; &#123;

                        $level&#91;$j&#93; = 0;

                        for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                        $level&#91;$j&#93; = $level&#91;$j&#93; + $&#123;$rasse&#91;$i&#93;.level&#125;&#91;$j&#93;;

                        &#125;

            //          echo "  Level " . $j . " = " . $level&#91;$j&#93; . " !";

            &#125;





//  get all level percentages

            $levelprozentmax = 0;

            for &#40;$i = 10; $i <= 60; $i++&#41; &#123;

            $levelprozent&#91;$i&#93; = round&#40;$level&#91;$i&#93; / $player * 100,3&#41;;

                        if &#40;$levelprozent&#91;$i&#93; > $levelprozentmax&#41; &#123;

                                    $levelprozentmax = $levelprozent&#91;$i&#93;;

                        &#125;

            &#125;

            $levelprozentmulti = floor&#40;50 / $levelprozentmax&#41;;

//  --------------------------------------------------------------------------------------------

//  End of Mathematics part. Now all Vars are written an can be used f?r output

//  --------------------------------------------------------------------------------------------









//  --------------------------------------------------------------------------------------------

//  --------------------------------------------------------------------------------------------

//   GRAPHICAL OUTPUT BEGINGS.

//  --------------------------------------------------------------------------------------------

//  --------------------------------------------------------------------------------------------





//  --------------------------------------------------------------------------------------------

//  First Table with general Stats and Race and class overview, as well as all-chars-levels

//  --------------------------------------------------------------------------------------------

echo "<center>

<p>&nbsp;</p>

<table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table1\">

<tr>

    <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=2></td><td class=\"innertopright\"></td>

</tr>

<tr>

<td class=\"innerleft\"></td>

<td> <img src=\"kgcensuslogo.jpg\"> &nbsp;    </td>

<td>

    <table align=\"right\" cellpadding=0 cellspacing=0 class=\"censusinfo\" ID=\"Table2\">

        <tr>

            <td class=\"category\">Total Characters&#58;</td>

            <td class=\"category\"><b>$player</b></td>

        </tr>

        <tr>

            <td class=\"category\">Total Alliance&#58;</td>

            <td class=\"category\"><b>$alliance - $allianceprozent %</b></td>

        </tr>

        <tr>

            <td class=\"category\">Total Horde&#58;</td>

            <td class=\"category\"><b>$horde - $hordeprozent %</b></td>

        </tr>

        <tr>

            <td class=\"category\">A to H Ratio&#58;</td>

            <td class=\"category\"><b>$allianceratio &#58; $horderatio</b></td>

        </tr>

           </table>

</td>

<td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

        <table class=\"censusinfo\" ID=\"Table3\"><tr><td align=\"center\">

        <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table4\">

            <tr>

                <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=8></td><td class=\"innertopright\"></td>

            </tr>

<!--            <tr>

                <td class=\"innerleft\"></td>

                <td align=\"center\" colspan=4>Alliance</td>

                <td  align=\"center\" colspan=4>Horde</td>

                <td class=\"innerright\"></td>

            </tr>

-->            <tr>

                <td class=\"innerleft\" height=100></td>

                                                ";



                                                for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                                            echo "<td class=\"bar" . $i . "\"><img class=\"raceimg" . $i . "\" src='Census_Bar.jpg' height=\"" . $&#123;$rasse&#91;$i&#93;.prozent&#125; * $rasseprozentmulti . "\" alt=\"" . $&#123;$rasse&#91;$i&#93;&#125; . " - " . $&#123;$rasse&#91;$i&#93;.prozent&#125; . " %\"></td>";

                                                &#125;



                                       echo "

                                        <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\"></td>

                                                ";



                                                for &#40;$i = 0; $i <= 7; $i++&#41; &#123;

                                                            echo "<td class=\"bar" . $i . "\">" . $&#123;$rasse&#91;$i&#93;&#125; . "<BR />" . $&#123;$rasse&#91;$i&#93;.prozent&#125; . "%</td>";

                                                &#125;





                        echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=8></td><td class=\"innerbottomright\"></td>

            </tr>

            <tr>

                <td width=20></td>

                <td class=\"bar0\" align=\"center\"><img src='Census_Dwarf.jpg' border=0 alt=\"Zwerg\"><br>Zwerg</td>

                <td class=\"bar1\" align=\"center\"><img src='Census_Gnome.jpg' border=0 alt=\"Gnom\"><br>Gnom</td>

                <td class=\"bar2\" align=\"center\"><img src='Census_Human.jpg' border=0 alt=\"Mensch\"><br>Mensch</td>

                <td class=\"bar3\" align=\"center\"><img src='Census_NightElf.jpg' border=0 alt=\"Nacht Elf\"><br>N-Elf</td>

                <td class=\"bar4\" align=\"center\"><img src='Census_Orc.jpg' border=0 alt=\"Ork\"><br>Ork</td>

                <td class=\"bar5\" align=\"center\"><img src='Census_Tauren.jpg' border=0 alt=\"Taure\"><br>Taure</td>

                <td class=\"bar6\" align=\"center\"><img src='Census_Troll.jpg' border=0 alt=\"Troll\"><br>Troll</td>

                <td class=\"bar7\" align=\"center\"><img src='Census_Undead.jpg' border=0 alt=\"Untoter\"><br>Untoter</td>

                <td width=20></td>

            </tr>

                                    <tr><td>&nbsp;</td></tr>

        </table>

        </td>

            <td rowspan='2' height='100%'>&nbsp;</td>

        </tr><tr>

        <td align=\"center\">

        <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table5\">

            <tr>

                <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=9></td><td class=\"innertopright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\" height=100></td>

                                                ";



                                                for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                            echo "<td class=\"class_bar" . $i . "\"><img class=\"class_img" . $i . "\" src='Census_Bar.jpg' height=\"" . $&#123;$klasse&#91;$i&#93;.prozent&#125; * $klasseprozentmulti . "\" alt=\"" . $&#123;$klasse&#91;$i&#93;&#125; . " - " . $&#123;$klasse&#91;$i&#93;.prozent&#125; . " %\"></td>";

                                                &#125;



                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\"></td>

                                                ";



                                    for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                echo "<td class=\"class_bar" . $i . "\">" . $&#123;$klasse&#91;$i&#93;&#125; . "<BR />" . $&#123;$klasse&#91;$i&#93;.prozent&#125; . "%</td>";

                                                &#125;



                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=9></td><td class=\"innerbottomright\"></td>

            </tr>

            <tr>

                <td width=20></td>

                <td class=\"class_bar0\" align=\"center\"><img src='Census_Druid.jpg' border=0 alt=\"Druide\"><br>Druide</td>

                <td class=\"class_bar1\" align=\"center\"><img src='Census_Hunter.jpg' border=0 alt=\"J?ger\"><br>J?ger</td>

                <td class=\"class_bar2\" align=\"center\"><img src='Census_Mage.jpg' border=0 alt=\"Magier\"><br>Magier</td>

                <td class=\"class_bar3\" align=\"center\"><img src='Census_Paladin.jpg' border=0 alt=\"Paladin\"><br>Paladin</td>

                <td class=\"class_bar4\" align=\"center\"><img src='Census_Priest.jpg' border=0 alt=\"Priester\"><br>Priest</td>

                <td class=\"class_bar5\" align=\"center\"><img src='Census_Rogue.jpg' border=0 alt=\"Schurke\"><br>Rogue</td>

                <td class=\"class_bar6\" align=\"center\"><img src='Census_Shaman.jpg' border=0 alt=\"Schamane\"><br>Shaman</td>

                <td class=\"class_bar7\" align=\"center\"><img src='Census_Warlock.jpg' border=0 alt=\"Hexenmeister\"><br>Warlock</td>

                <td class=\"class_bar8\" align=\"center\"><img src='Census_Warrior.jpg' border=0 alt=\"Krieger\"><br>Krieger</td>

                <td width=20></td>

            </tr>

        </table>

        </td>

        </tr>

        </table>

        </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\" height=15></td>

    <td colspan=2>

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

    <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table6\">

        <tr>

            <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=51></td><td class=\"innertopright\"></td>

        </tr>

        <tr>

            <td class=\"innerleft\" height=50></td>

                                    ";





            for &#40;$j = 10; $j <= 60; $j++&#41; &#123;

                        echo "<td class='levelbar'> <img src='Census_LevelBar.jpg' height=" . $levelprozent&#91;$j&#93; * $levelprozentmulti  . " alt=\"" . $level&#91;$j&#93; . "\" width=6  border=0> </td>";

            &#125;





echo "

<td class='innerright'></td></tr><tr><td class='innerleft'></td><td class=\"category\" colspan=2 align='left'>10</td><td colspan=2></td><td class='category' colspan=3>15</td><td colspan=2></td><td class='category' colspan=3>20</td><td colspan=2></td><td class='category' colspan=3>25</td><td colspan=2></td><td class='category' colspan=3>30</td><td colspan=2></td><td class='category' colspan=3>35</td><td colspan=2></td><td class='category' colspan=3>40</td><td colspan=2></td><td class='category' colspan=3>45</td><td colspan=2></td><td class='category' colspan=3>50</td><td colspan=2></td><td class='category' colspan=3>55</td><td colspan=2></td><td class='category' colspan=2 align='right'>60</td>

            <td class=\"innerright\"></td>

        </tr>

        <tr>

            <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=51></td><td class=\"innerbottomright\"></td>

        </tr>

    </table>

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=\"2\"></td><td class=\"innerbottomright\"></td>

</tr>

</table>

<p>&nbsp;</p>

</center>";







//  --------------------------------------------------------------------------------------------

//  The 8 Tables with Race-Specific data. Only 1 Code, but repeated 8 times by the "For"-Code

//  --------------------------------------------------------------------------------------------

for &#40;$j = 0; $j <= 7; $j++&#41; &#123;



echo "<center>

<p>&nbsp;</p>

<table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table7\">

<tr>

    <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=2></td><td class=\"innertopright\"></td>

</tr>

<tr>

<td class=\"innerleft\"></td>

";



echo "<td> <img src='" . $rasse&#91;$j&#93; . ".jpg '> </td><td>&nbsp;</td>";









echo "

<td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

        <table class=\"censusinfo\" ID=\"Table8\">

                        <tr>

        <td align=\"center\">

        <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table9\">

            <tr>

                <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=9></td><td class=\"innertopright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\" height=100></td>

                                                ";



                                                for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                            echo "<td class=\"class_bar" . $i . "\"><img class=\"class_img" . $i . "\" src='Census_Bar.jpg' height=\"" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;.prozent&#125; * $&#123;$rasse&#91;$j&#93;.klasseprozentmulti&#125; . "\" alt=\"" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;&#125; . " - " . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;.prozent&#125; . " %\"></td>";

                                                &#125;



                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerleft\"></td>

                                                ";



                                    for &#40;$i = 0; $i <= 8; $i++&#41; &#123;

                                                echo "<td class=\"class_bar" . $i . "\">" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;&#125; . "<BR />" . $&#123;$rasse&#91;$j&#93;.$klasse&#91;$i&#93;.prozent&#125; . "%</td>";

                                                &#125;



                                    echo "

                <td class=\"innerright\"></td>

            </tr>

            <tr>

                <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=9></td><td class=\"innerbottomright\"></td>

            </tr>

            <tr>

                <td width=20></td>

                <td class=\"class_bar0\" align=\"center\"><img src='Census_Druid.jpg' border=0 alt=\"Druide\"><br>Druide</td>

                <td class=\"class_bar1\" align=\"center\"><img src='Census_Hunter.jpg' border=0 alt=\"J?ger\"><br>J?ger</td>

                <td class=\"class_bar2\" align=\"center\"><img src='Census_Mage.jpg' border=0 alt=\"Magier\"><br>Magier</td>

                <td class=\"class_bar3\" align=\"center\"><img src='Census_Paladin.jpg' border=0 alt=\"Paladin\"><br>Paladin</td>

                <td class=\"class_bar4\" align=\"center\"><img src='Census_Priest.jpg' border=0 alt=\"Priester\"><br>Priest</td>

                <td class=\"class_bar5\" align=\"center\"><img src='Census_Rogue.jpg' border=0 alt=\"Schurke\"><br>Rogue</td>

                <td class=\"class_bar6\" align=\"center\"><img src='Census_Shaman.jpg' border=0 alt=\"Schamane\"><br>Shaman</td>

                <td class=\"class_bar7\" align=\"center\"><img src='Census_Warlock.jpg' border=0 alt=\"Hexenmeister\"><br>Warlock</td>

                <td class=\"class_bar8\" align=\"center\"><img src='Census_Warrior.jpg' border=0 alt=\"Krieger\"><br>Krieger</td>

                <td width=20></td>

            </tr>

        </table>

        </td>

        </tr>

        </table>

        </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\" height=15></td>

    <td colspan=2>

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerleft\"></td>

    <td align=\"center\" colspan=2>

    <table class=\"censusinfo\" cellpadding=0 cellspacing=0 ID=\"Table10\">

        <tr>

            <td class=\"innertopleft\"></td><td class=\"innertop\" colspan=51></td><td class=\"innertopright\"></td>

        </tr>

        <tr>

            <td class=\"innerleft\" height=50></td>

                                    ";





            for &#40;$k = 10; $k <= 60; $k++&#41; &#123;

                        echo "<td class='levelbar'> <img src='Census_LevelBar.jpg' height=" . $&#123;$rasse&#91;$j&#93;.levelprozent&#125;&#91;$k&#93; * $levelprozentmulti  . " alt=\"" . $&#123;$rasse&#91;$j&#93;.level&#125;&#91;$k&#93; . "\" width=6  border=0> </td>";

            &#125;





echo "

<td class='innerright'></td></tr><tr><td class='innerleft'></td><td class=\"category\" colspan=2 align='left'>10</td><td colspan=2></td><td class='category' colspan=3>15</td><td colspan=2></td><td class='category' colspan=3>20</td><td colspan=2></td><td class='category' colspan=3>25</td><td colspan=2></td><td class='category' colspan=3>30</td><td colspan=2></td><td class='category' colspan=3>35</td><td colspan=2></td><td class='category' colspan=3>40</td><td colspan=2></td><td class='category' colspan=3>45</td><td colspan=2></td><td class='category' colspan=3>50</td><td colspan=2></td><td class='category' colspan=3>55</td><td colspan=2></td><td class='category' colspan=2 align='right'>60</td>

            <td class=\"innerright\"></td>

        </tr>

        <tr>

            <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=51></td><td class=\"innerbottomright\"></td>

        </tr>

    </table>

    </td>

    <td class=\"innerright\"></td>

</tr>

<tr>

    <td class=\"innerbottomleft\"></td><td class=\"innerbottom\" colspan=\"2\"></td><td class=\"innerbottomright\"></td>

</tr>

</table>

<p>&nbsp;</p>

</center>";



&#125;

    //  don't forget our credit link =&#41;

            echo "<center>";

    echo "Sourcedata by <a href='http&#58;//www.warcraftrealms.com/'>WarcraftRealms.com</a>.";

    echo "Data-handling and output by <a href='http&#58;//www.beat-solutions.de/'>D.Cron Beat-Solutions</a>.";

            echo "</center>";



?>

</body>

</html>

SSSlippy
Posts: 17
Joined: Sat Oct 08, 2005 3:49 am

Post by SSSlippy »

Anyone got a copy of the zip file. Its a bad url now.
<a href="http://www.warcraftrealms.com/profile/16037192" target="_new"><img src ="http://www.warcraftrealms.com/sig/16037192.jpg" alt="Click to view Profile" title="Click to view Profile"></a>

Post Reply