Jump to content

Ashen

Members
  • Posts

    34
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by Ashen

  1. ....

    if($num_online < 1) {

    echo "<tr><td colspan='4' align='center'>No Players Online!</td></tr>";

    }

    for($i=0; $i<$num_online; $i++) {

    $row = mysql_fetch_array($result);

    $t_name = $row['name'];

    $t_race = $row['race'];

    $t_class = $row['class'];

    $t_lvl = $row['level'];

    $t_map = $row['map'];

    $t_gender = $row['gender'];

    echo "<tr>

    <td>$t_name</td>";

    echo "<td>$race[$t_race]</td>";

    echo "<td>$class[$t_class]</td>";

    echo "<td>$t_lvl</td>";

    echo "<td>$map[$t_map]</td>";

    echo "<td>$gender[$t_gender]</td>

    </tr>";

    }

    ....

    Less variables,

    Less cycles unnecessary,

    Less execution time.

        if($num_online > 0) 
       {
           while (($row = mysql_fetch_array($result)) != false)
           {
               echo "<tr>" .
                    "<td>[b]" . $row['name'] . "[/b]</td>" .
                    "<td>[b]" . $row['race'] . "[/b]</td>" .
                    "<td>[b]" . $row['class'] . "[/b]</td>" .
                    "<td>[b]" . $row['level'] . "[/b]</td>" .
                    "<td>[b]" . $row['map'] . "[/b]</td>" .
                    "<td>[b]" . $row['gender'] . "[/b]</td>" .
                    "</tr>";
           }
       }
       else
       {
           echo "<tr>" . 
                "<td colspan='6' align='center'>No Players Online!</td>" .
                "</tr>";
       }
    

  2. From DBC file.

    ID    Name
    ------------------------------------------
    
    0    Eastern Kingdoms
    1    Kalimdor
    13    Testing
    25    Scott Test
    29    CashTest
    30    Alterac Valley
    33    Shadowfang Keep
    34    Stormwind Stockade
    35    <unused>StormwindPrison
    36    Deadmines
    37    Azshara Crater
    42    Collin's Test
    43    Wailing Caverns
    44    <unused> Monastery
    47    Razorfen Kraul
    48    Blackfathom Deeps
    70    Uldaman
    90    Gnomeregan
    109    Sunken Temple
    129    Razorfen Downs
    169    Emerald Dream
    189    Scarlet Monastery
    209    Zul'Farrak
    229    Blackrock Spire
    230    Blackrock Depths
    249    Onyxia's Lair
    269    Opening of the Dark Portal
    289    Scholomance
    309    Zul'Gurub
    329    Stratholme
    349    Maraudon
    369    Deeprun Tram
    389    Ragefire Chasm
    409    Molten Core
    429    Dire Maul
    449    Alliance PVP Barracks
    450    Horde PVP Barracks
    451    Development Land
    469    Blackwing Lair
    489    Warsong Gulch
    509    Ruins of Ahn'Qiraj
    529    Arathi Basin
    530    Outland
    531    Ahn'Qiraj Temple
    532    Karazhan
    533    Naxxramas
    534    The Battle for Mount Hyjal
    540    Hellfire Citadel: The Shattered Halls
    542    Hellfire Citadel: The Blood Furnace
    543    Hellfire Citadel: Ramparts
    544    Magtheridon's Lair
    545    Coilfang: The Steamvault
    546    Coilfang: The Underbog
    547    Coilfang: The Slave Pens
    548    Coilfang: Serpentshrine Cavern
    550    Tempest Keep
    552    Tempest Keep: The Arcatraz
    553    Tempest Keep: The Botanica
    554    Tempest Keep: The Mechanar
    555    Auchindoun: Shadow Labyrinth
    556    Auchindoun: Sethekk Halls
    557    Auchindoun: Mana-Tombs
    558    Auchindoun: Auchenai Crypts
    559    Nagrand Arena
    560    The Escape From Durnholde
    562    Blade's Edge Arena
    564    Black Temple
    565    Gruul's Lair
    566    Eye of the Storm
    568    Zul'Aman
    571    Northrend
    572    Ruins of Lordaeron
    573    ExteriorTest
    574    Utgarde Keep
    575    Utgarde Pinnacle
    576    The Nexus
    578    The Oculus
    580    The Sunwell
    582    Transport: Rut'theran to Auberdine
    584    Transport: Menethil to Theramore
    585    Magister's Terrace
    586    Transport: Exodar to Auberdine
    587    Transport: Feathermoon Ferry
    588    Transport: Menethil to Auberdine
    589    Transport: Orgrimmar to Grom'Gol
    590    Transport: Grom'Gol to Undercity
    591    Transport: Undercity to Orgrimmar
    592    Transport: Borean Tundra Test
    593    Transport: Booty Bay to Ratchet
    594    Transport: Howling Fjord Sister Mercy (Quest)
    595    The Culling of Stratholme
    596    Transport: Naglfar
    597    Craig Test
    598    Sunwell Fix (Unused)
    599    Halls of Stone
    600    Drak'Tharon Keep
    601    Azjol-Nerub
    602    Halls of Lightning
    603    Ulduar
    604    Gundrak
    605    Development Land (non-weighted textures)
    606    QA and DVD
    607    Strand of the Ancients
    608    Violet Hold
    609    Ebon Hold
    610    Transport: Tirisfal to Vengeance Landing
    612    Transport: Menethil to Valgarde
    613    Transport: Orgrimmar to Warsong Hold
    614    Transport: Stormwind to Valiance Keep
    615    The Obsidian Sanctum
    616    The Eye of Eternity
    617    Dalaran Sewers
    618    The Ring of Valor
    619    Ahn'kahet: The Old Kingdom
    620    Transport: Moa'ki to Unu'pe
    621    Transport: Moa'ki to Kamagua
    622    Transport: Orgrim's Hammer
    623    Transport: The Skybreaker
    624    Vault of Archavon
    628    Isle of Conquest
    631    Icecrown Citadel Raid
    632    Forge of Souls
    641    Transport: A Airship (BG)
    642    Transport: H Airship (BG)
    647    Transport: Orgrimmar to Thunderbluff
    649    Argent Tournament Raid
    650    Argent Tournament Dungeon
    658    Pit Of Saron
    668    Halls of Reflection
    672    Transport: A Airship (ICC Raid)
    673    Transport: H Airship (ICC Raid)
    712    Transport: A Airship (ICC Dungeon)
    713    Transport: H Airship (ICC Dungeon)
    718    Transport: The Mighty Wind (ICC Raid)
    723    Stormwind
    724    The Ruby Sanctum 
    

  3. Noob alert. Can someone post a small tutorial as to...what to do with these scripts?...

    <?
    
          // Include the configuration file ([i]definitions of username, password, host, ecc[/i]) into the index.php file.
          [b]require_once ('config.php');[/b]
    
          // Connect to the database and sets a resource link to variable "$conn".
          [b]$conn = mysql_connect($host, $user, $pass) or die('Connection failed: ' . mysql_error());[/b]
    
          // Selects the database such as "realmd", "mangos", ecc.
          [b]mysql_select_db($mangoscharacters, $conn) or die('Select DB failed: ' . mysql_error());[/b]
    
          // Executes the string query on resource link "$conn".
          [b]$result = mysql_query("SELECT Count(Online) FROM `characters` WHERE `online` = 1", $conn);[/b]
    
          // Splits the first row into an associative array.
          [b]$row = mysql_fetch_array($result);[/b]
    
          // Print to screen a value of field "count(online)".
          [b]echo $row["Count(Online)"];[/b]
    
    ?> 

    You must use the script into a PHP file such as: index.php.

  4. i need script for

    - unstuck

    - bancheck ip , bancheckacc , bancheckchar ==> ( login and bancheck )

    Check BanIP (realmd database)

    $res = mysql_query("SELECT ip from ip_banned WHERE ip = '".$_SERVER["REMOTE_ADDR"]."' LIMIT 1");

    Check BanAcc (realmd database)

    $res = mysql_query("SELECT a.id FROM account_banned a WHERE a.id = (SELECT b.id FROM account b WHERE username = "#username_to_upper" LIMIT 1) LIMIT 1");

    PHP Check on "Num Rows"

    <?php
    
        if(mysql_num_rows($res) > 0)
              echo "Banned";
        else {
              // other procedures....
        }
    
    ?>

  5. If you have problems with "mod_rewrite" you must replace all links (like in "_layout\\character\\sheet.xsl"), that point to root or character-model, from ".xml" to ".php".

    For example:

    var flashvars = { character: theCharName, modelUrl: "character-model.php?"+encodeURIComponent(charUrl), fileServer: "models/", 
    embedlink:encodeURIComponent(embedlink), strings:stringslink, logoImg:logolink, embedded:true,
    loadingtxt:"<xsl:value-of select="$loc/strs/common/str[@id='loading']"/>" //"
    };
    

  6.    public class SQL
       {
           // Download DLL: mysql.data (mysql site)
    
           MySql.Data.MySqlClient.MySqlConnection Conn;
           MySql.Data.MySqlClient.MySqlCommand Cmd;
           MySql.Data.MySqlClient.MySqlDataReader Reader;
    
           //===========================================================================================
    
           ~SQL()
           {
               // Garbage Collection
               System.GC.Collect(System.GC.GetGeneration(this), System.GCCollectionMode.Forced);
           }
    
           public SQL(string address, string db, string user, string pass)
           {
               try
               {
                   Conn = new MySql.Data.MySqlClient.MySqlConnection("SERVER=" + address + "; DATABASE=" + db + "; UID=" + user + "; PASSWORD=" + pass + ";");
                   Cmd = Conn.CreateCommand();
                   Cmd.CommandTimeout = 1000;
               }
               catch (MySql.Data.MySqlClient.MySqlException)
               {
                   // debug
               }
    
               // Garbage Collection
               System.GC.Collect(System.GC.GetGeneration(this), System.GCCollectionMode.Forced);
           }
    
           //===========================================================================================
    
           public string RunQuery(string cmdquery)
           {
               Cmd.CommandText = string.Empty;
               string query_result = string.Empty;
               int rowsAffected = 0;
               //---->
               try
               {
                   Cmd.CommandText = cmdquery;
                   //---->
                   Conn.Open();
                   Reader = Cmd.ExecuteReader();
                   //---->
                   while (Reader.Read())
                   {
                       // [FIX] Multi-Threading - 100% CPU
                       System.Threading.Thread.Sleep(1);
    
                       if (rowsAffected > 0) query_result += ",";
                       rowsAffected++;
                       //---->
                       for (int i = 0; i < Reader.FieldCount; i++)
                       {
                           if (i == 0) query_result += ((Reader.GetValue(i).ToString() != "") ? Reader.GetValue(i).ToString() : "Null");
                           else query_result += "," + ((Reader.GetValue(i).ToString() != "") ? Reader.GetValue(i).ToString() : "Null");
                       }
                   }
                   //---->
                   if (query_result.Trim() == string.Empty)
                       query_result = rowsAffected.ToString();
               }
               catch (MySql.Data.MySqlClient.MySqlException)
               {
                   // debug
    
                   // Garbage Collection
                   System.GC.Collect(System.GC.GetGeneration(this), System.GCCollectionMode.Forced);
               }
               //---->
               Conn.Close();
    
               return query_result;
           }
       }

    Why not insert directly into the database instead of create a file?

    In this way saves time ^_^

  7. Try this.

    <?php
    
       include ("config.php");
       //---->
       $characters = mysql_connect("$host", "$user", "$pass")
                            or die('Connection Failed');
       //---->
       mysql_select_db ("$mangosrealm");
       //---->
       $result = mysql_query("SELECT b.username, a.rank, a.points FROM voting_points a INNER JOIN account b ON (a.id = b.id) ORDER BY a.points DESC LIMIT 20;"); 
    
    ?>
       <table align=center cellpadding="0" cellspacing="0"  border="1" width="350px">
           <thead>            
               <tr>
                   <td colspan="3">
                       <div align="center" style="font-size:14px; color:#ffcc00;">
                           [b]Top Voter[/b]
                       </div>
                   </td>
               </tr>        
               <tr>
                   <td width="40%"><center>AccountName</center></td>
           <td width="30%"><center>Rank</center></td>
           <td width="30%"><center>Point</center></td>        
               </tr>
           </thead>
           <tbody>
    
    <?php
    
       while(($rows = mysql_fetch_object($result)) != false) 
       { 
           echo "<tr>" .
           "<td>[i]" . $rows->username . "[/i]</td>" .
           "<td><center>" . $rows->rank . "</center></td>" .
           "<td><center>" . $rows->points . "</center></td>" .
           "</tr>"; 
       } 
       //---->
       mysql_free_result($result);
       mysql_close($characters);
    
    ?>
    
           </tbody>
       </table>

  8. mmm try to check yours php.ini configuration.

    if it isn't set you must change the following settings.

    ; Common Values:

    ; Default Value: E_ALL & ~E_NOTICE

    ; Development Value: E_ALL | E_STRICT

    ; Production Value: E_ALL & ~E_DEPRECATED

    error_reporting = E_ALL | E_STRICT

    ; Possible Values:

    ; Off = Do not display any errors

    ; stderr = Display errors to STDERR (affects only CGI/CLI binaries!)

    ; On or stdout = Display errors to STDOUT

    display_errors = On

    Path php.ini :: ex. C:\\Program Files\\PHP\\php.ini

  9. ERROR [30-07-2010 05:41:12]: Utils::CheckConfigRealmData : realm data for realm "Deathwing" was not added to `armory_realm_data` table. Please, execute this query manually: "REPLACE INTO `armory_realm_data` (`id`, `name`)

    You must add data about the realm into armory_realm_data.

    For exemple:

    - 1 (id)

    - MaNGOS1 (name)

    - 333 (version)

    - other realm data...

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use