inbox help

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    inbox help

    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

    Code:
    $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&amp;sid=$sid\">&#187;Enable inbox</a><br/>";
      }else{
      echo "<a href=\"index.php?action=inboxdisable&amp;sid=$sid\">&#187;Disable Inbox</a><br/>";
      }
    and this what i got in my core

    Code:
    /////////////////////////////////////////////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
    Code:
    [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]


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

    #2
    Code:
    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;
    }
    }

    Comment


      #3
      but with this code the staff members can send inbox at user allow??
      if like my post click:

      http://coding-talk.com/images/totall...ost_thanks.gif

      Comment


        #4
        Originally posted by Spook View Post
        Code:
        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

        Comment


          #5
          Originally posted by sweetangel View Post
          but with this code the staff members can send inbox at user allow??
          :confused:
          i dont think it wil allow

          u need to edit this code like this
          Code:
          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;
          }
          }
          Last edited by Anshul; 02.04.09, 20:04.

          Comment


            #6
            Originally posted by wackywizards View Post
            this still dont work
            post error here
            wat u supplying as argument ??

            Comment


              #7
              its on look at first message

              Code:
              [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]

              Comment


                #8
                Originally posted by wackywizards View Post
                its on look at first message

                Code:
                [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]

                Code:
                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
                Last edited by Anshul; 02.04.09, 20:12.

                Comment

                Working...
                X