Changing Perm

Started on the old forum in December 2007 · view the original in the archive · old links redirect here

34 replies · 1,672 views · started 18 years ago · 1 min read

7 participants
learner Lead · 587 posts #1

guys how do we change prem of admin and mod like we do it on db changing it to 2 for admin and 1 for mod. so if i want to change the number where in the script or where in the db i change the admin perm number from 2 to 4?

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

Guest #3

u change it in ibwf_users were it says PERM

WhiteWarrior Principal · 1,419 posts #4

u change it in ibwf_users were it says PERM

have a look in your core.php folder, where it says is owner change the perm number to 4 and save it

mcKeny Developer · 130 posts #6

i think you would do this

////this is saying if the user that your banding perm is two
 
$perm = mysql_fetch_array(mysql_query("SELECT perm FROM ibws_users WHERE id='".$who."'"));

if($perm[0] =='2')
{
echo "DUMB ASS YOU CANT BAND ANOTHER ADMIN!";
}

put that code where its says user have been band i think lol figur that out cos i dont use lava lair

R.M.C

PHP Adovocate B)

learner Lead · 587 posts #8
else if($action=="pun")
{
    $pid = $_POST["pid"];
    $who = $_POST["who"];
    $pres = $_POST["pres"];
    $pds = $_POST["pds"];
    $phr = $_POST["phr"];
    $pmn = $_POST["pmn"];
    $psc = $_POST["psc"];
    echo "<card id=\"main\" title=\"Mod CP\">";
  echo "<p align=\"center\">";
  
  $uip = "";
  $ubr = "";
  $pmsg[0]="Trashed";
  $pmsg[1]="Banned";
  $pmsg[2]="IP-Banned";
  if($pid=='2')
  {
    //ip ban
    $uip = getip_uid($who);
    $ubr = getbr_uid($who);
  }
  if(trim($pres)=="")
  {
    echo "<img src=\"images/notok.gif\" alt=\"X\"/>You must Specify a reson for punishing the user";
  }else{
    $timeto = $pds*24*60*60;
    $timeto += $phr*60*60;
    $timeto += $pmn*60;
    $timeto += $psc;
    $ptime = $timeto + time();
    $unick = getnick_uid($who);
    $res = mysql_query("INSERT INTO ibwf_penalties SET uid='".$who."', penalty='".$pid."', exid='".getuid_sid($sid)."', timeto='".$ptime."', pnreas='".mysql_escape_string($pres)."', ipadd='".$uip."', browserm='".$ubr."'");
    if($res)
          {
            mysql_query("UPDATE ibwf_users SET lastpnreas='".$pmsg[$pid].": ".mysql_escape_string($pres)."' WHERE id='".$who."'");
            mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='[b]".getnick_uid(getuid_sid($sid))."[/b] $pmsg[$pid] The user [b]".$unick."[/b] For ".$timeto." Seconds', actdt='".time()."'");
            
            echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick is $pmsg[$pid] for $timeto Seconds";
          }else{
            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
          }
  }
    echo "

<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";
}

i think this is where i should add that right? but i did somethin is going wrong External image (may be gone)

Failure is not when a girls leaves you, its only when you let her go virgin. heheh!!

BEST MOBILE ADVERTISER

External image (may be gone)

mcKeny Developer · 130 posts #9
else if($action=="pun") 

