Need help cleaning up code

Questions and discussions on development tools for WarcraftRealms
Post Reply
SSSlippy
Posts: 17
Joined: Sat Oct 08, 2005 3:49 am

Need help cleaning up code

Post by SSSlippy »

Code: Select all

<style type="text/css">
  a&#58;link              &#123; font-family&#58; "Geneva", Arial, Helvetica, sans-serif; font-size&#58;   12px; color&#58; #FFFFFF; text-decoration&#58; none; &#125;
  a&#58;active            &#123; font-family&#58; "Geneva", Arial, Helvetica, sans-serif; font-size&#58;   12px; color&#58; #FFFFFF; text-decoration&#58; none; &#125;
  a&#58;visited           &#123; font-family&#58; "Geneva", Arial, Helvetica, sans-serif; font-size&#58;   12px; color&#58; #FFFFFF; text-decoration&#58; none; &#125;
  a&#58;hover             &#123; font-family&#58; "Geneva", Arial, Helvetica, sans-serif; font-size&#58;   12px; color&#58; #FA5805; text-decoration&#58; none; &#125;
	tr                  &#123; font-family&#58; "Geneva", Arial, Helvetica, sans-serif; font-size&#58;   12px; color&#58; #FFFFFF; text-decoration&#58; none; &#125;
</style>

