Changeset 89 for db


Ignore:
Timestamp:
Sep 30, 2007, 12:28:52 PM (17 years ago)
Author:
hosiplan
Message:

Šmelím config.php takže tu možá teď proběhne pár verzí bez komentáře

Location:
db
Files:
4 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • db/config.sample.php

    r84 r89  
    44  'Database' => array(
    55    'Host' => 'localhost',
    6     'User' => 'webdesign',
    7     'Password' => '332dbe5e1cc3c4d10712e4e71d99a484'
     6    'User' => 'root',
     7    'Password' => 'gurubashi'
    88  ),
    99  'Style' => 'maron',
     
    1313    'SilverDBVersion' => '0.7',
    1414    'SilverDBRevision' => '208',
    15     'ClientVersion' => '2.1.3',
    16     'MaxOnlinePlayers' => 100,
    17     'RequiredOnlinePlayers' => 70,
     15    'ClientVersion' => '2.1.3'
    1816  ),
    1917  'DB_read' => array(
    2018    'Charset' => 'utf-8',
    21     'Database' => 'mangos_test',
     19    'Database_mangos' => 'mangos',
     20    'Database_realmd' => 'realmd',
     21    'Database_web' => 'wow',
    2222    'Description' => 'Neoficiální herní server hry World of Warcraft',
    2323    'Title' => 'Heroes of Fantasy - Databáze',
  • db/index.php

    r82 r89  
    1212  @mysql_connect( $Config['DB_read']['Database']['Host'], $Config['DB_read']['Database']['User'], $Config['DB_read']['Database']['Password'] )
    1313    OR DIE("<p>Vyskytla se chyba a nelze se připojit k databázi.<br> Zkuste to později.</p>");
    14   @mysql_select_db($Config['DB_read']['DB_read']['Database'])
    15     OR DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database']."!</p>");
     14  $DB_mangos = mysql_select_db($Config['DB_read']['DB_read']['Database_mangos']);
     15    if( !$DB_mangos ){ DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_mangos']."!</p>"); };
     16/*  $DB_realmd = mysql_select_db($Config['DB_read']['DB_read']['Database_realmd']);
     17    if( !$DB_realmd ){ DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_realmd']."!</p>"); };
     18  $DB_web = mysql_select_db($Config['DB_read']['DB_read']['Database_web']);
     19    if( !$DB_web ){ DIE("<p>Nepodařilo se nastavit pracovní databázi ".$Config['DB_read']['DB_read']['Database_web']."!</p>"); }; */
    1620  @mysql_query("SET NAMES ".$Config['DB_read']['DB_read']['Charset']);
    1721
     
    2933    };
    3034
    31   function StranovaniVypisu($sql, $limit, $nastranu, $adresa, $SID){
    32     $pocet_radku = @mysql_num_rows(mysql_query($sql));
     35  function StranovaniVypisu($sql, $limit, $nastranu, $adresa, $SID ,$DB){
     36    $pocet_radku = @mysql_num_rows(mysql_query($sql,$DB));
    3337    if( $pocet_radku > 0 ) {
    3438      $listovani = $pocet_radku/10;
     
    101105    };
    102106
    103   function SQLselect_Strankovani($dotaz, $limit, $nastranu, $adresa, $SID){
    104     $navigace = StranovaniVypisu($dotaz, $limit, $nastranu, $adresa, $SID);
    105     $dotaz =  @mysql_query($dotaz." LIMIT ".(--$limit*10*($nastranu/10)).", $nastranu ");
     107  function SQLselect_Strankovani($dotaz, $limit, $nastranu, $adresa, $SID, $DB){
     108    $navigace = StranovaniVypisu($dotaz, $limit, $nastranu, $adresa, $SID, $DB);
     109    $dotaz =  @mysql_query($dotaz." LIMIT ".(--$limit*10*($nastranu/10)).", $nastranu ",$DB);
    106110    $vysledek = array( '1'           => $dotaz,
    107111                       'strankovani' => $navigace );
  • db/obsah.php

    r84 r89  
    55            if( $id == "uvod" ){ $file = "uvod"; $nadpis = "Úvod"; }
    66            elseif( $id == "stats" ){ $file = "stats"; $nadpis = "Statistiky"; }
     7            elseif( $id == "bugreport" ){ $file = "bug_report"; $nadpis = "Systém pro opravu chyb"; }
    78            elseif( $id == "races" ){ $file = "races"; $nadpis = "Rasy"; }
    89            elseif( $id == "classes" ){ $file = "classes"; $nadpis = "Povolání"; }
     
    3435            }
    3536          elseif( !empty($quest) ){
    36             $quest_dotaz_nadpis =  mysql_query("SELECT `Title` FROM `quest_template` WHERE `entry`='".$quest."' LIMIT 1");
     37            $quest_dotaz_nadpis =  mysql_query("SELECT `Title` FROM `quest_template` WHERE `entry`='".$quest."' LIMIT 1",$DB_mangos);
    3738            if( mysql_num_rows($quest_dotaz_nadpis) == "1" ) { $i = "0";
    3839              $result = MySQL_Fetch_Array($quest_dotaz_nadpis);
     
    4344            }
    4445          elseif( !empty($creature) ){
    45             $creature_dotaz_nadpis =  mysql_query("SELECT `name`,`subname` FROM `creature_template` WHERE `entry`='".$creature."' LIMIT 1");
     46            $creature_dotaz_nadpis =  mysql_query("SELECT `name`,`subname` FROM `creature_template` WHERE `entry`='".$creature."' LIMIT 1",$DB_mangos);
    4647            if( mysql_num_rows($creature_dotaz_nadpis) == "1" ) { $i = "0";
    4748              $result = @MySQL_Fetch_Array($creature_dotaz_nadpis);
  • db/post_read.php

    r84 r89  
    77if( !empty($q) AND !empty($id) ){
    88  if( !empty($lvl_d) AND !empty($lvl_h) ){ $where = "(`MinLevel`>='$lvl_d' AND `MinLevel`<='$lvl_h') AND "; };
    9   $sql_select = SQLselect_Strankovani("SELECT * FROM quest_template WHERE ( $where`Title` LIKE '%$q%' )", $limit, 20, "?id=questy&amp;q=".$q."&amp;lvl_d=".$lvl_d."&amp;lvl_h=".$lvl_h, $SID);
     9  $sql_select = SQLselect_Strankovani("SELECT * FROM quest_template WHERE ( $where`Title` LIKE '%$q%' )", $limit, 20, "?id=questy&amp;q=".$q."&amp;lvl_d=".$lvl_d."&amp;lvl_h=".$lvl_h, $SID, $DB_mangos);
    1010  if( @mysql_num_rows($sql_select[1]) > 0 ){ $i = 0;
    1111    $sql_select['result'] .= "<table width=\"100%\" class=\"search_result\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n";
     
    1818      $sql_select['result'] .= "<td>";
    1919
    20         $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ");
     20        $startovni_creature_dotaz = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$result['entry']." ",$DB_mangos);
    2121        while( $start_creature = @MySQL_Fetch_Array($startovni_creature_dotaz) ){
    2222          $sql_select['result'] .= "<a href=\"index.php?creature=".$start_creature['entry']."\">".$start_creature['name']."</a><br>";
    2323          };
    24         $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ");
     24        $startovni_gameobject_dotaz = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$result['entry']." ",$DB_mangos);
    2525        while( $start_gameobject = @MySQL_Fetch_Array($startovni_gameobject_dotaz) ){
    2626          $sql_select['result'] .= "<a href=\"index.php?gameobject=".$start_gameobject['entry']."\">".$start_gameobject['name']."</a><br>";
     
    3737  }
    3838elseif( !empty($quest) AND empty($id) ){
    39   $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='$quest' LIMIT 1;");
     39  $sql_select['sql'] = mysql_query("SELECT * FROM quest_template WHERE `entry`='$quest' LIMIT 1;",$DB_mangos);
    4040  if( @mysql_num_rows($sql_select['sql']) > 0 ){ $i = 0;
    4141    $result = MySQL_Fetch_Array($sql_select['sql']);
     
    4343
    4444    // Zjištění creatur a gameobjectů kde se Quest dá vzít
    45     $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$sql_select['quest']['entry']." ");
     45    $startovni_NPC_dotaz_creature = mysql_query("SELECT * FROM creature_template LEFT JOIN creature_questrelation ON creature_questrelation.id = creature_template.entry WHERE creature_questrelation.quest =".$sql_select['quest']['entry']." ",$DB_mangos);
    4646      if( @mysql_num_rows($startovni_NPC_dotaz_creature) > 0 ){
    4747        while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_creature)){
    4848        $sql_select['other']['StartNPC'] .= "<a href=\"index.php?creature=".$start_NPC['entry']."\">".$start_NPC['name']."</a><br>\n";
    4949        }; };
    50     $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$sql_select['quest']['entry']." ");
     50    $startovni_NPC_dotaz_gameobject = mysql_query("SELECT * FROM gameobject_template LEFT JOIN gameobject_questrelation ON gameobject_questrelation.id = gameobject_template.entry WHERE gameobject_questrelation.quest =".$sql_select['quest']['entry']." ",$DB_mangos);
    5151      if( @mysql_num_rows($startovni_NPC_dotaz_gameobject) > 0 ){
    5252        while($start_NPC = @MySQL_Fetch_Array($startovni_NPC_dotaz_gameobject)){
     
    6161
    6262    // Důležitá věc
    63     $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$sql_select['quest']['SrcItemId']." LIMIT 1;");
     63    $SrcItemId_dotaz = mysql_query("SELECT * FROM item_template WHERE entry =".$sql_select['quest']['SrcItemId']." LIMIT 1;",$DB_mangos);
    6464    if( @mysql_num_rows($SrcItemId_dotaz) > 0 ){
    6565        $SrcItemId = @MySQL_Fetch_Array($SrcItemId_dotaz);
     
    107107  }
    108108elseif( !empty($creature) AND empty($id) ){
    109   $sql_select['sql'] = mysql_query("SELECT * FROM creature_template WHERE `entry`='$creature' LIMIT 1;");
     109  $sql_select['sql'] = mysql_query("SELECT * FROM creature_template WHERE `entry`='$creature' LIMIT 1;",$DB_mangos);
    110110  if( @mysql_num_rows($sql_select['sql']) > 0 ){ $i = 0;
    111111    $result = MySQL_Fetch_Array($sql_select['sql']);
    112112    $sql_select['creature'] = $result;
    113113
    114     $questy_dotaz_creature = mysql_query("SELECT * FROM `creature_questrelation` LEFT JOIN `quest_template` ON `creature_questrelation`.`quest` = `quest_template`.`entry` WHERE (`creature_questrelation`.`id` =".$sql_select['creature']['entry']." AND `quest_template`.`PrevQuestId`=0 ) ");
     114    $questy_dotaz_creature = mysql_query("SELECT * FROM `creature_questrelation` LEFT JOIN `quest_template` ON `creature_questrelation`.`quest` = `quest_template`.`entry` WHERE (`creature_questrelation`.`id` =".$sql_select['creature']['entry']." AND `quest_template`.`PrevQuestId`=0 ) ",$DB_mangos);
    115115      if( @mysql_num_rows($questy_dotaz_creature) > 0 ){
    116116        while($quest_NPC = @MySQL_Fetch_Array($questy_dotaz_creature)){
Note: See TracChangeset for help on using the changeset viewer.