plz help me coder i have changed perm in my site but i m facing error in access forum. staff and club owner also cant open topic in club and newbie forum. this function is in my core.php
function canaccess($uid, $fid)
{
$fex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_forums WHERE id='".$fid."'"));
if($fex[0]==0)
{
return false;
}
$persc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_acc WHERE fid='".$fid."'"));
if($persc[0]==0)
{
$clid = mysql_fetch_array(mysql_query("SELECT clubid FROM ibwf_forums WHERE id='".$fid."'"));
if($clid[0]==0)
{
return true;
}else{
if(ismod($uid))
{
return true;
}else{
$ismm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid[0]."'"));
if($ismm[0]>0)
{
return true;
}else{
return false;
}
}
}
}else{
$gid = mysql_fetch_array(mysql_query("SELECT gid FROM ibwf_acc WHERE fid='".$fid."'"));
$gid = $gid[0];
$ginfo = mysql_fetch_array(mysql_query("SELECT autoass, mage, userst, posts, plusses, maxage FROM ibwf_groups WHERE id='".$gid."'"));
if($ginfo[0]=="1")
{
$uperms = mysql_fetch_array(mysql_query("SELECT birthday, perm, posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
if($ginfo[2]==456)
{
if(isowner($uid))
{
return true;
}else{
return false;
}
}
if($ginfo[2]==457)
{
if(isheadadmin($uid))
{
return true;
}else{
return false;
}
}
if($ginfo[2]==45
{
if(isadmin($uid))
{
return true;
}else{
return false;
}
}
if($ginfo[2]==459)
{
if(ismod($uid))
{
return true;
}else{
return false;
}
}
if($uperms[1]>$ginfo[2])
{
return true;
}
$acc = true;
if($ginfo[1]!=0){
if(getage($uperms[0])< $ginfo[1])
{
$acc = false;
}
}
if($ginfo[5]!=0){
if(getage($uperms[0])> $ginfo[5])
{
$acc = false;
}
}
if($uperms[2]<$ginfo[3])
{
$acc = false;
}
if($uperms[3]<$ginfo[4])
{
$acc = false;
}
}
}
return $acc;
}
i have changed perm in my site like owner=456
head admin=457
admin=458
mod=459
plz what is mistake in my code??????? plz help me thanx in advance
function canaccess($uid, $fid)
{
$fex = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_forums WHERE id='".$fid."'"));
if($fex[0]==0)
{
return false;
}
$persc = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_acc WHERE fid='".$fid."'"));
if($persc[0]==0)
{
$clid = mysql_fetch_array(mysql_query("SELECT clubid FROM ibwf_forums WHERE id='".$fid."'"));
if($clid[0]==0)
{
return true;
}else{
if(ismod($uid))
{
return true;
}else{
$ismm = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_clubmembers WHERE uid='".$uid."' AND clid='".$clid[0]."'"));
if($ismm[0]>0)
{
return true;
}else{
return false;
}
}
}
}else{
$gid = mysql_fetch_array(mysql_query("SELECT gid FROM ibwf_acc WHERE fid='".$fid."'"));
$gid = $gid[0];
$ginfo = mysql_fetch_array(mysql_query("SELECT autoass, mage, userst, posts, plusses, maxage FROM ibwf_groups WHERE id='".$gid."'"));
if($ginfo[0]=="1")
{
$uperms = mysql_fetch_array(mysql_query("SELECT birthday, perm, posts, plusses FROM ibwf_users WHERE id='".$uid."'"));
if($ginfo[2]==456)
{
if(isowner($uid))
{
return true;
}else{
return false;
}
}
if($ginfo[2]==457)
{
if(isheadadmin($uid))
{
return true;
}else{
return false;
}
}
if($ginfo[2]==45
{
if(isadmin($uid))
{
return true;
}else{
return false;
}
}
if($ginfo[2]==459)
{
if(ismod($uid))
{
return true;
}else{
return false;
}
}
if($uperms[1]>$ginfo[2])
{
return true;
}
$acc = true;
if($ginfo[1]!=0){
if(getage($uperms[0])< $ginfo[1])
{
$acc = false;
}
}
if($ginfo[5]!=0){
if(getage($uperms[0])> $ginfo[5])
{
$acc = false;
}
}
if($uperms[2]<$ginfo[3])
{
$acc = false;
}
if($uperms[3]<$ginfo[4])
{
$acc = false;
}
}
}
return $acc;
}
i have changed perm in my site like owner=456
head admin=457
admin=458
mod=459
plz what is mistake in my code??????? plz help me thanx in advance
Comment