<?php 
    // 
    //  members.php 
    //
    //  Guild Listing and Stats 
    // 
    //  Created&#58; 12/18/2005    
    // 
    //  Author&#58;  Cooper Sellers aka Rollie - Bloodscalp 
    //  Modified&#58; SSSlippy
    //

    $local_directory = "temp/";     //  this is the directory where your local files 
                                //  will be written to and read from.  Make sure 
                                //  you have WRITE priveledges on this directory 

    $guild_id        = 514799;   //  get this number from the link posted on the 
                                //  guilddisplay.php page 
    $guild_name    = "Soul Killers";     // Variables to link back to your guilds full info  
    $server_id = "49";           // on WarcraftRealms.com  
    $server_name = "Stormscale"; 

    // 
    //  Remember to check the status file so that you are not pulling data 
    //  more than once per day 
    // 
    $localstatusfile = $local_directory . "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;; 

   
    &#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;; 

 

    &#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 = $local_directory . "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 
        // 
        $filename = 'http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id; 
        $infile = fopen &#40;$filename, "r"&#41;; 
        if &#40;!$infile&#41; 
        &#123; 
            echo "<p>Unable to open remote file.<br>\n"; 
            exit; 
        &#125; 

        $outfilename = $local_directory . "guildroster.csv"; 
        $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; 
    //  Guild Stats
    //  Now let's just output our roster as it's given  
    //  
    $filename = $local_directory . "guildroster.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;;  
    //Initiallize all counts  
    $total_count=0;  
    $sixty_count=0; 
    $druid_count=0;  
    $druid_mount=0;  
    $druid_sixty=0;  
    $hunter_count=0;  
    $hunter_mount=0;  
    $hunter_sixty=0;  
    $mage_count=0;  
    $mage_mount=0;  
    $mage_sixty=0;  
    $priest_count=0;  
    $priest_mount=0;  
    $priest_sixty=0;  
    $rogue_count=0;  
    $rogue_mount=0;  
    $rogue_sixty=0;  
    $paladin_count=0;  
    $paladin_mount=0;  
    $paladin_sixty=0;  
    $warlock_count=0;  
    $warlock_mount=0;  
    $warlock_sixty=0;  
    $warrior_count=0;  
    $warrior_mount=0;  
    $warrior_sixty=0;  
    $level_count=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;;  

    $total_count = $total_count + 1;  
    $level_count = $level_count + $level;  

    if &#40;$class == "Druid"&#41;  
    &#123;  
    $druid_count = $druid_count + 1;  
        if &#40;$level>="40"&#41; &#123; $druid_mount = $druid_mount + 1; &#125;  
        if &#40;$level=="60"&#41; &#123; $druid_sixty = $druid_sixty + 1; &#125;  
    &#125;  
        else if &#40;$class  == "Hunter"&#41;  
        &#123;  
        $hunter_count = $hunter_count + 1;  
            if &#40;$level>="40"&#41; &#123; $hunter_mount = $hunter_mount + 1; &#125;  
            if &#40;$level=="60"&#41; &#123; $hunter_sixty = $hunter_sixty + 1; &#125;  
        &#125;  
            else if &#40;$class == "Mage"&#41;  
            &#123;  
            $mage_count = $mage_count + 1;  
                if &#40;$level>="40"&#41; &#123; $mage_mount = $mage_mount + 1; &#125;  
                if &#40;$level=="60"&#41; &#123; $mage_sixty = $mage_sixty + 1; &#125;  
            &#125;  
                else if &#40;$class == "Priest"&#41;  
                &#123;  
                $priest_count = $priest_count + 1;  
                    if &#40;$level>="40"&#41; &#123; $priest_mount = $priest_mount + 1; &#125;  
                    if &#40;$level=="60"&#41; &#123; $priest_sixty = $priest_sixty + 1; &#125;  
                &#125;  
                    else if &#40;$class == "Rogue"&#41;  
                    &#123;  
                    $rogue_count = $rogue_count + 1;  
                        if &#40;$level>="40"&#41; &#123; $rogue_mount = $rogue_mount + 1; &#125;  
                        if &#40;$level=="60"&#41; &#123; $rogue_sixty = $rogue_sixty + 1; &#125;  
                    &#125;  

                        else if &#40;$class == "Warlock"&#41;  
                        &#123;  
                        $warlock_count = $warlock_count + 1;  
                            if &#40;$level>="40"&#41; &#123; $warlock_mount = $warlock_mount + 1; &#125;  
                            if &#40;$level=="60"&#41; &#123; $warlock_sixty = $warlock_sixty + 1; &#125;  
                        &#125;  
                            else if &#40;$class == "Warrior"&#41;  
                            &#123;  
                            $warrior_count = $warrior_count + 1;  
                                if &#40;$level>="40"&#41; &#123; $warrior_mount = $warrior_mount + 1; &#125;  
                                if &#40;$level>="60"&#41; &#123; $warrior_sixty = $warrior_sixty + 1; &#125;  
                            &#125;  
                                else if &#40;$class == "Paladin"&#41; // Can be changed for Paladins  
                                &#123;  
                                $paladin_count = $paladin_count + 1;  
                                    if &#40;$level>="40"&#41; &#123; $paladin_mount = $paladin_mount + 1; &#125;  
                                    if &#40;$level>="60"&#41; &#123; $paladin_sixty = $paladin_sixty + 1; &#125;  
                                &#125;  
    &#125;  

    // Start of finding out the percentages of the classess  
    $druid_per = round&#40;&#40;$druid_count/$total_count&#41; * 100,1&#41;;  
    $hunter_per = round&#40;&#40;$hunter_count/$total_count&#41; * 100,1&#41;;  
    $mage_per = round&#40;&#40;$mage_count/$total_count&#41; * 100,1&#41;;  
    $priest_per = round&#40;&#40;$priest_count/$total_count&#41; * 100,1&#41;;  
    $rogue_per = round&#40;&#40;$rogue_count/$total_count&#41; * 100,1&#41;;  
    $paladin_per = round&#40;&#40;$paladin_count/$total_count&#41; * 100,1&#41;;  
    $warlock_per = round&#40;&#40;$warlock_count/$total_count&#41; * 100,1&#41;;  
    $warrior_per = round&#40;&#40;$warrior_count/$total_count&#41; * 100,1&#41;;  

    // Find out the percentages of players with mount capabilities  
    $druid_mount_per = round&#40;&#40;$druid_mount/$druid_count&#41;*100&#41;;  
    $hunter_mount_per = round&#40;&#40;$hunter_mount/$hunter_count&#41;*100&#41;;  
    $mage_mount_per = round&#40;&#40;$mage_mount/$mage_count&#41;*100&#41;;  
    $priest_mount_per = round&#40;&#40;$priest_mount/$priest_count&#41;*100&#41;;  
    $rogue_mount_per = round&#40;&#40;$rogue_mount/$rogue_count&#41;*100&#41;;  
    $paladin_mount_per = round&#40;&#40;$paladin_mount/$paladin_count&#41;*100&#41;;  
    $warlock_mount_per = round&#40;&#40;$warlock_mount/$warlock_count&#41;*100&#41;;  
    $warrior_mount_per = round&#40;&#40;$warrior_mount/$warrior_count&#41;*100&#41;;  

    // Find out the percentages of players that are 60  
    $druid_sixty_per = round&#40;&#40;$druid_sixty/$druid_count&#41;*100&#41;;  
    $hunter_sixty_per = round&#40;&#40;$hunter_sixty/$hunter_count&#41;*100&#41;;  
    $mage_sixty_per = round&#40;&#40;$mage_sixty/$mage_count&#41;*100&#41;;  
    $priest_sixty_per = round&#40;&#40;$priest_sixty/$priest_count&#41;*100&#41;;  
    $rogue_sixty_per = round&#40;&#40;$rogue_sixty/$rogue_count&#41;*100&#41;;  
    $paladin_sixty_per = round&#40;&#40;$paladin_sixty/$paladin_count&#41;*100&#41;;  
    $warlock_sixty_per = round&#40;&#40;$warlock_sixty/$warlock_count&#41;*100&#41;;  
    $warrior_sixty_per = round&#40;&#40;$warrior_sixty/$warrior_count&#41;*100&#41;;  
      
    $total_mount = $druid_mount + $hunter_mount + $mage_mount + $priest_mount + $rogue_mount + $paladin_mount + $warlock_mount + $warrior_mount;  
    $total_mount_per = round&#40;&#40;$total_mount/$total_count&#41;*100&#41;;  

    $total_sixty = $druid_sixty + $hunter_sixty + $mage_sixty + $priest_sixty + $rogue_sixty + $paladin_sixty + $warlock_sixty + $warrior_sixty;  
    $total_sixty_per = round&#40;&#40;$total_sixty/$total_count&#41;*100&#41;;  

		// Output 
    echo '<table bordercolor="#000000" border="1px" width="425">';  
    echo '<tr>';  
    echo '<td colspan="5"> <div align="center">Guild Stats - <a href=http&#58;//www.warcraftrealms.com/census.php?guildid=' . $guild_id . ' target=_guild>'. $guild_name . '</a> - <a href=http&#58;//www.warcraftrealms.com/census.php?serverid=' . $server_id . ' target=_server>' . $server_name .'</a> </div></td>';  
    echo '</tr><tr>';  
    echo '<th> <div align="center"><font color="#FA5805"><b>Class</b></font></div></th>';  
    echo '<th> <div align="center"><font color="#FA5805"><b>Count</b></font></div></th>';  
    echo '<th> <div align="center"><font color="#FA5805"><b>Percent</b></font></div></th>';  
    echo '<th> <div align="center"><font color="#FA5805"><b>Mounts</b></font></div></th>';  
    echo '<th> <div align="center"><font color="#FA5805"><b>Level 60</b></font></div></th>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Druid</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $druid_count . ' </div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $druid_per . '% </div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $druid_mount  . ' &#40;' . $druid_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $druid_sixty  . ' &#40;' . $druid_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Hunter</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $hunter_count . ' </div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $hunter_per . '% </div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $hunter_mount  . ' &#40;' . $hunter_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $hunter_sixty  . ' &#40;' . $hunter_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Mage</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $mage_count .'</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $mage_per . '%</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $mage_mount  . ' &#40;' . $mage_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $mage_sixty  . ' &#40;' . $mage_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';
    echo '<td bgcolor="#333333">Paladin</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $paladin_count . '</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $paladin_per . '%</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $paladin_mount  . ' &#40;' . $paladin_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $paladin_sixty  . ' &#40;' . $paladin_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Priest</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $priest_count .'</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $priest_per . '%</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $priest_mount  . ' &#40;' . $priest_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $priest_sixty  . ' &#40;' . $priest_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Rogue</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $rogue_count . '</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $rogue_per . '%</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $rogue_mount  . ' &#40;' . $rogue_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $rogue_sixty  . ' &#40;' . $rogue_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Warlock</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warlock_count . ' </div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warlock_per . '%</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warlock_mount  . ' &#40;' . $warlock_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warlock_sixty  . ' &#40;' . $warlock_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333">Warrior</td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warrior_count . ' </div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warrior_per . '%</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warrior_mount  . ' &#40;' . $warrior_mount_per  . '%&#41;</div></td>';  
    echo '<td bgcolor="#333333"> <div align="center">' . $warrior_sixty  . ' &#40;' . $warrior_sixty_per  . '%&#41;</div></td>';  
    echo '</tr><tr>';  
    echo '<td bgcolor="#333333"><div align="right"><strong>Total</strong></div></td>';  
    echo '<td bgcolor="#333333"><div align="center"><strong> ' . $total_count . ' </strong></div></td>';  
    echo '<td bgcolor="#333333"><div align="center">&nbsp;</div></td>';  
    echo '<td bgcolor="#333333"><div align="center"><strong> ' . $total_mount  . ' &#40;' . $total_mount_per . '%&#41;</strong></div></td>';  
    echo '<td bgcolor="#333333"><div align="center"><strong> ' . $total_sixty  . ' &#40;' . $total_sixty_per . '%&#41;</strong></div></td>';  
    echo '</tr> <tr valign="bottom">';  
    echo '</tr>';  
    echo '</table>';  
    echo $endr;  


    //  Guild Listing
    //  Now let's just output our roster as it's given 
    // 
    $filename = $local_directory . "guildroster.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;; 

    //  read the entries 
    echo '<table bordercolor="#000000" border="1px" width="425">'; 
    echo '<tr>'; 
    echo '<th><div align="center"><font color="#FA5805"><b>Name</b></font></div></th>';
    echo '<th><div align="center"><font color="#FA5805"><b>Race</b></font></div></th>'; 
    echo '<th><div align="center"><font color="#FA5805"><b>Class</b></font></div></th>';
    echo '<th><div align="center"><font color="#FA5805"><b>Level</b></font></div></th>'; 
    echo '<th><div align="center"><font color="#FA5805"><b>Last Seen</th>'; 
    echo '<th width="100"><div align="center"><font color="#FA5805"><b>Rank</th>';
    echo '<th><div align="center"><font color="#FA5805"><b>PvP Rank</th>';  
    echo '</tr>';  
    while &#40;!feof &#40;$infile&#41;&#41; 
    &#123; 
        $buffer = fgets&#40;$infile, 4096&#41;; 
        list&#40; $name, $race, $class, $level, $last_seen, $rank, $pvprank &#41; = explode&#40;",",$buffer&#41;; 
    echo '<tr>'; 
    echo '<td bgcolor="#333333"><a href="http&#58;//www.warcraftrealms.com/search.php?search=' . $name . '" target="_new">' . $name . '</a></td>'; 
    echo '<td bgcolor="#333333">' . $race . '</td>'; 
    echo '<td bgcolor="#333333">' . $class . '</td>'; 
    echo '<td bgcolor="#333333">' . $level . '</td>'; 
    echo '<td bgcolor="#333333">' . $last_seen . '</td>'; 
    echo '<td bgcolor="#333333" width="100">' . $rank . '</td>'; 
    echo '<td bgcolor="#333333"><div align="center">';
    printf &#40;"%01.0f", $pvprank&#41;;
    echo '</div></td>';
    echo '</tr>'; 
       &#125;
    echo '</table>'; 
    
    //  Guild Activity
    //  Now let's just output our roster as it's given  
    //  
    $filename = $local_directory . "guildroster.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;;  

   //Activity threshold variables in DAYS 
    $idle = 14;     //before $idle days you are active 
    $inactive = 30; //after $idle days and before $inacive day you are idle 
                        //after $inacive days you are... uhm... inacive 
    $seconds_in_a_day = 24*60*60; //self explanitory. 

   //Initiallize all counts  
    $total_count=0;  
    $inactive_count=0; 
        $inactive_01_19=0; 
        $inactive_20_39=0; 
        $inactive_40_59=0; 
        $inactive_60=0; 
    $idle_count=0; 
        $idle_01_19=0; 
        $idle_20_39=0; 
        $idle_40_59=0; 
        $idle_60=0; 
    $active_count=0; 
        $active_01_19=0; 
        $active_20_39=0; 
        $active_40_59=0; 
        $active_60=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;;  
     
    $interval = &#40;&#40;time&#40;&#41; - strtotime&#40;$last_seen&#41;&#41;/86400&#41;; //takes the interval in seconds and converts into days 

    $total_count = $total_count + 1;  

    if &#40;$interval <= $idle&#41;  &#123; 
        $active_count = $active_count + 1; 

        if &#40; $level < 20 &#41; &#123; 
        $active_01_19 = $active_01_19 + 1; 
        &#125; 
            else if &#40; $level <= 39 &#41; &#123; 
            $active_20_39 = $active_20_39 + 1; 
            &#125; 
                else if &#40; $level <=59 &#41; &#123; 
                $active_40_59 = $active_40_59 + 1; 
                &#125; 
                    else if &#40; $level == 60 &#41; &#123; 
                    $active_60 = $active_60 + 1; 
                    &#125;     
    &#125; 

    else if &#40; $interval > $idle && $interval < $inactive&#41; &#123; 
        $idle_count = $idle_count + 1; 

        if &#40; $level < 20 &#41; &#123; 
        $idle_01_19 = $idle_01_19 + 1; 
        &#125; 
            else if &#40; $level <= 39 &#41; &#123; 
            $idle_20_39 = $idle_20_39 + 1; 
            &#125; 
                else if &#40; $level <=59 &#41; &#123; 
                $idle_40_59 = $idle_40_59 + 1; 
                &#125; 
                    else if &#40; $level == 60 &#41; &#123; 
                    $idle_60 = $idle_60 + 1; 
                    &#125;         
     
    &#125; 
    else if &#40; $interval > $inactive &#41; &#123;  
        $inactive_count = $inactive_count + 1; 

        if &#40; $level < 20 &#41; &#123; 
        $inactive_01_19 = $inactive_01_19 + 1; 
        &#125; 
            else if &#40; $level <= 39 &#41; &#123; 
            $inactive_20_39 = $inactive_20_39 + 1; 
            &#125; 
                else if &#40; $level <=59 &#41; &#123; 
                $inactive_40_59 = $inactive_40_59 + 1; 
                &#125; 
                    else if &#40; $level == 60 &#41; &#123; 
                    $inactive_60 = $inactive_60 + 1; 
                    &#125; 
    &#125; 


    &#125;  

		// Stats Output
		
