PDA

View Full Version : [Kane] Need a Script!



Assassinator
24-06-2007, 07:51 AM
Ok,

On my game you log in and it takes you to the news page.

And i have news then i have

''~Admin CP''
''~Mod CP''

Normaly user's can see it but not acsess it.

Can anyone give me a script where only The Staff can see it?

Thanks.

Rep+

Moved by opensourcehost (Forum Moderator) from Web Designing: Please post in the correct forum next time, thanks http://habboxforum.com/images/smilies/smile.gif.

timROGERS
24-06-2007, 07:59 AM
We can't really do it for you because we don't know how the game is coded. Basically, you need to add an if statement that checks the logged in user's name in the database, and if they're in the moderator usergroup show them the page, and if they're not show them a permissions error.

Assassinator
24-06-2007, 08:01 AM
We can't really do it for you because we don't know how the game is coded. Basically, you need to add an if statement that checks the logged in user's name in the database, and if they're in the moderator usergroup show them the page, and if they're not show them a permissions error.

Well, This is the code for the Cp's On news page.


<tr><td>
<?php if ($fetch->userlevel != "0"){
echo "
<tr>
<td><a href=\"admincp.php\" target=\"main\">~<b>Admin CP</font></center></a></td>
<tr>";
}
?>
<center>
<tr><td>
<?php if ($fetch->userlevel != "0"){
echo "
<tr>
<td><a href=\"modcp.php\" target=\"main\">~<b>MOD CP</a></td>
<tr>";
}
?>

I Just need it so user levels 1 & 4 see them.

Blob
24-06-2007, 09:30 AM
Well, This is the code for the Cp's On news page.


<tr><td>
<?php if ($fetch->userlevel != "0"){
echo "
<tr>
<td><a href=\"admincp.php\" target=\"main\">~<b>Admin CP</font></center></a></td>
<tr>";
}
?>
<center>
<tr><td>
<?php if ($fetch->userlevel != "0"){
echo "
<tr>
<td><a href=\"modcp.php\" target=\"main\">~<b>MOD CP</a></td>
<tr>";
}
?>

I Just need it so user levels 1 & 4 see them.


<tr><td>
<?php if ($fetch->userlevel == "4"){
echo "
<tr>
<td><a href=\"admincp.php\" target=\"main\">~<b>Admin CP</font></center></a></td>
<tr>";
}
?>
<center>
<tr><td>
<?php if ($fetch->userlevel == "1" || $fetch->userlevel == "4"){
echo "
<tr>
<td><a href=\"modcp.php\" target=\"main\">~<b>MOD CP</a></td>
<tr>";
}
?>

Assassinator
24-06-2007, 09:34 AM
Thanks Ryan,

Ille try when site's back up.

Rep+ If it works;)

Aflux
24-06-2007, 10:07 AM
I thought you were fluent in PHP?

Assassinator
24-06-2007, 10:11 AM
Adam, Can you for once just not post in any of my threads?

Aflux
24-06-2007, 10:19 AM
Erm, no.

A forum is for discussion and that's what I'm doing.

Oni
24-06-2007, 10:23 AM
Adam, Can you for once just not post in any of my threads?
He can do what he wants, Its your fault for claiming your fluent in php.

Assassinator
24-06-2007, 10:23 AM
Well Dont Discuss in my threads.

Aflux
24-06-2007, 10:25 AM
Well Dont Discuss in my threads.
I shall if I so wish, there's no rules against it.

Assassinator
24-06-2007, 10:30 AM
No there isnt, But im asking you.

Oni
24-06-2007, 10:38 AM
Well Dont Discuss in my threads.
Where else are we supposed to discuss it?

Want to hide these adverts? Register an account for free!