Jump to content

Converter sql to xml (item proto)


Recommended Posts

Do someone have a converter for item proto sql to xml?

I only found an old converter for the hen script, but I'm using the new database structure.

Old script:

<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>

 

Link to comment
Share on other sites

  • 1 month later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / 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.