echo ' <table bordercolor="#000000" border="1px" width="425">';   
echo ' <tr>'; 
echo ' <th><div align="center"><font color="#FA5805"><b>Activity</b></font></div></th>';  
echo ' <th><div align="center"><font color="#FA5805"><b>1-19</b></font></div></th>';  
echo ' <th><div align="center"><font color="#FA5805"><b>20-39</b></font></div></th>';  
echo ' <th><div align="center"><font color="#FA5805"><b>40-59</b></font></div></th>';  
echo ' <th><div align="center"><font color="#FA5805"><b>60</b></font></div></th>';  
echo ' <th><div align="center"><font color="#FA5805"><b>Percent</b></font></div></th>';  
echo ' <th><div align="center"><font color="#FA5805"><b>#</b></font></div></th>'; 
echo ' </tr>'; 
echo ' <tr>';  
echo ' <td style="BACKGROUND-COLOR&#58; red">Inactive</td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red"> <div align="center">' . $inactive_01_19 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red"> <div align="center">' . $inactive_20_39 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red"> <div align="center">' . $inactive_40_59 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red"> <div align="center">' . $inactive_60 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red"> <div align="center">' . round&#40;&#40;$inactive_count/$total_count&#41;*100&#41; . '%</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red"> <div align="center">' . $inactive_count . '</div></td>'; 
echo ' </tr>'; 
echo ' <tr>';  
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805">Idle</td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805"> <div align="center">' . $idle_01_19 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805"> <div align="center">' . $idle_20_39 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805"> <div align="center">' . $idle_40_59 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805"> <div align="center">' . $idle_60 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805"> <div align="center">' . round&#40;&#40;$idle_count/$total_count&#41;*100&#41; . '%</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #FA5805"> <div align="center">' . $idle_count . '</div></td>'; 
echo ' </tr>'; 
echo ' <tr>';  
echo ' <td style="BACKGROUND-COLOR&#58; green">Active</td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; green"> <div align="center">' . $active_01_19 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; green"> <div align="center">' . $active_20_39 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; green"> <div align="center">' . $active_40_59 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; green"> <div align="center">' . $active_60 . '</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; green"> <div align="center">' . round&#40;&#40;$active_count/$total_count&#41;*100&#41; . '%</div></td>'; 
echo ' <td style="BACKGROUND-COLOR&#58; green"> <div align="center">' . $active_count . '</div></td>'; 
echo ' </tr>'; 
echo ' <tr>'; 
echo ' <td colspan="5">&nbsp;</td><td bgcolor="#333333"><b><div align="right">Total</b></div></td>'; 
echo '<td bgcolor="#333333"><div align="center"><b>' . $total_count . '</b></div></td>'; 
echo ' </tr>'; 
echo ' <tr>'; 
echo ' <td colspan="7"> <div align="center"><font size="1">Updated ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$remote_timestamp&#41; . '. Guild data provided by <a href=http&#58;//www.warcraftrealms.com target=_new>WarcraftRealms.com</a>.</font></div></td>'; 
echo ' </tr>'; 
echo ' </table>'; 
echo ' <small>* Active is defined as last login within ' . $idle . ' days.</small><br>'; 
echo ' <small>* Idle is defined as last login between ' . $idle . ' and ' . $inactive .' days.</small><br>'; 
echo ' <small>* Inactive is defined as last login after ' . $inactive . ' days.</small><br>'; 

