SQLCommand('SET NAMES '.$Config['Database']['Charset']); $Database->SelectDatabase($Config['Database']['Database']); if (Licence(2)) { // echo 'Přístup povolen'; } else { die('Přístup zamítnut!'); } function set_name($text) { global $buffer; $text = substr($text, strpos($text, '$g')+2, strlen($text)-strpos($text, '$g')); $text = substr($text, 0, strpos($text, ';')); $men = substr($text, 0, strpos($text, ':')); $women = substr($text, strpos($text, ':')+1, strlen($text)-strpos($text, ':')+1); if (isset($buffer[$men]) == false and ($men <> '') and ($women <> '') and (strlen($men) < 10) and (strlen($women) < 10)) { $buffer[$men] = $women; // echo $men.' '.$women.'
'; } } $sql = "SELECT `Language` , `Details` , `Objectives` , `OfferRewardText` , `RequestItemsText` , `EndText` , `ObjectiveText1` , `ObjectiveText2` , `ObjectiveText3` , `ObjectiveText4` FROM `quests` WHERE `Details` LIKE '%\$G%' OR `Objectives` LIKE '%\$G%' OR `OfferRewardText` LIKE '%\$G%' OR `RequestItemsText` LIKE '%\$G%' OR `EndText` LIKE '%\$G%' OR `ObjectiveText1` LIKE '%\$G%' OR `ObjectiveText2` LIKE '%\$G%' OR `ObjectiveText3` LIKE '%\$G%' OR `ObjectiveText4` LIKE '%\$G%' OR `Details` LIKE '%\$g%' OR `Objectives` LIKE '%\$g%' OR `OfferRewardText` LIKE '%\$g%' OR `RequestItemsText` LIKE '%\$g%' OR `EndText` LIKE '%\$g%' OR `ObjectiveText1` LIKE '%\$g%' OR `ObjectiveText2` LIKE '%\$g%' OR `ObjectiveText3` LIKE '%\$g%' OR `ObjectiveText4` LIKE '%\$g%'"; // echo $sql.'

'; $ID = $Database->SQLCommand($sql); while ($Line = mysql_fetch_array($ID)) { // $language = $Line['Language']; $text = strtolower($Line['Details']); set_name($text); $text = strtolower($Line['Objectives']); set_name($text); $text = strtolower($Line['OfferRewardText']); set_name($text); $text = strtolower($Line['RequestItemsText']); set_name($text); $text = strtolower($Line['EndText']); set_name($text); } $sql = 'SELECT '; for ($i=0;$i<8 ;++$i ) { for ($j=0;$j<2 ;++$j ) { $sql = $sql."text".$i."_$j,"; } } $sql = substr($sql, 0, strlen($sql)-1); $sql = $sql." FROM npc WHERE "; for ($i=0;$i<8 ;++$i ) { for ($j=0;$j<2 ;++$j ) { $sql = $sql."text".$i."_$j LIKE '%\$G%' OR "; } } for ($i=0;$i<8 ;++$i ) { for ($j=0;$j<2 ;++$j ) { $sql = $sql."text".$i."_$j LIKE '%\$g%' OR "; } } $sql = substr($sql, 0, strlen($sql) - 3); $ID = $Database->SQLCommand($sql); while ($Line = mysql_fetch_array($ID)) { // $language = $Line['Language']; for ($i = 0; $i < 8 ;++$i ) { for ($j = 0; $j < 2 ;++$j ) { $text = strtolower($Line["text".$i."_$j"]); set_name($text); } } } echo '$var_g = array(
'; foreach ($buffer as $key => $value) { // echo $key.'-'.$value.'
'; echo " array('$key','$value'),
"; } echo ');'; ?>