Falls sich wer mit dieser CMS auskennt > yCMS v0.1 by Dogus | Fix by Whend & Foxygen. < habe ich mal eine Frage.
Wie kann ich den Badgeshop ändern?
Spoiler anzeigen
PHP
<html>
<?php
require('./inc/core.php');
require("./inc/session.php");
include('./templ/head.php');
$site = 'badgeshop';
$page = 'extras';
?>
<title>Habbo: Badgeshop</title>
<body scroll="no">
<?php include('./templ/header.php'); ?>
<div id="raw">
<div id="container" class="badgeshop" style="width:650px;height: 300px;">
<div id="box">
<?php
$badge = mysql_query("SELECT * FROM cms_badgeshop ORDER BY ID LIMIT 30");
while($sql = mysql_fetch_assoc($badge)) {
?>
<div id="<?php echo $sql['badge']; ?>"><div id="badgeicon"><img src="../client/c_images/album1584/<?php echo $sql['badge']; ?>.gif"> </div> </div>
<script>
$("#<?php echo $sql['badge']; ?>").click(function(){
$('.ALLBOX').hide();
$("#<?php echo $sql['badge']; ?>BOX").fadeIn();
});
</script>
<?php } ?>
</div>
</div>
<?php
$badge = mysql_query("SELECT * FROM cms_badgeshop ORDER BY ID LIMIT 30");
while($sql = mysql_fetch_assoc($badge)) {
$mybadge = mysql_fetch_assoc(mysql_query("SELECT * FROM user_badges WHERE user_id = '".$myrow['id']."' AND badge_id = '".$sql['badge']."' LIMIT 1"));
$kosten = $sql['kosten'];
if(isset($_POST[''.$sql['badge'].''])) {
if($myrow['credits'] < $sql['kosten']) { echo '<div class="error">Sie haben nicht genügend Taler.</div>'; }
elseif($mybadge['badge_id'] == $sql['badge']) { echo '<div class="error">Du besitzt bereits das Badge.</div>'; }
else {
mysql_query("INSERT INTO user_badges SET user_id = '".$myrow['id']."', badge_id = '".$sql['badge']."'");
mysql_query("UPDATE users SET credits = '".($myrow['credits']-$kosten)."' WHERE username = '".$username."'");
echo "Erfolgreich gekauft, bitte gehe erneut in's Hotel rein.";
$core->MUS('updatecredits', $myrow['id']);
}
} ?>
<div id="<?php echo $sql['badge']; ?>BOX" class="ALLBOX" style="display:none;">
<div id="container" style="width: 240px;float: right;margin-right: 0px;">
<div id="box" style="text-align:center;">
<h4 ><?php echo $sql['badgedesc']; ?> </h4>
<img src="../client/c_images/album1584/<?php echo $sql['badge']; ?>.gif"><br>
<p><b><?php echo $sql['kosten']; ?> Taler</b></p>
<form method="POST" >
<input type="submit" name="<?php echo $sql['badge']; ?>" class="submitbbtn" value="Kaufen">
</form>
</div>
</div>
</div>
<?php } ?>
</div>
</body>
<?php include('./templ/footer.php'); ?>
</html>
Alles anzeigen