echo $endr; 
?>
http://www.soulkillers.org/index.php?categoryid=9

Ive modified all the echos to be easier to edit. Now this isnt suppose to be as clean as it should be and I may eliminate this later as im still setting this up.
Ok my issue is that im accessing the the csv file 3x which seems like im acessing it to much. Also I have an extra row now that ive added pvp rank.
Due to my CMS adding a access the code button doesnt work.
<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>

User avatar
Xianna
Posts: 200
Joined: Mon Aug 22, 2005 8:39 am
Location: bOregon
Contact:

Post by Xianna »

i dont think its your cms. Hybuirs activity thing has a linkback for code that wont work with a cms. i did something similar for my small guild.

http://68.118.73.126/e107_plugins/custo ... roster.php


Code: Select all

<?
    $local_directory = " ";     //  this is the directory where your local files
                                //  will be written to and read from.  Make sure
                                //  you have WRITE priveledges on this directory

    $guild_id        ="18738";   //  get this number from the link posted on the
                                 //  guilddisplay.php page
   $guild_name   = "Eternal Vengeance";     // Variables to link back to your guilds full info
   $server_id = "89";           // on WarcraftRealms.com
   $server_name = "Doomhammer";

   $PHP_SELF = $_SERVER&#91;"PHP_SELF"&#93;;  //To show Source Code
   $endr = "<a href=$PHP_SELF?source>Get the Source Code</a>";
   if &#40;isset&#40;$_GET&#91;"source"&#93;&#41;&#41; &#123; // source display
       echo $endr;
       highlight_file&#40;__FILE__&#41;;
       die&#40;&#41;;
   &#125;                                 


    //
    //  Remember to check the status file so that you are not pulling data
    //  more than once per day
    //
    $localstatusfile = $local_directory . "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;;
    &#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;;
    &#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 = $local_directory . "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
        //
        $filename = 'http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id;
        $infile = fopen &#40;$filename, "r"&#41;;
        if &#40;!$infile&#41;
        &#123;
            echo "<p>Unable to open remote file.<br>\n";
            exit;
        &#125;

        $outfilename = $local_directory . "guildroster.csv";
        $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;
    //
    //  Now let's just output our roster as it's given
    //
    $filename = $local_directory . "guildroster.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;;
   //Initiallize all counts
    $total_count=0;
    $druid_count=0;
    $hunter_count=0;
    $mage_count=0;
    $priest_count=0;
    $rogue_count=0;
    $paladin_count=0;
    $warlock_count=0;
    $warrior_count=0;
    $level_count=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;;

   $total_count = $total_count + 1;
   $level_count = $level_count + $level;

   if &#40;$class == "Druid"&#41;
   &#123;
   $druid_count = $druid_count + 1;
      if &#40;$level>="40"&#41; &#123; $druid_mount = $druid_mount + 1; &#125;
   &#125;
      else if &#40;$class  == "Hunter"&#41;
      &#123;
      $hunter_count = $hunter_count + 1;
         if &#40;$level>="40"&#41; &#123; $hunter_mount = $hunter_mount + 1; &#125;
      &#125;
         else if &#40;$class == "Mage"&#41;
         &#123;
         $mage_count = $mage_count + 1;
            if &#40;$level>="40"&#41; &#123; $mage_mount = $mage_mount + 1; &#125;
         &#125;
            else if &#40;$class == "Priest"&#41;
            &#123;
            $priest_count = $priest_count + 1;
               if &#40;$level>="40"&#41; &#123; $priest_mount = $priest_mount + 1; &#125;
            &#125;
               else if &#40;$class == "Rogue"&#41;
               &#123;
               $rogue_count = $rogue_count + 1;
                  if &#40;$level>="40"&#41; &#123; $rogue_mount = $rogue_mount + 1; &#125;
               &#125;

                  else if &#40;$class == "Warlock"&#41;
                  &#123;
                  $warlock_count = $warlock_count + 1;
                     if &#40;$level>="40"&#41; &#123; $warlock_mount = $warlock_mount + 1; &#125;
                  &#125;
                     else if &#40;$class == "Warrior"&#41;
                     &#123;
                     $warrior_count = $warrior_count + 1;
                        if &#40;$level>="40"&#41; &#123; $warrior_mount = $warrior_mount + 1; &#125;
                     &#125;
                        else if &#40;$class == "paladin"&#41; // Can be changed for Paladins
                        &#123;
                        $paladin_count = $paladin_count + 1;
                           if &#40;$level>="40"&#41; &#123; $paladin_mount = $paladin_mount + 1; &#125;
                        &#125;
    &#125;

   // Start of finding out the percentages of the classess
    $druid_per = round&#40;&#40;$druid_count/$total_count&#41; * 100,1&#41;;
    $hunter_per = round&#40;&#40;$hunter_count/$total_count&#41; * 100,1&#41;;
    $mage_per = round&#40;&#40;$mage_count/$total_count&#41; * 100,1&#41;;
    $priest_per = round&#40;&#40;$priest_count/$total_count&#41; * 100,1&#41;;
    $rogue_per = round&#40;&#40;$rogue_count/$total_count&#41; * 100,1&#41;;
    $paladin_per = round&#40;&#40;$paladin_count/$total_count&#41; * 100,1&#41;;
    $warlock_per = round&#40;&#40;$warlock_count/$total_count&#41; * 100,1&#41;;
    $warrior_per = round&#40;&#40;$warrior_count/$total_count&#41; * 100,1&#41;;

  
   echo '<table ><tr valign="top"><td>';
   echo '<table bordercolor="#000000" border="1px">';
   echo ' <tr>';
   echo ' <td colspan="3"> <div align="center"><a href=http&#58;//www.warcraftrealms.com/census.php?guildid=' . $guild_id . ' target=_guild>'. $guild_name . '</a> - <a href=http&#58;//www.warcraftrealms.com/census.php?serverid=' . $server_id . ' target=_server>' . $server_name .'</a> </div></td>';
   echo ' </tr><tr>';
   echo ' <td> <div align="center">Class</div></td>';
   echo ' <td> <div align="center">Count</div></td>';
   echo ' <td bordercolor="#000000"> <div align="center">Percent</div></td>';
   echo ' </tr><tr>';
   echo ' <td>Druid</td>';
   echo ' <td> <div align="center">' . $druid_count . ' </div></td>';
   echo ' <td> <div align="center">' . $druid_per . ' </div></td>';
   echo ' </tr><tr>';
   echo ' <td>Hunter</td>';
   echo ' <td> <div align="center">' . $hunter_count . ' </div></td>';
   echo ' <td> <div align="center">' . $hunter_per . ' </div></td>';
   echo ' </tr><tr>';
   echo ' <td>Mage</td>';
   echo ' <td> <div align="center">' . $mage_count .'</div></td>';
   echo ' <td> <div align="center">' . $mage_per .'</div></td>';
   echo ' </tr><tr>';
   echo ' <td>Priest</td>';
   echo ' <td> <div align="center">' . $priest_count .'</div></td>';
   echo ' <td> <div align="center">' . $priest_per .'</div></td>';
   echo ' </tr><tr>';
   echo ' <td>Rogue</td>';
   echo ' <td> <div align="center">' . $rogue_count . '</div></td>';
   echo ' <td> <div align="center">' . $rogue_per . '</div></td>';
   echo ' </tr><tr>';
   echo ' <td>Paladin</td>';
   echo ' <td> <div align="center">' . $paladin_count . '</div></td>';
   echo ' <td> <div align="center">' . $paladin_per . '</div></td>';
   echo ' </tr><tr>';
   echo ' <td>Warlock</td>';
   echo ' <td> <div align="center">' . $warlock_count . ' </div></td>';
   echo ' <td> <div align="center">' . $warlock_per . '</div></td>';
   echo ' </tr><tr>';
   echo ' <td>Warrior</td>';
   echo ' <td> <div align="center">' . $warrior_count . ' </div></td>';
   echo ' <td> <div align="center">' . $warrior_per . ' </div></td>';
   echo ' </tr><tr>';
   echo ' <td><div align="right"><strong>Total</strong></div></td>';
   echo ' <td><div align="center"><strong> ' . $total_count . ' </strong></div></td>';
   echo ' <td><div align="center">&nbsp;</div></td>';
   echo ' </tr> <tr valign="bottom">';
   echo ' <td colspan="3"> <div align="center"><font size="1">Updated ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$remote_timestamp&#41; . ' <BR> ';
   echo ' Guild data provided by <a href=http&#58;//www.warcraftrealms.com target=_new>WarcraftRealms.com</a>.</font></div></td>';
   echo ' </tr>';
   echo '</table>';
   echo '<br>';



    $local_directory = " ";     //  this is the directory where your local files
                                //  will be written to and read from.  Make sure
                                //  you have WRITE priveledges on this directory

    $guild_id        ="18738";   //  get this number from the link posted on the
                                 //  guilddisplay.php page
   $guild_name   = "Eternal Vengeance";     // Variables to link back to your guilds full info
   $server_id = "89";           // on WarcraftRealms.com
   $server_name = "Doomhammer";

   $PHP_SELF = $_SERVER&#91;"PHP_SELF"&#93;;  //To show Source Code
   $endr = "<a href=$PHP_SELF?source>Get the Source Code</a>";
   if &#40;isset&#40;$_GET&#91;"source"&#93;&#41;&#41; &#123; // source display
       echo $endr;
       highlight_file&#40;__FILE__&#41;;
       die&#40;&#41;;
   &#125;               


    // 
    //  Remember to check the status file so that you are not pulling data 
    //  more than once per day 
    // 
    $localstatusfile = $local_directory . "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;; 
    &#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;; 
    &#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 = $local_directory . "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 
        // 
        $filename = 'http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id; 
        $infile = fopen &#40;$filename, "r"&#41;; 
        if &#40;!$infile&#41; 
        &#123; 
            echo "<p>Unable to open remote file.<br>\n"; 
            exit; 
        &#125; 

        $outfilename = $local_directory . "guildroster.csv"; 
        $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; 
    // 
    //  Now let's just output our roster as it's given 
    // 
    $filename = $local_directory . "guildroster.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;; 

   //Activity threshold variables in DAYS
    $idle = 14;     //before $idle days you are active
    $inactive = 30; //after $idle days and before $inacive day you are idle
                        //after $inacive days you are... uhm... inacive
    $seconds_in_a_day = 24*60*60; //self explanitory.

   //Initiallize all counts 
    $total_count=0; 
    $inactive_count=0;
        $inactive_01_19=0;
        $inactive_20_39=0;
        $inactive_40_59=0;
        $inactive_60=0;
    $idle_count=0;
        $idle_01_19=0;
        $idle_20_39=0;
        $idle_40_59=0;
        $idle_60=0;
    $active_count=0;
        $active_01_19=0;
        $active_20_39=0;
        $active_40_59=0;
        $active_60=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;; 
     
    $interval = &#40;&#40;time&#40;&#41; - strtotime&#40;$last_seen&#41;&#41;/86400&#41;; //takes the interval in seconds and converts into days

    $total_count = $total_count + 1; 

    if &#40;$interval <= $idle&#41;  &#123;
        $active_count = $active_count + 1;

        if &#40; $level < 20 &#41; &#123;
        $active_01_19 = $active_01_19 + 1;
        &#125;
            else if &#40; $level <= 39 &#41; &#123;
            $active_20_39 = $active_20_39 + 1;
            &#125;
                else if &#40; $level <=59 &#41; &#123;
                $active_40_59 = $active_40_59 + 1;
                &#125;
                    else if &#40; $level == 60 &#41; &#123;
                    $active_60 = $active_60 + 1;
                    &#125;     
    &#125;

    else if &#40; $interval > $idle && $interval < $inactive&#41; &#123;
        $idle_count = $idle_count + 1;

        if &#40; $level < 20 &#41; &#123;
        $idle_01_19 = $idle_01_19 + 1;
        &#125;
            else if &#40; $level <= 39 &#41; &#123;
            $idle_20_39 = $idle_20_39 + 1;
            &#125;
                else if &#40; $level <=59 &#41; &#123;
                $idle_40_59 = $idle_40_59 + 1;
                &#125;
                    else if &#40; $level == 60 &#41; &#123;
                    $idle_60 = $idle_60 + 1;
                    &#125;         
     
    &#125;
    else if &#40; $interval > $inactive &#41; &#123; 
        $inactive_count = $inactive_count + 1;

        if &#40; $level < 20 &#41; &#123;
        $inactive_01_19 = $inactive_01_19 + 1;
        &#125;
            else if &#40; $level <= 39 &#41; &#123;
            $inactive_20_39 = $inactive_20_39 + 1;
            &#125;
                else if &#40; $level <=59 &#41; &#123;
                $inactive_40_59 = $inactive_40_59 + 1;
                &#125;
                    else if &#40; $level == 60 &#41; &#123;
                    $inactive_60 = $inactive_60 + 1;
                    &#125;
    &#125;


    &#125; 