{ $pid = $_POST["pid"]; 

$who = $_POST["who"]; 

$pres = $_POST["pres"]; 

$pds = $_POST["pds"]; 

$phr = $_POST["phr"]; 

$pmn = $_POST["pmn"]; 

$psc = $_POST["psc"]; 
$perm =mysql_fetch_array(mysql_query("SELECT perm FROM ibws_users WHERE id='".$who."'"));

if($perm[0]=='2')
{
echo "<card id=\"main\" 
title=\"Mod CP\">"; 

echo "<p 
align=\"center\">"; 
echo "you cant band another admin ";
echo "</p>"."</card>";
}
echo "<card id=\"main\" 
title=\"Mod CP\">"; 

echo "<p 
align=\"center\">"; 

$uip = ""; 

$ubr = ""; 

$pmsg[0]="Trashed"; 

$pmsg[1]="Banned"; 

$pmsg[2]="IP-Banned"; 

if($pid=='2') 

{//ip ban 

$uip = getip_uid($who); 

$ubr = getbr_uid($who); 

} if(trim($pres)=="") 

{ echo "<img 
src=\"images/notok.gi 
f\" alt=\"X\"/>You must 
Specify a reson for 
punishing the user"; 

}else{ 

$timeto = $pds*24 *60 
*60; 

$timeto + = $phr*60 *60; 

$timeto + = $pmn*60; 

$timeto += $psc; 

$ptime = $timeto + time(); 

$unick = 
getnick_uid($who); 

$res = 
mysql_query("INSERT 
INTO ibwf_penalties SET 
uid='".$who."', 
penalty='".$pid."', 
exid='".getuid_sid 
($sid)."', 
timeto='".$ptime."', 
pnreas='".mysql_escap 
e_string($pres)."', 
ipadd='".$uip."', 
browserm='".$ubr."'"); 

if($res) 

{ mysql_query("UPDATE 
ibwf_users SET 
lastpnreas='".$pmsg[$p 
id].": 
".mysql_escape_string 
($pres)."' WHERE 
id='".$who."'"); 

mysql_query("INSERT 
INTO ibwf_mlog SET 
action='penalties', 
details='[b]".getnick_uid 
(getuid_sid($sid))."[/b] 
$pmsg[$pid] The user 
[b]".$unick."[/b] For 
".$timeto." Seconds', 
actdt='".time()."'"); 

echo "<img 
src=\"images/ok.gif\" 
alt=\"O\"/>$unick is $ 
pmsg[$pid] for $timeto 
Seconds"; 

}else{ 

echo "<img 
src=\"images/notok.gi 
f\" alt=\"X\"/>Database 
Error"; 

} } echo "

<a 
href=\"index.php?acti 
on=main&sid=$sid 
\"><img 
src=\"images/home.gif\" 
alt=\"*\"/>"; 

echo "Home</a>"; 

echo "</p></card>"; 

}

try that I THINK LOL

R.M.C

PHP Adovocate B)

mcKeny Developer · 130 posts #11

if the user that is banding perm is 2 if will get tha error message saying you cant band another admin hmmm maybe he could use the isadmin function eg

if(isadmin($who))
{
echo "you cant band another admin";
}

R.M.C

PHP Adovocate B)

wizard Senior · 493 posts #12

mmhm ill copy d code i did for that.

 
else if($action=="pun") {
 echo "<card id=\"main\" title=\"Mod CP\">";
 echo "<p align=\"center\">";

$getulvl = mysql_fetch_array(mysql_query("SELECT perm FROM ibwf_users WHERE id='".$who."'"));

if($getulvl[0]>0) {
echo "You cannot punish another staff member doofus!:P";
}else{
  
  $uip = "";
  $ubr = "";
  $pmsg[0]="Trashed";
  $pmsg[1]="Banned";
  $pmsg[2]="IP-Banned";
  if($pid=='2')
  {
    //ip ban
    $uip = getip_uid($who);
    $ubr = getbr_uid($who);
  }
  if(trim($pres)=="")
  {
    echo "<img src=\"images/notok.gif\" alt=\"X\"/>You must Specify a reson for punishing the user";
  }else{
    $timeto = $pds*24*60*60;
    $timeto += $phr*60*60;
    $timeto += $pmn*60;
    $timeto += $psc;
    $ptime = $timeto + time();
    $unick = getnick_uid($who);
    $res = mysql_query("INSERT INTO ibwf_penalties SET uid='".$who."', penalty='".$pid."', exid='".getuid_ses($ses)."', timeto='".$ptime."', pnreas='".mysql_escape_string($pres)."', ipadd='".$uip."', browserm='".$ubr."'");
    if($res)
          {
            mysql_query("UPDATE ibwf_users SET lastpnreas='".$pmsg[$pid].": ".mysql_escape_string($pres)."' WHERE id='".$who."'");
            mysql_query("INSERT INTO ibwf_mlog SET action='penalties', details='[b]".getnick_uid(getuid_ses($ses))."[/b] $pmsg[$pid] The user [b]".$unick."[/b] For ".$timeto." Seconds', actdt='".time()."'");
            
            echo "<img src=\"images/ok.gif\" alt=\"O\"/>$unick is $pmsg[$pid] for $timeto Seconds";
          }else{
            echo "<img src=\"images/notok.gif\" alt=\"X\"/>Database Error";
          }
  }
}
    echo "

<a href=\"index.php?action=main&ses=$ses\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p></card>";

}
mcKeny Developer · 130 posts #13

hmmm mike its tha same lol only thing is i only said if there a admin they cant

R.M.C

PHP Adovocate B)

wizard Senior · 493 posts #14

nope urs would give error, especially when a user does try to ban admin, it will show both pages sayin they r banned n that u cant ban them

mcKeny Developer · 130 posts #15

OH yeah your right i didn't put else

if($perm[0]=='2')
{
echo "you cant band another admin idiot";
}
else
{
//punish him
}

R.M.C

PHP Adovocate B)

mcKeny Developer · 130 posts #16

hmmm i think both of us code is valid cause i use the card so it wont excute the other codes if the first card is trigger

R.M.C

PHP Adovocate B)

mcKeny Developer · 130 posts #20

trash take away all your credit etc..... the reason why my code is error is cos it should be

ibwf_users

but i have ibws_users

R.M.C

PHP Adovocate B)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close