inbox help

Started on the old forum in April 2009 · view the original in the archive · old links redirect here

7 replies · 471 views · started 17 years ago · 1 min read

3 participants
wackywizards Junior · 44 posts #1

hi there all i am trying to do a bit of coding but got a error i been working on this for a few days but not getting it to work any chance some one can help me please this what i got in my inbex page

$private = mysql_fetch_array(mysql_query("SELECT private FROM ibwf_users WHERE id='".$uid."'"));
  if($private[0]==0){
  echo "<a href=\"index.php?action=inboxenable&sid=$sid\">»Enable inbox</a><br/>";
  }else{
  echo "<a href=\"index.php?action=inboxdisable&sid=$sid\">»Disable Inbox</a><br/>";
  }

and this what i got in my core

/////////////////////////////////////////////inboxs on

function inboxson($who)

{

  $res = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE id='".$who."' AND readmsg='1'"));

    if($res[0]>0)

    {

      return true;

    }

    return false;

}

i keep getting error

[B]Warning[/B]:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [B]/home/********/public_html/web/index.php[/B] on line [B]662

hope some one help me fix this please this is so members can turn there inboxes on and off just like pop ups:o

Anshul Senior · 296 posts #2
function inboxson($who)
{
$res = mysql_fetch_array(mysql_query("SELECT private FROM ibwf_users WHERE id='".$who."'"));
if($res[0]>0)
{
return true;
}
else
{
return false;
}
}
wackywizards Junior · 44 posts #4

Spook wrote:

function inboxson($who)
{
$res = mysql_fetch_array(mysql_query("SELECT private FROM ibwf_users WHERE id='".$who."'"));
if($res[0]>0)
{
return true;
}
else
{
return false;
}
}

this still dont work

Anshul Senior · 296 posts #5

sweetangel wrote: but with this code the staff members can send inbox at user allow??

😕 i dont think it wil allow

u need to edit this code like this

function inboxson($uid)
{
global $sid;
$_logged_id = getuid_sid($sid);
  $query = mysql_fetch_array(mysql_query("SELECT  private FROM usertable WHERE id='".$uid."'"));
  if($query[0]!="0"||ismod($_logged_id))
  {
    return true;
  }
  else
  {
  return false;
}
}
wackywizards Junior · 44 posts #7

its on look at first message

[B]Warning[/B]:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in [B]/home/********/public_html/web/index.php[/B] on line [B]662[/B] 
Anshul Senior · 296 posts #8

wackywizards wrote: its on look at first message

Warning:  mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/********/public_html/web/index.php on line 662 
function inboxson($uid) // id is the user  to whom you want to send pm
{
global $sid; // it wil get sid from the logged user who is sending pm
$_logged_id = getuid_sid($sid); // login id or who is sending pm id
  $query = mysql_fetch_array(mysql_query("SELECT  private FROM usertable WHERE id='".$uid."'")); // check for private value from userstable
  if($query[0]!="0"||ismod($_logged_id)) // check if users private values is not 0 and if login id is of moder
  {
    return true; // if conditions found true it will send pm
  }
  else
  {
  return false; // otherwise it wil not
}
}

edit this code according to ur script

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