echo ' <table bordercolor="#000000" border="1px" text=black">';   
echo ' <tr>';   
echo ' <td colspan="7"><div align="center">Guild True Colors - <a href=http&#58;//www.warcraftrealms.com/census.php?guildid=' . $guild_id . ' target=_guild>'. $guild_name . '</a> - <a href=http&#58;//www.warcraftrealms.com/census.php?serverid=' . $server_id . ' target=_server>' . $server_name .'</a> </div></td>';   
echo ' </tr>';
echo ' <tr><td><div align="center"><b>Activity</b></div></td><td><div align="center"><b>1-19</b></div></td><td><div align="center"><b>20-39</b></div></td><td><div align="center"><b>40-59</b></div></td><td><div align="center"><b>60</b></div></td><td><div align="center"><b>Percent</b></div></td><td><div align="center"><b>#</b></div></td></tr>';

echo ' <tr>'; 
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000">Inactive</td>';
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000"><div align="center">' . $inactive_01_19 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000"><div align="center">' . $inactive_20_39 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000"><div align="center">' . $inactive_40_59 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000"><div align="center">' . $inactive_60 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000"><div align="center">' . round&#40;&#40;$inactive_count/$total_count&#41;*100&#41; . '%</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; red; color&#58; #000000"><div align="center">' . $inactive_count . '</div></td>';
echo ' </tr>';

echo ' <tr>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000">Idle</td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_01_19 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_20_39 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_40_59 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_60 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . round&#40;&#40;$idle_count/$total_count&#41;*100&#41; . '%</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_count . '</div></td>';
echo ' </tr>';

echo ' <tr>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000">Active</td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_01_19 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_20_39 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_40_59 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_60 . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . round&#40;&#40;$active_count/$total_count&#41;*100&#41; . '%</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_count . '</div></td>';
echo ' </tr>';

echo ' <tr>';
echo ' <td colspan="5">&nbsp;</td><td><b><div align="right">Total</b></div></td><td><b>' . $total_count . '</b></td>';
echo ' </tr>';

echo ' <tr>';
echo ' <td colspan="7"> <div align="center"><font size="1">Updated ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$remote_timestamp&#41; . '. Guild data provided by <a href=http&#58;//www.warcraftrealms.com target=_new>WarcraftRealms.com</a>.</font></div></td>';
echo ' </tr>';
echo ' </table>';

echo ' <small>* Active is defined as last login within ' . $idle . ' days.</small><br>';
echo ' <small>* Idle is defined as last login between ' . $idle . ' and ' . $inactive .' days.</small><br>';
echo ' <small>* Inactive is defined as last login after ' . $inactive . ' days.</small><br><p><p>';


