faire fonctionner les badge ! habbo cms

1:allez sur "http://localhost/phpmyadmin"
2:allez sur votre database (holodb)
3:en haut il y a un bouton avec marqué "sql"
4:dans la grande case mettez le code suivant:

Code :
DROP TABLE `users_badges`;
CREATE TABLE IF NOT EXISTS `users_badges` (
`userid` int(15) NOT NULL,
`badgeid` varchar(5) collate latin1_general_ci NOT NULL default '',
`iscurrent` enum('0','1') collate latin1_general_ci NOT NULL default '0',
`slotid` varchar(255) collate latin1_general_ci NOT NULL default '0',
`badge` varchar(255) collate latin1_general_ci default NULL,
PRIMARY KEY (`userid`,`badgeid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

5:allez dans "C:/xampp/htdoc/housekeeping/ et ouvrez le fichier "badgetool.php" avec le bloc-note
6:supprimez tout le contenue de "badgetool.php"
7:mettez ce code a la place:
Code :
<?php
/*===================================================+
|| # HoloCMS - Website and Content Management System
|+===================================================+
|| # Copyright © 2008 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|+===================================================+
|| # HoloCMS is provided "as is" and comes without
|| # warrenty of any kind. HoloCMS is free software!
|| # Thanks to Wil & Pure for Release of the Badge System
|+===================================================*/

require_once('../core.php');
if($hkzone !== true){ header("Location: index.php?throwBack=true"); exit; }
if(!session_is_registered(acp)){ header("Location: index.php?p=login"); exit; }
if(function_exists(SendMUSData) !== true){ include('../includes/mus.php'); }

$pagename = "User Badge Management";

if(isset($_POST['badge'])){
$badge = $_POST['badge'];
$key = addslashes($_POST['name']);

$check = mysql_query("SELECT id FROM users WHERE name = '".$key."' LIMIT 1") or die(mysql_error());
$exists = mysql_num_rows($check);

if($exists > 0){

if(strlen($badge) > 2 && strlen($badge) < 5){

$row = mysql_fetch_assoc($check);
$userid = $row['id'];

$check = mysql_query("SELECT * FROM users_badges WHERE userid = '".$userid."' AND badgeid = '".$badge."' LIMIT 1") or die(mysql_error());
$already_has_badge = mysql_num_rows($check);

if($already_has_badge < 1){

mysql_query("UPDATE users SET badge_status = '1' WHERE name = '".$key."' LIMIT 1") or die(mysql_error());
mysql_query("INSERT INTO users_badges (userid,badgeid,iscurrent,badge) VALUES ('".$userid."','".$badge."','1','".$badge."')") or die(mysql_error());

$msg = "Gave the user this badge (" . $badge . ") and set it as current badge successfully.";

mysql_query("INSERT INTO system_stafflog (action,message,note,userid,targetid,timestamp) VALUES ('Housekeeping','Gave user ".$badge." badge','badgetool.php','".$my_id."','".$userid."','".$date_full."')") or die(mysql_error());

@SendMusData('UPRS' . $userid);

} else {

mysql_query("UPDATE users_badges SET iscurrent = '0' WHERE userid = '" . $userid . "'");
mysql_query("UPDATE users_badges SET iscurrent = '1' WHERE badgeid = '" . $badge . "' AND userid = '" . $userid . "' LIMIT 1") or die(mysql_error());

$msg = "This user already has this badge; the badge (" . $badge . ") has been set as the user's current badge successfully.";

mysql_query("INSERT INTO system_stafflog (action,message,note,userid,targetid,timestamp) VALUES ('Housekeeping','Set current badge to ".$badge."','badgetool.php','".$my_id."','".$userid."','".$date_full."')") or die(mysql_error());

@SendMusData('UPRS' . $userid);

}

} else {

$msg = "Invalid badge. Badge codes may only be 3-4 characters long.";

}

} else {

$msg = "An user with this name/id does not exist!";

}

}

@include('subheader.php');
@include('header.php');
?>
<table cellpadding='0' cellspacing='8' width='100%' id='tablewrap'>
<tr> <td width='22%' valign='top' id='leftblock'>
<div>
<!-- LEFT CONTEXT SENSITIVE MENU -->
<?php @include('usermenu.php'); ?>
<!-- / LEFT CONTEXT SENSITIVE MENU -->
</div>
</td>
<td width='78%' valign='top' id='rightblock'>
<div><!-- RIGHT CONTENT BLOCK -->

<?php if(isset($msg)){ ?><p><strong><?php echo $msg; ?></p></strong><?php } ?>

<form action='index.php?p=badgetool&do=something' method='post' name='theAdminForm' id='theAdminForm'>
<div class='tableborder'>
<div class='tableheaderalt'>Badge Manager</div>

<table width='100%' cellspacing='0' cellpadding='5' align='center' border='0'>
<tr>
<td class='tablerow1' width='40%' valign='middle'><strong>Username</strong><div class='graytext'>The username of who this action will apply to.</div></td>
<td class='tablerow2' width='60%' valign='middle'><input type='text' name='name' value="" size='30' class='textinput'></td>
</tr>

<tr>
<td class='tablerow1' width='40%' valign='middle'><strong>Badgecode</strong><div class='graytext'>The bage code, eg. 'ADM' or 'XM8'.</div></td>
<td class='tablerow2' width='60%' valign='middle'><input type='text' name='badge' value="" size='30' class='textinput'></td>
</tr>

<tr>
<tr><td align='center' class='tablesubheader' colspan='2' ><input type='submit' value='Give badge' class='realbutton' accesskey='s'></td></tr>
</form></table></div><br />

</div><!-- / RIGHT CONTENT BLOCK -->
</td></tr>
</table>
</div><!-- / OUTERDIV -->
<div align='center'><br />
<?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
printf('Time: %.3f', $totaltime);
?>
</div>

 

by secret...

Créer un site gratuit avec e-monsite - Signaler un contenu illicite sur ce site