PHP Code:
$m=mysql_fetch_array(mysql_query("SELECT login FROM chat_users WHERE id='".$id."'"));
$mod=mysql_fetch_array(mysql_query("SELECT moder FROM chat_users WHERE id='".$id."'"));
$user = mysql_fetch_assoc($q);
$q = @mysql_query("select * from `buddylist` where `test`='".$data['login']."' and ci='".$ci."' and agreed='1';");
$private=mysql_fetch_array(mysql_query("SELECT private FROM chat_users WHERE login='".$dblogin."'"));
if($private[0] == 1 $mod[0]=1 OR $m==$dblogin OR $am=$q)
{
##the user profile details
}
i have tried to code this too :
PHP Code:
$private = mysql_fetch_row(mysql_query("SELECT private FROM chat_users WHERE login='".$dblogin."'"));
if(($private[0]=='1') && (budres(getuid_sid($sid), $dblogin)!=2) && (!ismod(getuid_sid($sid))) && (getuid_sid($sid)!=$dblogin))
{
$unick = getnick_uid($dblogin);
echo "<u>$unick Profile is private</u><br/>";
}else
{
profile
}
<?
function ismod($uid)
{
$perm = mysql_fetch_array(mysql_query("SELECT moder FROM chat_users WHERE id='".$id."'"));
if($perm[0]=1)
{
return true;
}
}
function getuid_sid($sid)
{
$uid = mysql_fetch_array(mysql_query("SELECT login FROM chat_users WHERE id='".$id."'"));
$uid = $uid[0];
return $uid;
}
function budres($uid, $tid)
{
//3 = can't bud
//2 = already buds
//1 = request pended
//0 = can bud
if($uid==$dblogin)
{
return 3;
}
if (arebuds($uid, $tid))
{
return 2;
}
$req = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM buddylist WHERE ((test='".$uid."' AND name='".$dblogin."') OR (test='".$dblogin."' AND name='".$uid."')) AND agreed='0'"));
if($req[0]>0)
{
return 1;
}
$notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM buddylist WHERE (test='".$dblogin."' OR name='".$dblogin."') AND agreed='1'"));
global $max_buds;
if($notb[0]>=$max_buds)
{
return 3;
}
$notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM buddylist WHERE (name='".$uid."' OR test='".$uid."') AND agreed='1'"));
global $max_buds;
if($notb[0]>=$max_buds)
{
return 3;
}
return 0;
}
function getnick_uid($uid)
{
$unick = mysql_fetch_array(mysql_query("SELECT login FROM chat_users WHERE id='".$id."'"));
return $unick[0];
}
?>
but its also not working can someone make it work please .
Comment