//

    $local_directory = " ";     //  this is the directory where your local files
                                //  will be written to and read from.  Make sure
                                //  you have WRITE priveledges on this directory

    $guild_id        ="18738";   //  get this number from the link posted on the
                                 //  guilddisplay.php page
   $guild_name   = "Eternal Vengeance";     // Variables to link back to your guilds full info
   $server_id = "89";           // on WarcraftRealms.com
   $server_name = "Doomhammer";

   $PHP_SELF = $_SERVER&#91;"PHP_SELF"&#93;;  //To show Source Code
   $endr = "<a href=$PHP_SELF?source>Get the Source Code</a>";
   if &#40;isset&#40;$_GET&#91;"source"&#93;&#41;&#41; &#123; // source display
       echo $endr;
       highlight_file&#40;__FILE__&#41;;
       die&#40;&#41;;
   &#125;               


    // 
    //  Remember to check the status file so that you are not pulling data 
    //  more than once per day 
    // 
    $localstatusfile = $local_directory . "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;; 
    &#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;; 
    &#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 = $local_directory . "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 
        // 
        $filename = 'http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id; 
        $infile = fopen &#40;$filename, "r"&#41;; 
        if &#40;!$infile&#41; 
        &#123; 
            echo "<p>Unable to open remote file.<br>\n"; 
            exit; 
        &#125; 

        $outfilename = $local_directory . "guildroster.csv"; 
        $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; 
    // 
    //  Now let's just output our roster as it's given 
    // 
    $filename = $local_directory . "guildroster.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;; 

   //Activity threshold variables in DAYS
    $idle = 14;     //before $idle days you are active
    $inactive = 30; //after $idle days and before $inacive day you are idle
                        //after $inacive days you are... uhm... inacive
    $seconds_in_a_day = 24*60*60; //self explanitory.

   //Initiallize all counts 
    $total_countb=0; 
    $inactive_countb=0;
        $inactive_Initiate=0;
        $inactive_Alt=0;
        $inactive_Member=0;
        $inactive_Officer=0;
    $idle_countb=0;
        $idle_Initiate=0;
        $idle_Alt=0;
        $idle_Member=0;
        $idle_Officer=0;
    $active_countb=0;
        $active_Initiate=0;
        $active_Alt=0;
        $active_Member=0;
        $active_Officer=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;; 
     
    $interval = &#40;&#40;time&#40;&#41; - strtotime&#40;$last_seen&#41;&#41;/86400&#41;; //takes the interval in seconds and converts into days

    $total_countb = $total_countb + 1; 

    if &#40;$interval <= $idle&#41;  &#123;
        $active_countb = $active_countb + 1;

        if &#40; $rank == "Initiate" &#41; &#123;
        $active_Initiate = $active_Initiate + 1;
        &#125;
            else if &#40; $rank == "Alt" &#41; &#123;
            $active_Alt = $active_Alt + 1;
            &#125;
                else if &#40; $rank == "Member" &#41; &#123;
                $active_Member = $active_Member + 1;
                &#125;
                    else if &#40; $rank == "Officer" &#41; &#123;
                    $active_Officer = $active_Officer + 1;
                    &#125;     
    &#125;

    else if &#40; $interval > $idle && $interval < $inactive&#41; &#123;
        $idle_countb = $idle_countb + 1;

        if &#40; $rank == "Initiate" &#41; &#123;
        $idle_Initiate = $idle_Initiate + 1;
        &#125;
            else if &#40; $rank == "Alt" &#41; &#123;
            $idle_Alt = $idle_Alt + 1;
            &#125;
                else if &#40; $rank == "Member" &#41; &#123;
                $idle_Member = $idle_Member + 1;
                &#125;
                    else if &#40; $rank == "Officer" &#41; &#123;
                    $idle_Officer = $idle_Officer + 1;
                    &#125;         
     
    &#125;
    else if &#40; $interval > $inactive &#41; &#123; 
        $inactive_countb = $inactive_countb + 1;

        if &#40; $rank == "Initiate" &#41; &#123;
        $inactive_Initiate = $inactive_Initiate + 1;
        &#125;
            else if &#40; $rank == "Alt" &#41; &#123;
            $inactive_Alt = $inactive_Alt + 1;
            &#125;
                else if &#40; $rank == "Member" &#41; &#123;
                $inactive_Member = $inactive_Member + 1;
                &#125;
                    else if &#40; $rank == "Officer" &#41; &#123;
                    $inactive_Officer = $inactive_Officer + 1;
                    &#125;
    &#125;


    &#125; 

echo ' <table bordercolor="#000000" border="1px" text="black">';   
echo ' <tr><td><div align="center"><b>Activity</b></div></td><td><div align="center"><b>Initiate</b></div></td><td><div align="center"><b>Alt</b></div></td><td><div align="center"><b>Member</b></div></td><td><div align="center"><b>Officer</b></div></td><td><div align="center"><b>Percent</b></div></td><td><div align="center"><b>#</b></div></td></tr>';

echo ' <tr>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000">Inactive</td>';
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000"><div align="center">' . $inactive_Initiate . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000"><div align="center">' . $inactive_Alt . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000"><div align="center">' . $inactive_Member . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000"><div align="center">' . $inactive_Officer . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000"><div align="center">' . round&#40;&#40;$inactive_countb/$total_countb&#41;*100&#41; . '%</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #D6ACE0; color&#58; #000000"><div align="center">' . $inactive_countb . '</div></td>';
echo ' </tr>';

echo ' <tr>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000">Idle</td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_Initiate . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_Alt . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_Member . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_Officer . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . round&#40;&#40;$idle_countb/$total_countb&#41;*100&#41; . '%</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ffcc99; color&#58; #000000"><div align="center">' . $idle_countb . '</div></td>';
echo ' </tr>';

echo ' <tr>'; 
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000">Active</td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_Initiate . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_Alt . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_Member . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_Officer . '</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . round&#40;&#40;$active_countb/$total_countb&#41;*100&#41; . '%</div></td>';
echo ' <td style="BACKGROUND-COLOR&#58; #ccffcc; color&#58; #000000"><div align="center">' . $active_countb . '</div></td>';
echo ' </tr>';

echo ' <tr>';
echo ' <td colspan="5">&nbsp;</td><td><b><div align="right">Total</b></div></td><td><b>' . $total_countb . '</b></td>';
echo ' </tr>';
echo ' </table>';

//




echo '</td><td>';


    $local_directory = " ";//  this is the directory where your local files
                                //  will be written to and read from.  Make sure
                                //  you have WRITE priveledges on this directory

    $guild_id        = "18738"; //  get this number from the link posted on the
                                //  guilddisplay.php page
    $guild_name    = "Eternal Vengeance";     // Variables to link back to your guilds full info 
    $server_id = "89";           // on WarcraftRealms.com 
    $server_name = "Doomhammer";                                


//
//  Remember to check the status file so that you are not pulling data
//  more than once per day
//
$localstatusfile = $local_directory . "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;;

        echo 'Local status file reads &#58; ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$current_timestamp&#41; . '<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;;

        echo 'Remote status file reads &#58; ' . strftime&#40;"%m/%d/%y %H&#58;%M&#58;%S",$remote_timestamp&#41; . '<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 = $local_directory . "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
//
$filename = 'http&#58;//www.warcraftrealms.com/exports/guildexport.php?guildid=' . $guild_id;
$infile = fopen &#40;$filename, "r"&#41;;
        if &#40;!$infile&#41;
        &#123;
            echo "<p>Unable to open remote file.<br>\n";
            exit;
        &#125;

$outfilename = $local_directory . "guildroster.csv";
$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;



//
//  Now let's just output our roster as it's given
//
$filename = $local_directory . "guildroster.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;;

