RevCMS Badgeshop Addon

Results 1 to 13 of 13
  1. #1
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    RevCMS Badgeshop Addon

    Hi RageZone,

    Since I am done working with RevCms I decided that it would make no sense to keep my badgeshop to myself!

    Currently this script works off of vip_points but it can be easily changed to credits or pixels. Everything should be working on here. I added a thing for staff when you can add/delete badges. Hopefully you enjoy this!

    SQL:

    Code:
    DROP TABLE IF EXISTS `badgeshop`;
    CREATE TABLE `badgeshop` (
      `image` varchar(100) NOT NULL,
      `name` varchar(30) NOT NULL,
      `price` int(10) NOT NULL,
      `id` int(10) NOT NULL AUTO_INCREMENT,
      PRIMARY KEY (`id`)
    ) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=latin1;
    Save as badgeshop.php in app>>tpl>>skins>>YOUR SKIN>>

    Code:
    <!DOCTYPE html>
    <html lang="en">
        <head>
            <meta http-equiv="content-type" content="text/html; charset=utf-8">
            <title>{hotelName} - Badgeshop</title>
            
            <link rel="stylesheet" href="{url}/app/tpl/skins/{skin}/styles/common.css" 
    
    type="text/css">
            <script type="text/javascript" src="{url}/app/tpl/skins/
    
    {skin}/js/libs2.js"></script>
            <script type="text/javascript" src="{url}/app/tpl/skins/
    
    {skin}/js/visual.js"></script>
            <script type="text/javascript" src="{url}/app/tpl/skins/
    
    {skin}/js/libs.js"></script>
            <script type="text/javascript" src="{url}/app/tpl/skins/
    
    {skin}/js/common.js"></script>
            <script type="text/javascript" src="{url}/app/tpl/skins/
    
    {skin}/js/fullcontent.js"></script>
    		<script type="text/javascript" 
    
    src="http://www.adcash.com/script/java.php?
    
    option=rotateur&rotateur=91763"></script>
            
    <script>
    var andSoItBegins = (new Date()).getTime();	
    var ad_keywords = "";	
    document.habboLoggedIn = true;	
    var habboName = "{username}";	
    var habboReqPath = "";	
    var habboStaticFilePath = "{url}/app/tpl/skins/{skin}";	
    var habboImagerUrl = "http://www.habbo.com/habbo-imaging/";	
    var habboPartner = "";	
    var habboDefaultClientPopupUrl = "http://{url}/client";	
    window.name = "habboMain";
    if (typeof HabboClient != "undefined") { HabboClient.windowName = "uberClientWnd"; 
    
    }	
    </script>
    
    <style type="text/css"> 
    .avatarContainer {
    	height: 107px;
    	width: 60px;
    	position: absolute;
    	overflow: hidden;
    	left: -150px;
    	top: -10px;
    }
    </style> 
            
            <!--[if IE 8]>
                <link rel="stylesheet" href="{url}/app/tpl/skins/
    
    {skin}/styles/ie8.css" type="text/css">
            <![endif]-->
            <!--[if lt IE 8]>
                <link rel="stylesheet" href="{url}/app/tpl/skins/{skin}/styles/ie.css" 
    
    type="text/css" />
            <![endif]-->
            <!--[if lt IE 7]>
                <link rel="stylesheet" href="{url}/app/tpl/skins/
    
    {skin}/styles/ie6.css" type="text/css" />
                <script type="text/javascript" src="{url}/app/tpl/skins/
    
    {skin}/js/pngfix.js"></script>
                <script type="text/javascript">
                    try { document.execCommand('BackgroundImageCache', false, true); } 
    
    catch(e) {}
                </script>
                <style type="text/css">
                    body { behavior: url({url}/app/tpl/skins/{skin}/js/csshover.htc); 
    
    }
                </style>
            <![endif]-->
        </head>
        
        <body id="home">
        
            <div id="overlay"></div>
            <div id="header-container">
                <div id="header" class="clearfix">
    	<div class="avatarContainer">
    			
    <img src="http://para-hotel.com/image.php?figure={figure}
    
    &action=wav&direction=2&head_direction=3&gesture=sml&size=l">
    	</div>
                    <h1><a href="{url}/"></a></h1>
                    <div id="subnavi">
                        <div id="subnavi-user"> 
    						<ul> 
    							<li id="myfriends"><a 
    
    href="#"><span>My Friends</span></a><span class="r"></span></li> 
    							<li id="mygroups"><a 
    
    href="#"><span>My Groups</span></a><span class="r"></span></li> 
    							<li id="myrooms"><a 
    
    href="#"><span>My Rooms</span></a><span class="r"></span></li> 
    						</ul> 
    						<script type="text/javascript"> 
    						L10N.put("purchase.group.title", 
    
    "Create a group");
    						document.observe("dom:loaded", 
    
    function() {
    							$("signout").observe
    
    ("click", function() {
    								HabboClient.close
    
    ();
    							});
    						});
    						</script>
    					</div>
    <div id="subnavi-search">
                            <div id="subnavi-search-upper" style="float:right;margin-
    
    right:10px;">
                                <ul id="subnavi-search-links">
                                    <li><a href="{url}/logout" style="color:#000">Sign 
    
    Out</a></li>
                                </ul>
                            </div>
                        </div>
                        <div id="to-hotel">
                            <a href="{url}/api.php" class="new-button green-button" 
    
    target="eac955c8dbc88172421193892a3e98fc7402021a" 
    
    onclick="HabboClient.openOrFocus(this); return false;"><b>Enter {hotelName}
    
    </b><i></i></a>
                        </div>
                    </div>
                    <ul id="navi">
                        <li class="metab"><a href="{url}/me">{username}
    
    </a><span></span></li>
    <li><a href="{url}/community">Community</a><span></span></li>
                        <li><a href="{url}/vip">Buy VIP</a><span></span></li>
    <li class="selected"><strong>Shop</strong><span></span></li>
    <li id="tab-register-now"><a 
    
    href="http://paradisenetwork.net/forums/">Forums</a><span></span></li>
                    </ul>
                    <div id="habbos-online">
    	<div id="content">
    		<div class="cb "><div class="bt"><div></div></div><div 
    
    class="i1"><div class="i2"><div class="i3">
    			<span>{online} members online</span>
    		</div></div></div><div class="bb"><div></div></div></div>
    	</div>
    </div>
                </div>
            </div>
    <div id="content-container">
                <div id="navi2-container" class="pngbg">
                    <div id="navi2" class="pngbg clearfix">
                        <ul>
    <li class=""><a href="{url}/shop">Purchase Shells</a></li>
                            <li class="selected">Badge Shop</li>
    <li class=""><a href="{url}/cap">Coins & Pixels</a></li>
    <li class="last"><a href="{url}/bots">Bots</a></li>
                        </ul>
                    </div>
                </div>
            <div id="content-container">
                
    <div id="container">                 <div id="content" style="position: relative" 
    
    class="clearfix"> 
                       <div id="column1" class="column">                         <div 
    
    class="habblet-container ">		                               <div 
    
    id="column1" class="column" >                         <div class="habblet-
    
    container ">                             <div class="cbb clearfix green ">         
    
                            <h2 class="title">Badge Shop</h2>                          
    
           <div style="padding:5px">  
    <div id="Layer1" style="height:400px; width: 444px; overflow: scroll;">
    <?php 
    if(mysql_result(mysql_query("SELECT online FROM users WHERE id = '" . $_SESSION
    
    ['user']['id'] ."'"), 0) == 1)
    {
        echo '<div class="rounded rounded-red" width="20%">
                        Please close your game client before purchasing Badges to 
    
    avoid errors!<br />
                    </div>
                    <div>&nbsp;</div>';
    }
    else
    {     
    ?> <?php if(isset($_GET['buy'])){
    if($_GET['id']){
    $query = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id = 
    
    '".$_SESSION['user']['id']."'"));
    $idprice = mysql_fetch_array(mysql_query("SELECT * FROM badgeshop WHERE id = 
    
    '".$_GET['id']."'"));
    if($query['vip_points'] == 0||$query['vip_points'] - $idprice['price'] <= 0){
    echo "<center><strong>You have no Shells yet. Please purchase some before buying 
    
    any badges.</strong></center>";
    }
    if($query['vip_points'] >= $idprice['price']){
    echo "<center><strong>Badge has been purchased!</strong></center>";
    $sql = mysql_fetch_array(mysql_query("SELECT * FROM badgeshop WHERE id = '{$_GET
    
    ['id']}'"));
    $id = $_SESSION['user']['id'];
    $name = $sql['name'];
    mysql_query("INSERT INTO user_badges (user_id, badge_id) VALUES ('{$id}', 
    
    '{$name}')");
    mysql_query("UPDATE users SET vip_points = vip_points - '".$idprice['price']."' 
    
    WHERE username = '".$query['username']."'");
    }
    }
    }
     if( isset( $_GET['add'] ) and $_SESSION['user']['rank'] >= 7 ) {
    									
    										
    
    if( $_GET['id'] ) {
    										
    											
    
    $query = mysql_query( "SELECT * FROM `badgeshop` WHERE id = '{$_GET['id']}'" );
    											
    
    $array = mysql_fetch_assoc( $query );
    										
    										}
    										
    										
    
    if( $_POST['submit'] ) {
    										
    											
    
    $rare_name = $_POST['name'];
    											
    
    $rare_imgurl = $_POST['rare_imgurl'];
    											
    
    $rare_price = $_POST['rare_price'];
    										
    											
    											
    
    if( $_GET['id'] ) {
    											
    											
    
    	echo "<center><strong>Badge has been updated!</strong></center>";
    											
    
    	mysql_query( "UPDATE `badgeshop` SET name = '{$rare_name}', image = 
    
    '{$rare_imgurl}', price = '{$rare_price}' WHERE id = '{$_GET['id']}' " );
    											
    											
    
    }else{
    											
    											
    
    	echo "<center><strong>Badge has been added!</strong></center>";
    											
    
    	mysql_query( "INSERT INTO `badgeshop` ( name, image, price ) VALUES ( 
    
    '{$rare_name}', '{$rare_imgurl}', '{$rare_price}' )" );
    											
    											
    
    }
    											
    											
    
    echo "<meta http-equiv=\"refresh\" content=\"3;url={url}/badgeshop\" />";
    										
    										}
    
    else{
    										
    											
    
    echo "<div>";
    											
    
    echo "<form method=\"post\">";
    											
    											
    
    echo "<table width=\"100%\" cellpadding=\"0\" cellspacing=\"5\">";
    											
    
    echo "<tr>";
    											
    
    echo "<td style=\"width: 25%; text-align: right;\"><label 
    
    for=\"rare_imgurl\">Image</label></td>";
    											
    
    echo "<td style=\"padding: 0 0 0 10px;\"><input type=\"text\" name=\"rare_imgurl\" 
    
    size=\"50\" value=\"{$array['image']}\"></td>";
    											
    
    echo "</tr>";
    											
    
    echo "<tr>";
    											
    
    echo "<td style=\"width: 25%; text-align: right;\"><label 
    
    for=\"rare_name\">Name</label></td>";
    											
    
    echo "<td style=\"padding: 0 0 0 10px;\"><input type=\"text\" name=\"rare_name\" 
    
    size=\"50\" value=\"{$array['name']}\"></td>";
    											
    
    echo "</tr>";
    											
    
    echo "</tr>";
    											
    
    echo "<tr>";
    											
    
    echo "<td style=\"width: 25%; text-align: right;\"><label 
    
    for=\"rare_price\">Price</label></td>";
    											
    
    echo "<td style=\"padding: 0 0 0 10px;\"><input type=\"text\" name=\"rare_price\" 
    
    size=\"50\" value=\"{$array['price']}\"></td>";
    											
    
    echo "</tr>";
    											
    
    echo "</table>";
    											
    											
    
    echo "<div class=\"settings-buttons\">";
    											
    
    echo "<input type=\"submit\" value=\"Submit\" name=\"submit\" class=\"submit\" 
    
    style=\"float: right;\">";
    											
    
    echo "</div>";
    											
    
    echo "</form>";
    											
    
    echo "</div>";
    										
    										}
    									
    									}elseif( 
    
    isset( $_GET['delete'] ) and $_GET['id'] ) {
    									
    										
    
    echo "<center><strong>Badge has been deleted!</strong></center>";
    										
    
    mysql_query( "DELETE FROM `badgeshop` WHERE id = '{$_GET['id']}'" );
    										
    
    echo "<meta http-equiv=\"refresh\" content=\"3;url={url}/badgeshop\" />";
    									
    									}else{
    									
    										
    
    $query = mysql_query( "SELECT * FROM `badgeshop`" );
    										$j 
    
    = "a";
    										
    										
    
    echo "<table width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"5\">";
    										
    										
    
    echo "<tr align=\"center\" style=\"font-weight: bold;\">";
    										
    
    echo "<td>Image</td>";
    										
    
    echo "<td>Name</td>";
    										
    
    echo "<td>Price</td>";
    										
    
    if( $_SESSION['user']['rank'] >= 7 ) {
    											
    
    echo "<td>Options</td>";
    										}
    										
    
    echo "</tr>";
    										
    										
    
    while( $array = mysql_fetch_assoc( $query ) ) {
    										
    											
    
    $credits = $array['price']." Shells<img src=\"http://para-
    
    hotel.com/images/shell.png\">";
    											
    
    echo "<tr align=\"center\" id=\"rare-{$array['id']}\" class=\"rare {$j}\">";
    											
    
    echo "<td><img src=\"{$array['image']}\" /></td>";
    											
    
    echo "<td>{$array['name']}</td>";
    											
    
    echo "<td>";
    											
    
    echo $credits;
    											
    
    echo "<br />";
    											
    
    echo "";
    											
    
    echo "</td>";
    
    echo"<td>";
    echo"<a class=\"new-button\" href=\"{url}/index.php?url=badgeshop&buy&id={$array
    
    ['id']}\"><b>Purchase Badge</b><i></i></a>";
    echo"</td>";										
    
    									echo 
    
    "</tr>";
    											
    											
    
    $j++;
    											
    
    if( $j == "c" ) { $j = "a"; }
    										
    										}
    										
    										
    
    echo "</table>";
    									
    									}
    									
    									?>
    </div>
    </div> </div> </div> 
    <?php } ?></div>
    </div></div>
                        <div id="column2" class="column">
                            <div class="habblet-container ">
                                <div class="cbb clearfix blue ">
                                    <h2 class="title">{username}'s Balance</h2>
                                    <div style="padding:5px">
    <center>
    <?php $shells = mysql_fetch_array(mysql_query("SELECT * FROM users WHERE id = 
    
    '".$_SESSION['user']['id']."'")); if($shells['vip_points'] > 0){echo"You have: 
    
    ";echo $shells['vip_points']; echo" Shells<img src=\"http://para-
    
    hotel.com/images/shell.png\">";} if($shells['vip_points'] == 0){echo"<br><b>You 
    
    have no shells please purchase some in-order to get Badges, bots and coins!</b>"; 
    
    }?><br><br><b>Purchase more:</b> <a href="/shop">Here</a></center>
                                    </div>
                                </div>
                            </div>
    </div>
    
                            <script type="text/javascript">if (!
    
    $(document.body).hasClassName('process-template')) { Rounder.init(); }</script>
                        </div>
                    
    
           
            <script type="text/javascript">
                HabboView.run();
            </script>
    
            <!--[if lt IE 7]>
                <script type="text/javascript">
                    Pngfix.doPngImageFix();
                </script>
            <![endif]-->
        <br><br><br><br><br><br><br><br><br><br><br>
            <div id="footer" >
    
            </div>
        </body>
    </html>
    Please tell me if you encounter any troubles with this and I will fix it right away!
    Last edited by iRaged; 01-11-12 at 03:46 AM.


  2. #2
    Apprentice Intiv is offline
    MemberRank
    May 2012 Join Date
    NorwayLocation
    21Posts

    Re: RevCMS Badgeshop Addon

    Don't work, anyway you need to change /skins/New to /skins/{skin} I think.

  3. #3
    Banned Divide is offline
    BannedRank
    Aug 2011 Join Date
    British CoderLocation
    1,013Posts

    Re: RevCMS Badgeshop Addon

    Doesn't work...

  4. #4
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    Re: RevCMS Badgeshop Addon

    Ah yeah. I will fix that once I get back home. Also I'll set it up on local host and try and get it working there.

  5. #5
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    Re: RevCMS Badgeshop Addon

    Should've fixed the badgeshop to work with any skin. Add/Delete Badges hasn't been added yet.

  6. #6

    Re: RevCMS Badgeshop Addon

    This is so cool. I'll use it. Thank you!

    EDIT: You're able to buy the same badge multiple times.

  7. #7
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    Re: RevCMS Badgeshop Addon

    Quote Originally Posted by Abidas View Post
    This is so cool. I'll use it. Thank you!

    EDIT: You're able to buy the saume badge multiple times.
    Yes. I will add it so you can't later. Busy tonight so I'm not sure how soon it will be

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

    Re: RevCMS Badgeshop Addon

    hmm I dont like thecoding.
    Last edited by The General; 02-11-12 at 07:30 AM.

  9. #9
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    Re: RevCMS Badgeshop Addon

    Quote Originally Posted by tdid View Post
    hmm I dont like thecoding.
    Half of the coding isn't fully finished. This was first created when I was starting out my hotel. I have improved so much since opening it, I don't know if I will spend the time to improve this as I don't have a need for it as I don't use RevCMS anymore.

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

    Re: RevCMS Badgeshop Addon

    Quote Originally Posted by iRaged View Post
    Half of the coding isn't fully finished. This was first created when I was starting out my hotel. I have improved so much since opening it, I don't know if I will spend the time to improve this as I don't have a need for it as I don't use RevCMS anymore.
    Even though you're now using it on Uber you should secure it.

  11. #11
    Owner of Habbo.ac iRaged is offline
    MemberRank
    Nov 2011 Join Date
    229Posts

    Re: RevCMS Badgeshop Addon

    Quote Originally Posted by tdid View Post
    Even though you're now using it on Uber you should secure it.
    I'm not using Uber. I'm using a highly edited version of HoloCMS. Made it so much securer and faster. I'll see what I can do with the badgeshop today.

  12. #12
    Member Dzemanoosh is offline
    MemberRank
    Mar 2012 Join Date
    72Posts

    Re: RevCMS Badgeshop Addon

    Can you PM me the link for your RevCMS?

  13. #13
    Im Back! PythoneX12 is offline
    MemberRank
    Sep 2010 Join Date
    634Posts

    Re: RevCMS Badgeshop Addon

    I already released a hell of alot less messy one. And non exploiting one lol. It doesnt need sql. Just needs ur c_images ;)



Advertisement