• Unfortunately, we have experienced significant hard drive damage that requires urgent maintenance and rebuilding. The forum will be a state of read only until we install our new drives and rebuild all the configurations needed. Please follow our Facebook page for updates, we will be back up shortly! (The forum could go offline at any given time due to the nature of the failed drives whilst awaiting the upgrades.) When you see an Incapsula error, you know we are in the process of migration.

[SNIPPET] Badge Shop - DeltaCMS

Status
Not open for further replies.
Creative One.
Joined
Oct 20, 2011
Messages
274
Reaction score
106
This is a snippet for a BadgeShop in DeltaCMS.
Like it, use it, do whatever you want

Demo >
PHP:
<?php
$pagename = "Badge Winkel";
$tab = "Winkel";
$page = "Badges";

$sBelcr = user(belcredits);
$sUname = X($_SESSION['username']);

$sSql2 = mysql_query("SELECT * FROM badge_shop");

if (isset($_GET['GetBadge'])) {
	$sId = X($_GET["GetBadge"]);

	$sSql1 = mysql_query("SELECT * FROM badge_shop WHERE rare_id = '".$sId."'");
	$rareCost = mysql_fetch_assoc($sSql1);
	$sExisting = mysql_query("SELECT rare_id FROM badge_shop WHERE rare_id = '" . $sId . "'");
	$sCost = $rareCost['cost'];

	if(!mysql_num_rows($sExisting))
	{
		$sErr = 'Deze Badge bestaat niet';
	}
	else
	{
		if($sBelcr < $rareCost['cost'])
		{
			$sErr = 'Je hebt niet genoeg Belcredits';
		}
		else
		{
		mysql_query("INSERT INTO user_badges (user_id, badge_id) VALUES ('".user(id)."', '".$sId."')");
		mysql_query("UPDATE users SET belcredits = belcredits - $sCost WHERE username = '$sUname' LIMIT 1");
		$sErr = 'Gefeliciteerd je hebt je badge gekocht <b>Herlaad nu het hotel!</b>';
		}
	}
}
?>
<?php include('head.php'); ?>
<link type="text/css" rel="stylesheet" href="{site}/style/Habbo/CSS/Style/main.css" />
<link rel="stylesheet" href="http://images.habbo.com/habboweb/{webbuild}/web-gallery/static/styles/cbs2credits.css" type="text/css" />
<link rel="stylesheet" href="http://images.habbo.com/habboweb/{webbuild}/web-gallery/static/styles/newcredits.css" type="text/css" />
<script src="http://images.habbo.com/habboweb/{webbuild}/web-gallery/static/js/cbs2credits.js" type="text/javascript"></script><meta name="SKYPE_TOOLBAR" content="SKYPE_TOOLBAR_PARSER_COMPATIBLE" />

								<script src="http://images.habbo.com/habboweb/{webbuild}/web-gallery/static/js/newcredits.js" type="text/javascript"></script>

<body id="cbs2credits">
<?php include('header.php'); ?>


<div id="container">
	<div id="content" style="position: relative" class="clearfix">
    <div id="column1" class="column">

				<div class="habblet-container ">
						<div class="cbb clearfix orange ">

							<h2 class="title">{sitename} Winkel!
							</h2>



<!--<div class="method-group online clearfix  bestvalue  cbs2">-->
<div id="group-content-810">

<div style="font-size: 12px;">


                                <b><h3><center><font color='darkred'><?php if ($sErr != '') { echo $sErr; } ?></center></font></b>
                                <div class="orange">
                         <table width="100%" border="0">
                                    <tr>
                                        <td width="25%" style="text-align:center">
                                            <h2 class="title">
                                                <b>Badge</span>
                                            </h2>
                                            </b>
                                        </td>
                                        <td width="45%" style="text-align:left">
                                            <h2 class="title">
                                                <b>Kosten</b>
                                            </h2>
                                        </td>
                                        <td width="40%" style="text-align:center">
                                            <h2 class="title">
                                                <b>Klik om 'm te kopen</b>
                                            </h2>
                                        </td>
                                        </h2>
                                    </tr>
                                    <tr>
                                        <?php while($sRares = mysql_fetch_assoc($sSql2)) {
					$sHtml = '<td width="25%" style="border-radius:7px;text-align:center;background-color:#f5f5f5"><img  src="{site}/Public/Images/Badges/'.$sRares['rare_id'].'.gif"></td>';
					$sHtml .= '<td width="20%" style="border-radius:7px;text-align:center;background-color:#f5f5f5"><b>'.$sRares['cost'].'</b> Belcredits </td>';
					$sHtml .= '<td width="20%" style="border-radius:7px;text-align:center;;background-color:#f5f5f5"><a href="{site}/index.php?page=winkel-badge&GetBadge='.$sRares['rare_id'].'">';
					$sHtml .= '<center>Koop!!</center></a></td></tr>';

					echo $sHtml;
								} ?>
                                </table>

</div>

</div>
</div>
<div style="padding: 1px 55px 4px 10px; text-align: center; font-weight: bolder; font-family: arial; font-size: 13px;">
<a href="#" class="new-button" onclick="mbetaal('id=1088487');return false;"><b>Koop 100 Belcredits</b><i></i></a>
<a href="#" class="new-button" onclick="mbetaal('id=1088477');return false;"><b>Koop 75 Belcredits</b><i></i></a>
<a href="#" class="new-button" onclick="mbetaal('id=1088467');return false;"><b>Koop 50 Belcredits</b><i></i></a>
<a href="#" class="new-button" onClick="mbetaal('id=1088427');return false;"><b>Koop 25 Belcredits</b><i></i></a>
</div>
</div>
</div>
</div>
<script type="text/javascript">if (!$(document.body).hasClassName('process-template')) { Rounder.init(); }</script>




<script type="text/javascript">
document.observe("dom:loaded", function() { new NewRedeemHabblet(); });
</script>



					</div>
				</div>

</div>



<?php include('footer.php'); ?>
</body>
 
Last edited:
Thanks for a great time!
Joined
Jun 10, 2009
Messages
681
Reaction score
122
nice i guess but would be better if provided more info, print screen even if nessacerry , but whatever

Nice thanks for the release.
 
Zephyr Studios
Loyal Member
Joined
Feb 18, 2012
Messages
1,877
Reaction score
724
Good release. Thanks
 
Experienced Elementalist
Joined
Feb 19, 2012
Messages
287
Reaction score
23
what about the sql?
 
Newbie Spellweaver
Joined
Feb 10, 2011
Messages
65
Reaction score
6
Its nice, unfortunately i dont have belcredits on my DeltaCMS..
9/10:eek:tt:
 
Experienced Elementalist
Joined
Jul 10, 2008
Messages
248
Reaction score
15
Good one tbh but its in dutch lmao :sleep:

It is a snippit in his language, IT IS NOT A RELEASE!!! But I am dutch and I could profit of it. Thanks, code looks nice. No bugs that I could see.

Send from my GT-S5660 using Tapatalk 2
 
Skilled Illusionist
Joined
May 7, 2011
Messages
342
Reaction score
25
Thanks for this release, and i dont like 'AmirZ CMS edits'
 
Junior Spellweaver
Joined
Jul 22, 2011
Messages
119
Reaction score
18
Mhm nice but i won't use it because i don't like frost cms that much.. anymore..
 
Status
Not open for further replies.
Back
Top