//  read the entries
echo '<table><tr><th>Name</th><th>Race</th><th>Class</th><th>Level</th><th>Last Seen</th><th>Rank</th></tr>';
    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;;

        echo '<tr><td>' . $name . '</td><td>' . $race . '</td><td>' . $class . '</td><td>' . $level . '</td><td>' . $last_seen . '</td><td>' . $rank . '</td></tr>';
    &#125;
    echo '</table>';

echo '</td></tr>';
echo '<center> <font size="-2">Data retrieval scripts by Cooper Sellers aka Rollie - Bloodscalp of warcraftrealms.com and Junior Dimas aka Hybuir - Boulderfist <Reapers /><br>';
echo 'scripts modified and ported for e107 by Xianna - Doomhammer <Eternal Vengeance>.  Email for plugins.<p></table>';
?>
im sure its messy as hell. i was more interested in makin it all work together WITH the cms. I was going to do another tabl to breakdown some data but i totally forgot what it was *shrug*
Image

User avatar
Ceto
Shady Dealer
Posts: 335
Joined: Sun Oct 16, 2005 8:22 pm
Location: Plymouth, NH
Contact:

Post by Ceto »

Code: Select all

   //Initiallize all counts 
    $total_count=0; 
    $druid_count=0; 
    $hunter_count=0; 
    $mage_count=0; 
    $priest_count=0; 
    $rogue_count=0; 
    $paladin_count=0; 
    $warlock_count=0; 
    $warrior_count=0; 
    $level_count=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;; 

   $total_count = $total_count + 1; 
   $level_count = $level_count + $level; 

   if &#40;$class == "Druid"&#41; 
   &#123; 
   $druid_count = $druid_count + 1; 
      if &#40;$level>="40"&#41; &#123; $druid_mount = $druid_mount + 1; &#125; 
   &#125; 
      else if &#40;$class  == "Hunter"&#41; 
      &#123; 
      $hunter_count = $hunter_count + 1; 
         if &#40;$level>="40"&#41; &#123; $hunter_mount = $hunter_mount + 1; &#125; 
      &#125; 
         else if &#40;$class == "Mage"&#41; 
         &#123; 
         $mage_count = $mage_count + 1; 
            if &#40;$level>="40"&#41; &#123; $mage_mount = $mage_mount + 1; &#125; 
         &#125; 
            else if &#40;$class == "Priest"&#41; 
            &#123; 
            $priest_count = $priest_count + 1; 
               if &#40;$level>="40"&#41; &#123; $priest_mount = $priest_mount + 1; &#125; 
            &#125; 
               else if &#40;$class == "Rogue"&#41; 
               &#123; 
               $rogue_count = $rogue_count + 1; 
                  if &#40;$level>="40"&#41; &#123; $rogue_mount = $rogue_mount + 1; &#125; 
               &#125; 

                  else if &#40;$class == "Warlock"&#41; 
                  &#123; 
                  $warlock_count = $warlock_count + 1; 
                     if &#40;$level>="40"&#41; &#123; $warlock_mount = $warlock_mount + 1; &#125; 
                  &#125; 
                     else if &#40;$class == "Warrior"&#41; 
                     &#123; 
                     $warrior_count = $warrior_count + 1; 
                        if &#40;$level>="40"&#41; &#123; $warrior_mount = $warrior_mount + 1; &#125; 
                     &#125; 
                        else if &#40;$class == "paladin"&#41; // Can be changed for Paladins 
                        &#123; 
                        $paladin_count = $paladin_count + 1; 
                           if &#40;$level>="40"&#41; &#123; $paladin_mount = $paladin_mount + 1; &#125; 
                        &#125; 
    &#125;
Hmm... That logic is roughly equivalent to:

Code: Select all

// initialize
$level_total = $character_count = 0;
$class_count = $mount_count = array&#40;&#41;;

$classes = array&#40;"Hunter","Rogue","Mage","Warlock","Priest","Warrior","Druid","Paladin","Shaman"&#41;;

foreach&#40;$classes as $class&#41; &#123;
   $class_count&#91;$class&#93; = 0;
   $mount_count&#91;$class&#93; = 0;
&#125;

// loop through the rows
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;;

   $character_count++;
   $level_total += $level;

   $class_count&#91;$class&#93;++;
   if&#40;$level >= 40&#41; $mount_count&#91;$class&#93;++;
&#125;
;)
Image

Hybuir
Gear Dependent Squirrel
Gear Dependent Squirrel
Posts: 1471
Joined: Tue Sep 06, 2005 6:22 am
Location: Austin, TX
Contact:

Post by Hybuir »

If you have a domain name, I can host it for yout if you want. Free ;-) a friend lets me have a reseller on his serv.

User avatar
Xianna
Posts: 200
Joined: Mon Aug 22, 2005 8:39 am
Location: bOregon
Contact:

Post by Xianna »

we havent bought a domain name yet, which is why im hosting the stupid thing. ty for the offer and ill let ya know when we get off our arses. i assume its a nice fast server that will let me have all the php sql stuff i want and actually load faster than 5secs/page? *grinz*

Hybuir
Gear Dependent Squirrel
Gear Dependent Squirrel
Posts: 1471
Joined: Tue Sep 06, 2005 6:22 am
Location: Austin, TX
Contact:

Post by Hybuir »


Skyfire
Trolling Enforcement
Posts: 708
Joined: Thu Aug 18, 2005 2:29 am
Location: New Jersey

Post by Skyfire »

Hybuir wrote:yep yep :cough:http://juniordimas.com/sys/:cough
Nice try Hybuir.

If I can see that, I bet Rollie will see that =P
Admin on WoWWiki
Moderator, Blogger on Wowhead

Hybuir
Gear Dependent Squirrel
Gear Dependent Squirrel
Posts: 1471
Joined: Tue Sep 06, 2005 6:22 am
Location: Austin, TX
Contact:

Post by Hybuir »

For just your everyday joe-schmo website that you think people will look at but really wont (like mine) it's an easy host. Plus you don't get ripped off $8/month for it. $8 is like a #2 with cheeze and upsized at Dairy Queen... WITH A $1 TIP!!

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

Post by SSSlippy »

Im having a problem where the page isnt updating. Anyone got any ideas?
<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>

Hybuir
Gear Dependent Squirrel
Gear Dependent Squirrel
Posts: 1471
Joined: Tue Sep 06, 2005 6:22 am
Location: Austin, TX
Contact:

Post by Hybuir »

A quick fix might be to put your status.txt to just say 1, that way it auto loads the guildroster.txt.

Post Reply