Level system virker ikke ordenligt if ($_SESSION['admin_id'] == 0) {
Hej Eksperten...Jeg er igang med et Habbo Fansite.
- Jeg skal have nogle levels som jeg har
fået hjælp til i mine tidligere tråd.
Min kode skulle gøre det at hvis man er gæst
skal den skrive "Log venligst ind førest"
hvis man er logget på med et
Admin_id = 0 Skal den skrive "Din Bruger Er Bannet!"
Hvis man er logget på med
Admin_id = 1-8 Skal den vise profilen...
Problemet er bare, hvis man ikke er logget ind så
går php Efter Admin_id = 0
Mit spørgsmål er, hvordan gør jeg så en alm gæst ikke kan se en profil og skriver "Log vensligst ind førest" og en bannet bruger ikke kan se en profil og skriver "din bruger er bannet"
samt skal alle andre med admin_id fra 1 til & med 8 have profilen
vist
Jeg har denne kode:
_________________________________________________
<?
if ($_SESSION['admin_id'] == 0) {
?>
Din bruger er bannet!
<?
}
else
{
$uid = $_GET['id'];
if($uid != 0 || !empty($uid)){
$select_user = mysql_query("SELECT * FROM members WHERE id = '$uid' LIMIT 1")or die(mysql_error());
$count_user = mysql_num_rows($select_user);
if($count_user != 0 && $count_user >= 1){
while($row = mysql_fetch_array($select_user)){
$id = $row['id'];
$user = strip_tags($row['user']);
$status = strip_tags($row['status']);
$email = strip_tags($row['email']);
$name = strip_tags($row['name']);
$lastname = strip_tags($row['lastname']);
$habname = strip_tags($row['hab_name']);
$profile_text = strip_tags($row['pro_text']);
$online = strip_tags($row['online']);
$lastonline = strip_tags($row['lastonline']);
$created = strip_tags($row['created']);
$stilling = strip_tags($row['stilling']);
}
$profile_text = str_replace("", "<b>", $profile_text);
$profile_text = str_replace("", "</b>", $profile_text);
$profile_text = str_replace("", "<i>", $profile_text);
$profile_text = str_replace("", "</i>", $profile_text);
$profile_text = str_replace("", "<u>", $profile_text);
$profile_text = str_replace("", "</u>", $profile_text);
$profile_text = str_replace("[url=", "<a href=\"", $profile_text);
$profile_text = str_replace("[/url]", "</a>", $profile_text);
$profile_text = str_replace("]", "\" target=\"_blank\">", $profile_text);
if($status == "Mobelekspert"){
$status = "Møbelekspert";
}
if($online == "Online"){
$on_of = "online";
} else {
$on_of = "offline";
}
?><style type="text/css">
<!--
body,td,th {
font-size: 16px;
}
-->
</style>
<div id="content_top">
<img src="images/<?=$on_of;?>.gif" />
</div>
<div id="content_middle">
<table cellspacing="0" width="320" class="table">
<tr>
<td rowspan="4" width="225">
<table height="152" style="height: 169px; width: 164px; background-image: url('http://narro.dk/layout/image_frame.gif');">
<tr>
<td height="154" style="text-align: center; vertical-align: top; height:10%; padding: 4px; padding-bottom: 0px;">
<div style='width: 150px; height: 112px; overflow: hidden; border: 1px solid #777777;'><?
$destination = "images/profile_pics/" . $id . ".jpg";
//Tjekker om profil billedet findes.
if(file_exists($destination)){
echo "<img src='" . $destination . "' width=\"75\" height=\"100\" /><br />";
}else{ //Hvis der ikke er noget profil billede. ?>
<img src="http://www.habbo.dk/habbo-imaging/avatarimage?user=<?=$habname;?>&action=stand&direction=4&head_direction=4&gesture=sml&size=l" id="habuser2" /><br />
<?PHP
}
?>
</div><div style="text-align:center; color:#aaaaaa; margin-top:4px; vertical-align: bottom;">
brugerens-ID: <?=$id;?> </div></td>
</tr>
</table></td>
<tr>
<td class="td_two" width="2"> </td>
</tr>
<tr>
<td class="td_two" width="2"> </td>
</tr>
<tr>
<td class="td_two" width="2"> </td>
</tr>
<tr>
<td width="225" class="td_two"><em>Rigtige navn</em>: <?=$name;?></td>
</tr>
<tr>
<td class="td_two" width="225"><em><?=$name;?>'s habbo</em>: <a href="http://www.habbo.dk/home/<?=$habname;?>" target="_blank"><?=$habname;?></a> </td>
<tr>
<td width="225" class="td_two"><em>Oprettet</em>: <?=$created;?></td>
</tr>
<tr>
<td width="225" class="td_two"><em>Sidst Online</em>: <?=$lastonline;?></td>
</tr>
</tr>
<tr>
<td class="td_two" width="225"><em>bruger-type</em>: <?=$stilling;?> </td>
</tr>
<tr>
<td class="td_two" colspan="4" height="2"></td>
</tr>
<tr>
<td class="td_two" colspan="4" style="border-top: 1px solid #000000; padding-top: 5px;"></td>
</tr>
</table>
<span style="text-align:center; color:#aaaaaa; margin-top:4px; vertical-align: bottom;">
<textarea name="profiltekst" cols="35" rows="7"><?=$profile_text;?>
</textarea>
</span>
</div>
<?
}
else {
?>
<div id="content_top">
<h1>Fejl!</h1>
</div>
<div id="content_middle">
<p>
<font color="red">Brugeren Blev Ikke Fundet!</font>
</p>
</div>
<?
}
}
}
?>
__________________________________________
M.v.h
Mikkel Bering
