[Ubercms] [Butterstorm] Furniture adder

Results 1 to 7 of 7
  1. #1
    Account Upgraded | Title Enabled! =dj.matias= is offline
    MemberRank
    Apr 2008 Join Date
    FinlandLocation
    381Posts

    [Ubercms] [Butterstorm] Furniture adder

    Hi, I've coded furniture adder for ubercms. You can change it easily to other cms compatible etc. This support Butterstorm database, but you can change it to work Phoenix db easily.

    It makes sql who contains all missing furni from your db. Some items need editing... (cycle_count etc.)

    Save it to manage/pages/newfurni.php

    Code:
    <?php
    /*=======================================================================
    | UberCMS - Advanced Website and Content Management System for uberEmu
    | #######################################################################
    | Copyright (c) 2010, Roy 'Meth0d' and updates by Matthew 'MDK'
    | http://www.meth0d.org & http://www.sulake.biz
    | #######################################################################
    | This program is free software: you can redistribute it and/or modify
    | it under the terms of the GNU General Public License as published by
    | the Free Software Foundation, either version 3 of the License, or
    | (at your option) any later version.
    | #######################################################################
    | This program is distributed in the hope that it will be useful,
    | but WITHOUT ANY WARRANTY; without even the implied warranty of
    | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    | GNU General Public License for more details.
    \======================================================================*/
    
    if (!defined('IN_HK') || !IN_HK)
    {
    	exit;
    }
    
    if (!HK_LOGGED_IN || !$users->hasFuse(HK_USER_ID, 'fuse_housekeeping_catalog'))
    {
    	exit;
    }
    
    
    
    require_once "top.php";
    
    echo '<h1>Add new furni</h1>';
    echo '<p>This tool you can add new furnis..</p><br />';
    echo '<p><input type="button" value="Add new furni" onclick="window.location = \'index.php?_cmd=newfurni&add=true\';"></p><br />';
    
    if (isset($_GET['add']))
    {
    $whatWeKnow = Array();
    $getWhatWeKnow = dbquery("SELECT item_name FROM items_base");
    $counterid = mysql_result(dbquery("SELECT max(item_id) FROM items_base"), 0) + 1;
    while ($g = mysql_fetch_assoc($getWhatWeKnow))
    {
    	$whatWeKnow[] = $g['item_name'];
    }
     
    $data = file_get_contents("http://www.habbo.fi/gamedata/furnidata?hash=x");
    $data = str_replace("\n", "", $data);
    $data = str_replace("[[", "[", $data);
    $data = str_replace("]]", "]", $data);
    $data = str_replace("][", "],[", $data);
    
    $ij = 0;
    
    $stuffWeDontKnow = Array();
    $catsql = "";
    $itemsql = "";
    foreach (explode('],[', $data) as $val)
    {
    	$val = str_replace('[', '', $val);
    	$val = str_replace(']', '', $val);
    	
    	$bits = explode(',', $val);
    	$name = str_replace('"', '', $bits[2]);
    	$revision = str_replace('"', '', $bits[3]);
    $spriteid = str_replace('"', '', $bits[1]);
    	$length = str_replace('"', '', $bits[6]);
    	$interactor = "default";
    	$height = "1.00";
    	$astack = "0";
    	$asit = "0";
    	$awalk = "0";
    	$modes = "0";
    	$width = str_replace('"', '', $bits[5]);
    
    	$pname = str_replace('"', '', $bits[8]);
    
    	
    	$type = str_replace('"', '', $bits[0]);
    	if (in_array($name, $whatWeKnow))
    	{
    		continue;
    	}
    	
    	if (strpos($name, 'prizetrophy') !== false)
    	{
    		continue;
    	}
    	else if (strpos($name, 'noob_') !== false)
    	{
    		continue;
    	}
    	else if (strpos($name, 'greektrophy') !== false)
    	{
    		continue;
    	}	
    	else if (strpos($name, 'present_wrap') !== false)
    	{
    		continue;
    	}	
    	else if (strpos($name, 'floortile') !== false)
    	{
    		continue;
    	}	
    	else if (strpos($name, 'wallpaper') !== false)
    	{
    		continue;
    	}	
    	else if (strpos($name, 'post_it') !== false)
    	{
    		continue;
    	}		
    	else if ($name == 'camera')
    	{
    		continue;
    	}	
    	else if ($name == 'prize1')
    	{
    		continue;
    	}	
    	else if ($name == 'prize2')
    	{
    		continue;
    	}	
    	else if ($name == 'prize3')
    	{
    		continue;
    	}		
    	else if ($name == 'bolly_palm')
    	{
    		continue;
    	}		
    	else if ($name == 'footylamp_campaign')
    	{
    		continue;
    	}		
    	else if ($name == 'rare_parasol')
    	{
    		continue;
    	}		
    	else if ($name == 'hw08_xray')
    	{
    		continue;
    	}	
    	else if ($name == 'CFC_10_coin_bronze')
    	{
    		continue;
    	}		
    	else if ($name == 'soft_jaggara_norja')
    	{
    		continue;
    	}	
    	else if (strpos($name, 'plasto') !== false)
    	{
    		continue;
    	}		
    	else if ($name == 'kinkysofa')
    	{
    		continue;
    	}		
    	else if ($name == 'ticket')
    	{
    		continue;
    	}	
    	else if ($name == 'photo')
    	{
    		continue;
    	}			
    	else if ($name == 'Chess')
    	{
    		continue;
    	}			
    	else if ($name == 'TicTacToe')
    	{
    		continue;
    	}		
    	else if ($name == 'BattleShip')
    	{
    		continue;
    	}		
    	else if ($name == 'Poker')
    	{
    		continue;
    	}		
    	else if ($name == 'floor')
    	{
    		continue;
    	}		
    	else if ($name == 'poster')
    	{
    		continue;
    	}
    	else if ($name == 'landscape')
    	{
    		continue;
    	}			
    	else if ($name == 'xmas_icewall')
    	{
    		continue;
    	}			
    	else if ($name == 'sf_wall')
    	{
    		continue;
    	}
    	else if ($name == 'xm09_frplc')
    	{
    		continue;
    	}	
    	else if ($name == 'ads_idol_chmpgn')
    	{
    		continue;
    	}
    	else if ($name == 'md_sofa')
    	{
    		continue;
    	}
    		else if ($name == '')
    	{
    		continue;
    	}
    	if (strpos($name,"gate") == true)
    	{
    	$interactor = "gate";
    	$height = "0.01";
    	}
    	else if (strpos($name,"dice") == true)
    	{
    	$interactor = "dice";
    	}
    	else if (strpos($name,"hopper") == true)
    	{
    	$interactor = "teleport";
    	$height = "0.01";
    	}
    	else if (strpos($name,"tele") == true)
    	{
    	$interactor = "teleport";
    	$height = "0.01";
    	}
    	else if (strpos($name,"table") == true)
    	{
    	$interactor = "default";
    	$height = "1.00";
    	$astack = "1";
    	}
    	else if (strpos($name,"bed") == true)
    	{
    	$interactor = "bed";
    	$height = "1.25";
    	}
    	else if (strpos($name,"chair") == true)
    	{
    	$asit = "1";
    	}
    		else if (strpos($name,"mat") == true)
    	{
    	$awalk = "1";
    	$height = "0.01";
    	}
    		else if (strpos($name,"rug") == true)
    	{
    	$awalk = "1";
    	$height = "0.01";
    	}
    		else if (strpos($name,"floor") == true)
    	{
    	$awalk = "1";
    	$height = "0.01";
    	}
    		else if (strpos($name,"throne") == true)
    	{
    	$asit = "1";
    	}
    		else if (strpos($name,"patch") == true)
    	{
    	$awalk = "1";
    	$astack = "1";
    	$height = "0.01";
    	}
    	else if (strpos($name,"lamp") == true)
    	{
    	$modes = "2";
    	}
    	else if (strpos($name,"sofa") == true)
    	{
    	$asit = "1";
    	}
    	$stuffWeDontKnow[] = '[' . $val . ']';
    	$ij++;
    	
    	$itemsql = $itemsql . "INSERT INTO `items_base` (`item_id`, `sprite_id`, `public_name`, `item_name`, `type`, `width`, `length`, `height`, `allow_stack`, `allow_walk`, `allow_sit`, `allow_recycle`, `allow_trade`, `allow_marketplace_sell`, `allow_gift`, `allow_inventory_stack`, `interaction_type`, `cycle_count`, `vending_ids`) VALUES ('" . $counterid ."', '" . $spriteid . "', '" . $name . "', '" . $name . "', '" . $type . "', '" . $width . "', '" . $length . "', '" . $height . "', '" . $astack . "', '" . $awalk . "', '" . $asit . "', '1', '1', '1', '1', '1', '" . $interactor . "', '" . $modes . "', '0');\n";
    	$catsql = $catsql . "INSERT INTO `catalog_items` (`page_id`, `item_ids`, `catalog_name`, `cost_credits`, `cost_pixels`, `amount`, `cost_crystal`, `cost_oude_belcredits`, `song_id`) VALUES ('926', '" . $counterid . "', '" . $name . "', '3', '0', '1', '0', '0', '0');\r";
    	$counterid++;
    	
    }
    
    echo '<h2>Uusia tavaroita (' . $ij . ')</h2><br />';
    
    // if ($ij >= 1)
    // {
    	foreach ($stuffWeDontKnow as $stuff)
    	{
    
    		
    
    	}
    // }
    // else
    // {
    	// echo '<Br /><br /><center style="font-size: 120%;"><i><b>Good news!</b><br />I have no new furni for you today.</i></center>';
    // }
    echo '<textarea rows="10" cols="120">' . $itemsql . '</textarea><br><br>';
    
    echo '<textarea rows="10" cols="120">' . $catsql . '</textarea>';
    }
    
    require_once "bottom.php";
    
    ?>
    Change $data = file_get_contents("URL TO FURNIDATA");
    Change page id in catalog_item.


  2. #2
    Apprentice Der is offline
    MemberRank
    May 2012 Join Date
    22Posts

    Re: [Ubercms] [Butterstorm] Furniture adder

    Thank you intended is some help :)
    I have a question ...
    How do you make a butter Storm Hotel?
    I fail always.

    Sry for my english, I'm Albanian

  3. #3
    Eye Eye Capt'n Spheral is offline
    MemberRank
    May 2010 Join Date
    TumptonshireLocation
    2,488Posts

    Re: [Ubercms] [Butterstorm] Furniture adder

    I tested and the only items that show up in the catalogue are the wall items, not furniture.
    EDIT; change the furnidata line to .com :L haha, nice release by the way, saves me alot of time and helps with releases (soon i might not have to do releases anymore)

    EDIT2: Changing the line to habbo.com furnidata doesnt work. You need to make this work with other furnidata other than .fi
    Last edited by Spheral; 27-10-12 at 01:03 PM.

  4. #4
    Proficient Member iBling14 is offline
    MemberRank
    Nov 2011 Join Date
    179Posts

    Re: [Ubercms] [Butterstorm] Furniture adder

    Thanks, for this. Even Though I have a FULL SQL maker in my housekeeping :P still useful.

  5. #5
    Check http://arcturus.pw The General is offline
    DeveloperRank
    Aug 2011 Join Date
    7,608Posts

    Re: [Ubercms] [Butterstorm] Furniture adder

    Quote Originally Posted by iBling14 View Post
    Even Though I have a FULL SQL maker in my housekeeping :P still useful.
    Maybe release it instead of showing off your full SQL maker?

    OT: Why you stopped some code from working with // ?

  6. #6
    Alpha Member Emily is offline
    MemberRank
    Oct 2012 Join Date
    The NetherlandsLocation
    2,408Posts

    Re: [Ubercms] [Butterstorm] Furniture adder

    This is a good release. It's good for those lazy people (including me, tbh.) and people who have no experience in adding furniture.

  7. #7
    Proficient Member iBling14 is offline
    MemberRank
    Nov 2011 Join Date
    179Posts

    Re: [Ubercms] [Butterstorm] Furniture adder

    Quote Originally Posted by tdid View Post
    Maybe release it instead of showing off your full SQL maker?

    OT: Why you stopped some code from working with // ?
    Wasn't meant to show off, and for what to get flamed at the coding, nty.



Advertisement