PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
This is release and a tutorial on how to convert from Phoenix SQL's to PlusR2 SQL's and make the furnidata very easily. THESE FILES ONLY WORK FOR PHOENIX SQL'S IF YOU WANT BCSTORM ONES THEN EDIT THE PHP FILES YOURSELF.
First off what do you get:
3 php files. One creates the catalog_items SQL, the next creates the furniture SQL and the last creates the furnidata.xml
Download link:
https://www.mediafire.com/?llbdf4td4c5knlz
Ok, here's the TUT part. If you follow this correctly, you'll be fine and it'll work like a charm. If you can't, then try again BUT DO NOT POST FOR HELP. Kthanks.
Step 1.
Go to your database manager (Navicat or Phpmyadmin) and create a database and call it newcata, then run this SQL
Code:
DROP TABLE IF EXISTS `catalog_items`;
CREATE TABLE `catalog_items` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`page_id` int(11) NOT NULL,
`item_ids` varchar(120) NOT NULL,
`catalog_name` varchar(100) NOT NULL,
`cost_credits` int(11) NOT NULL,
`cost_pixels` int(11) NOT NULL,
`cost_snow` int(11) NOT NULL DEFAULT '0',
`amount` int(11) NOT NULL,
`vip` enum('0','1','2') NOT NULL DEFAULT '0',
`achievement` int(4) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
-- ----------------------------
-- Table structure for furniture
-- ----------------------------
DROP TABLE IF EXISTS `furniture`;
CREATE TABLE `furniture` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`public_name` varchar(100) NOT NULL COMMENT 'temp only',
`item_name` varchar(100) NOT NULL,
`type` enum('s','i','e','h','v') NOT NULL DEFAULT 's',
`width` int(11) NOT NULL DEFAULT '1',
`length` int(11) NOT NULL DEFAULT '1',
`stack_height` double NOT NULL DEFAULT '1',
`can_stack` enum('0','1') NOT NULL DEFAULT '1',
`can_sit` enum('0','1') NOT NULL DEFAULT '0',
`is_walkable` enum('0','1') NOT NULL DEFAULT '0',
`sprite_id` int(11) NOT NULL,
`allow_recycle` enum('0','1') NOT NULL DEFAULT '1',
`allow_trade` enum('0','1') NOT NULL DEFAULT '1',
`allow_marketplace_sell` enum('0','1') NOT NULL DEFAULT '1',
`allow_gift` enum('0','1') NOT NULL DEFAULT '1',
`allow_inventory_stack` enum('0','1') NOT NULL DEFAULT '1',
`interaction_type` enum('default','gate','postit','roomeffect','dimmer','trophy','bed','scoreboard','vendingmachine','alert','onewaygate','loveshuffler','habbowheel','dice','bottle','teleport','rentals','pet','roller','water','ball','bb_red_gate','bb_green_gate','bb_yellow_gate','bb_puck','bb_blue_gate','bb_patch','bb_teleport','blue_score','green_score','red_score','yellow_score','fbgate','tagpole','counter','red_goal','blue_goal','yellow_goal','green_goal','wired','wf_trg_onsay','wf_act_saymsg','wf_trg_enterroom','wf_act_moveuser','wf_act_togglefurni','wf_trg_furnistate','wf_trg_onfurni','pressure_pad','wf_trg_offfurni','wf_trg_gameend','wf_trg_gamestart','wf_trg_timer','wf_act_givepoints','wf_trg_attime','wf_trg_atscore','wf_act_moverotate','rollerskate','stickiepole','wf_xtra_random','wf_cnd_trggrer_on_frn','wf_cnd_furnis_hv_avtrs','wf_act_matchfurni','wf_cnd_has_furni_on','puzzlebox','switch','wf_act_give_phx','wf_cnd_phx') DEFAULT 'default',
`interaction_modes_count` int(11) NOT NULL DEFAULT '1',
`vending_ids` varchar(100) NOT NULL DEFAULT '0',
`is_arrow` enum('0','1') NOT NULL DEFAULT '0',
`height_adjustable` varchar(100) NOT NULL DEFAULT '0',
`effectM` int(3) NOT NULL DEFAULT '0',
`effectF` int(3) NOT NULL DEFAULT '0',
`foot_figure` enum('0','1') NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Step 2, place the download files into your cms path (For Rev put it in your skin for Uber put it directly into the path htdocs or wwwroot), open all of them, then change up the top where it says "putpasswordhere" to your database's password and save. (Don't change anything else)
Step 3, aquire the Phoenix SQL's of the furni you want to add and run the SQL's into the database you just made known as newcata, once done, simply go to yoursite/items and copy te given code, and run it into your actual database (Note, edit the last line of code so the last character is a ; and not a ,) repeat by going to yoursite/items and do the same (copy, paste into actual database, edit last line of the SQL)
ALSO NOTE, if you use Uber you will need to add .php to end of the file links when going to them, so it'll be yoursitehere/items.php etc etc..
Step 4, go to yoursite/furnidata and wait a minute or two for it too look like this;
http://i.imgur.com/Fcelqp4.png
Once it looks like that, save it by pressing ctrl + s (or do something if you're on mac) and make sure you save it as whatevernamehere.xml (Must be in XML format) then simply replace your current furnidata_xml.xml with this one and boom. Reload your hotel, :update_items and :update_catalogue and boom. It should work going by that you followed this all correctly.
Well there you go amigos. If you like, maybe leave me a like and a good comment so I know I'm doing something good? :) By choice of course.
Note: This code is a bit old so I recommend changing in the items.php where it says '0',
''),<br /> to '',''),<br /> So that the items don't have a badge that doesn't exist. Also, it might not set the interaction type right so double check that as well. Either way, this is a start so don't flame if it doesn't work correctly.
Credits;
@MrSpooks for handing me the scripts,
People who made the scripts (I believe it was Username Here or w.e his name is today),
Myself for editing them to work on PlusR2 and making this shingdigz.
Have a nice day amigos and good luck. Also, do you want me to make a TUT on how to fix customs not working? Can do upto 5 items a minute.
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Why you need to make a new furnidata? Furnidata isn't different? (you can still use the JSON-encoded .txt variant)
But well... good release though..
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Quote:
Originally Posted by
Tha
Why you need to make a new furnidata? Furnidata isn't different? (you can still use the JSON-encoded .txt variant)
But well... good release though..
Most people just use the .xml now as they believe it's the only way to go. With a few edits you could make it convert back to posting it as the normal .txt file but it's up to choice.
1 Attachment(s)
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
here is my new furnidata
Check your furniture id`s, flat_id`s and specialtype
wallpaper = 19896 , flat_id = 5226 , specialtype = 2
floor = 889196 , flat_id = 5386 , specialtype = 3
landscape = 19926 , flat_id = 5443 , specialtype = 4
Work wallpaper, floor, landscape 100%
Screenshot:
Attachment 144889
Code:
<?php
$host = "localhost";
$user = "root";
$password = "pw";
$database = "db";
mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
header("Content-type: text/xml");
?>
<?xml version="1.0" encoding="UTF-8"?><furnidata><roomitemtypes>
<?php
$fpconvert1 = mysql_query("SELECT * FROM furniture");
while($fpconvert = mysql_fetch_assoc($fpconvert1)){
if($fpconvert['type'] == 's'){ ?>
<furnitype id="<?php echo $fpconvert['sprite_id']; ?>" classname="<?php echo $fpconvert['item_name']; ?>">
<revision><?php echo $fpconvert['revision']; ?></revision>
<defaultdir>0</defaultdir>
<xdim>1</xdim>
<ydim>1</ydim>
<partcolors>
<color>0</color>
<color>0</color>
<color>0</color>
</partcolors>
<name><?php echo $fpconvert['public_name']; ?></name>
<description><?php echo $fpconvert['description']; ?></description>
<adurl></adurl>
<offerid><?php echo $fpconvert['flat_id']; ?></offerid>
<buyout>1</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<bc>1</bc>
<customparams/>
<specialtype><?php echo $fpconvert['specialtype']; ?></specialtype>
<canstandon><?php echo $fpconvert['can_stack']; ?></canstandon>
<cansiton><?php echo $fpconvert['can_sit']; ?></cansiton>
<canlayon><?php echo $fpconvert['canlayon']; ?></canlayon>
</furnitype>
<?php } } echo "</roomitemtypes><wallitemtypes>"; ?>
<?php
$fpconvert2 = mysql_query("SELECT * FROM furniture WHERE item_name NOT LIKE 'a2 t' and item_name NOT LIKE 'a2 l' and item_name NOT LIKE 'wallpaper 1' and item_name NOT LIKE 'landscape 10'");
while($fpconvert1 = mysql_fetch_assoc($fpconvert2)){
if($fpconvert1['type'] == 'i'){ ?>
<furnitype id="<?php echo $fpconvert1['sprite_id']; ?>" classname="<?php echo $fpconvert1['item_name']; ?>">
<revision><?php echo $fpconvert1['revision']; ?></revision>
<name><?php echo $fpconvert1['public_name']; ?></name>
<description><?php echo $fpconvert1['description']; ?></description>
<adurl></adurl>
<offerid><?php echo $fpconvert1['flat_id']; ?></offerid>
<buyout>1</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<bc>1</bc>
<specialtype><?php echo $fpconvert1['specialtype']; ?></specialtype>
</furnitype>
<?php } } echo "</wallitemtypes></furnidata>"; ?>
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Quote:
Originally Posted by
Meik2010
here is my new furnidata
Work wallpaper, floor, landscape 100%
Screenshot:
Attachment 144889
Code:
<?php
$host = "localhost";
$user = "root";
$password = "pw";
$database = "db";
mysql_connect($host, $user, $password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
header("Content-type: text/xml");
?>
<?xml version="1.0" encoding="UTF-8"?><furnidata><roomitemtypes>
<?php
$fpconvert1 = mysql_query("SELECT * FROM furniture");
while($fpconvert = mysql_fetch_assoc($fpconvert1)){
if($fpconvert['type'] == 's'){ ?>
<furnitype id="<?php echo $fpconvert['sprite_id']; ?>" classname="<?php echo $fpconvert['item_name']; ?>">
<revision><?php echo $fpconvert['revision']; ?></revision>
<defaultdir>0</defaultdir>
<xdim>1</xdim>
<ydim>1</ydim>
<partcolors>
<color>0</color>
<color>0</color>
<color>0</color>
</partcolors>
<name><?php echo $fpconvert['public_name']; ?></name>
<description><?php echo $fpconvert['description']; ?></description>
<adurl></adurl>
<offerid><?php echo $fpconvert['flat_id']; ?></offerid>
<buyout>1</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<bc>1</bc>
<customparams/>
<specialtype><?php echo $fpconvert['specialtype']; ?></specialtype>
<canstandon><?php echo $fpconvert['can_stack']; ?></canstandon>
<cansiton><?php echo $fpconvert['can_sit']; ?></cansiton>
<canlayon><?php echo $fpconvert['canlayon']; ?></canlayon>
</furnitype>
<?php } } echo "</roomitemtypes><wallitemtypes>"; ?>
<?php
$fpconvert2 = mysql_query("SELECT * FROM furniture WHERE item_name NOT LIKE 'a2 t' and item_name NOT LIKE 'a2 l' and item_name NOT LIKE 'wallpaper 1' and item_name NOT LIKE 'landscape 10'");
while($fpconvert1 = mysql_fetch_assoc($fpconvert2)){
if($fpconvert1['type'] == 'i'){ ?>
<furnitype id="<?php echo $fpconvert1['sprite_id']; ?>" classname="<?php echo $fpconvert1['item_name']; ?>">
<revision><?php echo $fpconvert1['revision']; ?></revision>
<name><?php echo $fpconvert1['public_name']; ?></name>
<description><?php echo $fpconvert1['description']; ?></description>
<adurl></adurl>
<offerid><?php echo $fpconvert1['flat_id']; ?></offerid>
<buyout>1</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<bc>1</bc>
<specialtype><?php echo $fpconvert1['specialtype']; ?></specialtype>
</furnitype>
<?php } } echo "</wallitemtypes></furnidata>"; ?>
Please don't use mysql_connect, mysql_query etc anymore, it's decrepated. Use MySQLi/PDO.
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Furnidata.php:
This page contains the following errors:
error on line 2 at column 656: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Quote:
Originally Posted by
Twan
Furnidata.php:
This page contains the following errors:
error on line 2 at column 656: XML declaration allowed only at the start of the document
Below is a rendering of the page up to the first error.
Because XML is fuddy, you need to make sure you have no special chars in your database. Such as & for instance instead of and, or > <
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
@FatalLulz Furni and items works gr8 atm but the furnidata keeps standing on this even if ill letting it load in like 10mins http://prntscr.com/39o7dc
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Well, i only use the catalog_items and furniture tables from new_cata...
Re: PlusR2 furnidata, catalog_items and furniture SQL creator. [PHP files]
Thank.
I have done that way for furnidata:
Code:
<?php
ob_start(); ?>
<?xml version="1.0"?>
<furnidata>
<roomitemtypes>
<?php
error_reporting(0);
$data = file_get_contents("furnidata.txt");
$data = utf8_encode($data);
$data = str_replace("&", "et", $data);
$data = str_replace("<", "", $data);
foreach(explode('[',$data) as $premier)
{
$var = explode('",',$premier);
$var = str_replace('"','', $var);
$var = str_replace('],','', $var);
// echo '["'.$var[2].'","'.$var[8].'","'.$var[9].'"],';
if($var[0] == 's')
{
?>
<furnitype id="<?php echo $var[1]; ?>" classname="<?php echo $var[2]; ?>">
<revision><?php echo $var[3]; ?></revision>
<defaultdir><?php echo $var[4]; ?></defaultdir>
<xdim><?php echo $var[5]; ?></xdim>
<ydim><?php echo $var[6]; ?></ydim>
<partcolors><?php $colors = explode(',', $var[7]); foreach($colors as $color) { echo '<color>'.$color.'</color>'; } ?></partcolors>
<name><?php echo $var[8]; ?></name>
<description><?php echo $var[9]; ?></description>
<adurl></adurl>
<offerid>0<?php //echo $var[1]; ?></offerid>
<buyout>0</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<customparams><?php if(empty($var[13]) && !isset($var[13])) echo '1'; else echo $var[13]; ?></customparams>
<specialtype><?php if(empty($var[14]) && !isset($var[14])) echo '1'; else echo $var[14]; ?></specialtype>
<canstandon>0</canstandon>
<cansiton>0</cansiton>
<canlayon>0</canlayon>
</furnitype>
<?php
}
}
?>
</roomitemtypes>
<wallitemtypes>
<?php
$data = file_get_contents("furnidata.txt");
$data = utf8_encode($data);
$data = str_replace("&", "et", $data);
foreach(explode('[',$data) as $premier)
{
$var = explode('",',$premier);
$var = str_replace('"','', $var);
if($var[0] == 'i'){
?>
<furnitype id="<?php echo $var[1]; ?>" classname="<?php echo $var[2]; ?>">
<revision><?php echo $var[3]; ?></revision>
<name><?php echo $var[8]; ?></name>
<description><?php echo $var[9]; ?></description>
<adurl></adurl>
<offerid><?php echo $var[1]; ?></offerid>
<buyout>0</buyout>
<rentofferid>-1</rentofferid>
<rentbuyout>0</rentbuyout>
<specialtype>1</specialtype>
</furnitype>
<?php
}
}
?>
</wallitemtypes>
</furnidata>
<?php
$tampon = ob_get_contents();
ob_end_clean();
$fichier = fopen('./furnidata.xml', 'w+');
$resultat = fwrite($fichier, $tampon);
fclose($fichier);
?>