[Release] SQL to XML Converter (Hen! CMS)

08/28/2013 14:31 DexterSK#1
Hi epvp :pimp:

Item Proto Converter [SQL to XML]

Code:
PHP Code:
<h2>ItemProto.sql to ItemProto.xml Converter By DexterSK</h2>
<?php
if($_SESSION['uzivatelske_prava']>=$adminRights['prehlad_postavy'])
{
  if(isset(
$_POST['odoslat']))
  {
    
$query mysql_query("SELECT * FROM player.item_proto ORDER BY vnum ASC") or die(mysql_error());
    
$apo "'";

    
$fh fopen('dump/'.$_POST['meno_i'].'''w');
    
$zapis1 fwrite($fh'<item_proto extended="true" version="1">'."\r\n");
    while(
$fetch mysql_fetch_assoc($query))
    {
    
$zapis2 fwrite($fh'  <Item vnum="'.$fetch['vnum'].'" name="'.$apo.''.$fetch['name'].''.$apo.'" gb2312name="'.$fetch['locale_name'].'" type="'.$fetch['type'].'" subtype="'.$fetch['subtype'].'" weight="'.$fetch['weight'].'" size="'.$fetch['size'].'" antiflag="'.$fetch['antiflag'].'" flag="'.$fetch['flag'].'" wearflag="'.$fetch['wearflag'].'" immuneflag="'.$fetch['immuneflag'].'" gold="'.$fetch['gold'].'" buy_price="'.$fetch['shop_buy_price'].'" limittype0="'.$fetch['limittype0'].'" limitvalue0="'.$fetch['limitvalue0'].'" limittype1="'.$fetch['limittype1'].'" limitvalue1="'.$fetch['limitvalue1'].'" applytype0="'.$fetch['applytype0'].'" applyvalue0="'.$fetch['applyvalue0'].'" applytype1="'.$fetch['applytype1'].'" applyvalue1="'.$fetch['applytype1'].'" applytype2="'.$fetch['applytype2'].'" applyvalue2="'.$fetch['applyvalue2'].'" value0="'.$fetch['value0'].'" value1="'.$fetch['value1'].'" value2="'.$fetch['value2'].'" value3="'.$fetch['value3'].'" value4="'.$fetch['value4'].'" value5="'.$fetch['value5'].'" socket0="'.$fetch['socket0'].'" socket1="'.$fetch['socket1'].'" socket2="'.$fetch['socket2'].'" socket3="'.$fetch['socket3'].'" socket4="'.$fetch['socket4'].'" socket5="'.$fetch['socket5'].'" refine_vnum="'.$fetch['refined_vnum'].'" refine_set="'.$fetch['refine_set'].'" magic_pct="'.$fetch['magic_pct'].'" specular="'.$fetch['specular'].'" socket_pct="'.$fetch['socket_pct'].'" />'."\r\n");
    }
    
$zapis3 fwrite($fh'</item_proto>');
    
fclose($fh);

    if(
$zapis1 AND $zapis2 AND $zapis3)
    {
      echo
'<p>Sucess.</p>';
    }
    else
    {
      echo
'<p>Error.</p>';
    }
  }
}
else
{
  echo
'<p>You dont have permision for this area!</p>';
}
?>
<form action="" method="post">
<table>
<tr>
<td>
Name of XML:
</td>
<td>
<input type="text" name="meno_i" size="40" value="item_proto_dump.xml" />
</td>
</tr>
<td width="90">
&nbsp;
</td>
<td width="150">
<input type="submit" name="odoslat" value="Convert" />
</TABLE>
</form>
Mob Proto Converter [SQL to XML]

Code:
PHP Code:
<h2>ItemProto.sql to ItemProto.xml Converter By DexterSK</h2>
<?php
if($_SESSION['uzivatelske_prava']>=$adminRights['prehlad_postavy'])
{
  if(isset(
$_POST['odoslat']))
  {
    
$query mysql_query("SELECT * FROM player.mob_proto ORDER BY vnum ASC") or die(mysql_error());

    
$fh fopen('dump/'.$_POST['meno_m'].'''w');
    
$zapis1 fwrite($fh'<mob_proto isOldStructure="false">'."\r\n");
    while(
$fetch mysql_fetch_assoc($query))
    {
    
$zapis2 fwrite($fh'  <Mob vnum="'.$fetch['vnum'].'" name="'.$fetch['locale_name'].'" gb2312name="'.$fetch['locale_name'].'" type="'.$fetch['type'].'" rank="'.$fetch['rank'].'" battle_type="'.$fetch['battle_type'].'" level="'.$fetch['level'].'" event_type="0" mob_color="'.$fetch['mob_color'].'" />'."\r\n");
    }
    
$zapis3 fwrite($fh'</mob_proto>');
    
fclose($fh);

    if(
$zapis1 AND $zapis2 AND $zapis3)
    {
      echo
'<p>Sucess.</p>';
    }
    else
    {
      echo
'<p>Error.</p>';
    }
  }
}
else
{
  echo
'<p>You dont have permision for this area!</p>';
}
?>
<form action="" method="post">
<table>
<tr>
<td>
Meno XML:
</td>
<td>
<input type="text" name="meno_m" size="40" value="mob_proto_dump.xml" />
</td>
</tr>
<td width="90">
&nbsp;
</td>
<td width="150">
<input type="submit" name="odoslat" value="Convert" />
</TABLE>
</form>
[Only registered and activated users can see links. Click Here To Register...] - This release dont work for me ..

:cool:
08/28/2013 15:38 Adasaurus#2
Zapomel si tam dodat to, ze na ftp musi mit slozku dump s pravy 777 a taky bych pozmenil nazvy sessions :D

EN :
Forgot your there to deliver it from the ftp folder must have a dump with the right 777 and I'd modified the called Sessions: D
with google translate sorry :D
08/28/2013 17:18 [The]Domco#3
SLAPI SKRYPT SI LAMAG

en:
Very nice work
08/28/2013 20:35 Burbank#4
Usefull script, thanks!!
08/31/2013 01:00 KubaBrtek#5
Thank you so much DexterSK.
08/31/2013 01:33 juliangx#6
sorry, but, how to use?