Advertisement
Guest User

Keiz' can_walk = 1 SQL generator

a guest
Jan 2nd, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.97 KB | None | 0 0
  1. <?php
  2. // Keiz' can_walk updater for the pre-fixed Azure
  3. // Skype: keiz.er
  4. function startsWith($haystack, $needle) {
  5.     return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
  6. }
  7. $fx = file_get_contents('furnidata.xml'); // Put the furnidata in the folder of this script.
  8. $xml = simplexml_load_string($fx);
  9. $xml = json_encode($xml);
  10. $xml = json_decode($xml, true);
  11. foreach($xml['roomitemtypes']['furnitype'] as $f)
  12. {
  13.     $a = $f['@attributes'];
  14.     $id = $a['classname'];
  15.     $canwalk = $f['canstandon'];
  16.     if($canwalk == 0) continue;
  17.     if(startsWith($id, "hole")) continue;
  18.     echo "UPDATE catalog_furnis SET can_walk = '" . $canwalk . "' WHERE item_name = '"  . $id . "';<br>";
  19. }
  20. echo "UPDATE catalog_furnis SET can_walk = '0' WHERE interaction_type = 'teleport';<br>";
  21. echo "UPDATE catalog_furnis SET can_walk = '0' WHERE interaction_type = 'bb_pyramid';<br>";
  22. echo "UPDATE catalog_furnis SET can_walk = '0' WHERE interaction_type = 'banzaipyramid';";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement