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 >
Like it, use it, do whatever you want
Demo >
You must be registered to see links
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: