Add to buddy list

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

    Add to buddy list

    Hey guys i dnt know whats wrong please help me out lol guess its really small error

    when u go to user profile it dnt show the option to add user to buddies
    Code:
    ////////////////////////////////viewuser profile
    
    
    else if($action=="viewuser")
    
    {
    
      addonline(getuid_sid($sid),"Viewing $who's Profile","index.php?action=viewuser&who=$who");
    
          echo "<head>\n";
              echo "<title>$sitetitle</title>\n";
          $theme1 = mysql_fetch_array(mysql_query("SELECT theme FROM ibwf_users WHERE id='".$who."'"));
            echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"themes/$theme[0]\">";
              echo "<meta http-equiv=\"Cache-Control\" content=\"must-revalidate\" />\n";
          echo "<meta http-equiv=\"Cache-Control\" content=\"no-cache\" />\n";
          echo "<meta http-equiv=\"Pragma\" content=\"no-cache\" />\n";
    
              echo "</head>";
          echo "<body>";
    
                       echo "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" height=\"60\" width=\"159\">";
    echo "<tr>";
    echo "<td id=\"body\" width=\"159\">";
    echo "</td>";
    echo "</tr>";
    echo "</table>";
      echo "<p align=\"center\">";
    
    include ("popups.php");
       $uid = getuid_sid($sid);
      if($who==""||$who==0)
    
      {
    
        $mnick = $_POST["mnick"];
    
        $who = getuid_nick($mnick);
    
      }
    
      $whonick = getnick_uid($who);
      if($whonick!="")
      {
        if(isonline($who))
          {
            $lasplc = mysql_fetch_array(mysql_query("SELECT place FROM ibwf_online WHERE userid='".$who."'"));
            $iml = "<img src=\"images/onl.gif\" alt=\"+\"/>";
            $where = "$lasplc[0]";
            $idleofline = "Idle For:";
           }else{
                      $iml = "<img src=\"images/ofl.gif\" alt=\"-\"/>";
                  $where = "Offline";
                  $idleofline = "Offline For:";
                }
    echo "Rating: ";
    echo rating($who);
    echo "<br/><br/>";
      echo "$iml $whonick's Profile<br/>";
      if ($who==$uid)
      {
    
        echo "<a href=\"mood.php?action=change&amp;sid=$sid\"><img src=\"mood.php?action=getpic&amp;sid=$sid&amp;who=$who\" alt=\"Mood\"/></a><br/>";
      }else{
                       echo "<img src=\"mood.php?action=getpic&amp;sid=$sid&amp;who=$who\" alt=\"Mood\"/><br/>";
           }
      $avlink = getavatar($who);
      if ($avlink=="")
      {
        $sex = mysql_fetch_array(mysql_query("SELECT sex FROM ibwf_users WHERE id='".$who."'"));
        if($sex[0]=='M')
        {
          echo "<br/><img src=\"images/nophotoboy.gif\" alt=\"avatar\"/><br/>";
        }else if($sex[0]=='F')
              {
                echo "<br/><img src=\"images/nophotogirl.gif\" alt=\"avatar\"/><br/>";
              }else{
                     echo "<br/><img src=\"images/nopic.jpg\" alt=\"avatar\"/><br/>";
                   }
      }else{
      echo "<br/><img src=\"$avlink\" alt=\"avatar\"/><br/><br/>";
      }
     $married=mysql_fetch_array(mysql_query("SELECT * from ibwf_married WHERE frmuid='".$who."' OR touid='".$who."'"));
    
       if($married['frmuid']==$who)
    
       {
    
                       if($married['agreed']==1)
    
                                    {
    
                                                    if($married['complete']==1)
    
                                                                    {
    
                                                                                    $unick=getnick_uid($who);
    
                                                                                    $mnick=getnick_uid($married['touid']);
    
                                                                                    echo "<br/><strong>$unick is Married To $mnick</strong><br/><br/>";
    
                                                                    }
    
                                    }
    
       }else{
    
                       if($married['agreed']==1)
    
                                    {
    
                                                    if($married['complete']==1)
    
                                                                    {
    
                                                                                    $unick=getnick_uid($who);
    
                                                                                    $mnick=getnick_uid($married['frmuid']);
    
                                                                                    echo "<br/><strong>$unick is Married To $mnick</strong><br/><br/>";
    
                                                                    }
    
                                    }
    
       }
    
    echo "</p><br/>\n";
    
    echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
    echo "<tr>";
    echo "<td class=\"boxedTitle\" height=\"20\">";
    
    echo "<h1 align=\"center\" class=\"boxedTitleText\">";
    
    echo "User Info";
    
    
    
    echo "</h1></td>";
    echo "</tr>";
    echo "<td class=\"boxedContent\">";
    echo "<div align=\"left\">\n";
    echo "<small>";
    echo "<b>Member's ID:</b> $who";
    //////////////////////////////////////
    
    ////////////////////////////////////////////////////////////////////////////////////
      echo "<br/><b>Status:</b> ".getstatus($who)."";
    
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    
    
    echo "<table border=\"0\" width=\"99%\" cellspacing=\"0\" cellpadding=\"0\" class=\"boxed\" align=\"center\">";
    echo "<tr>";
    echo "<td class=\"boxedTitle\" height=\"20\">";
    
    echo "<h1 align=\"center\" class=\"boxedTitleText\">";
    
    echo "Menu";
    
    
    
    echo "</h1></td>";
    echo "</tr>";
    echo "<td class=\"boxedContent\">";
    
    if(isowner(getuid_sid($sid)))
      {
     echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
    
      echo "<a href=\"ownercp.php?action=addhall&amp;sid=$sid&amp;who=$who\">Add To Hall Of Fame</a><br/>";
       }
      echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
    echo "<a href=\"profile.php?action=main&amp;sid=$sid&amp;who=$who\">View Profile</a><br/>";
    
    if(cansee(getuid_sid($sid), $who))
    
    
      echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
      echo "<a href=\"inbox.php?action=sendpm&amp;who=$who&amp;sid=$sid\">Send Message</a><br/>";
      $uid = getuid_sid($sid);
      if(budres($uid, $who)==0)
      {  echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
        echo "<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=add\">Add to buddy list</a><br/>";
      }else if(budres($uid, $who)==1)
      {
        echo "Buddy request in the queue<br/>";
      }else if(budres($uid, $who)==2)
      {  echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
        echo "<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=del\">Remove From buddy list</a><br/>";
      }
      $ires = ignoreres($uid, $who);
      if(es==2)
      {  echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
        echo "<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=del\">Remove From Ignore list</a><br/>";
      }else if($ires==1)
      {  echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
        echo "<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=add\">Add to Ignore list</a><br/>";
      }
    echo "<br/>";
      echo "<img class=\"bullet\" alt=\">\" src=\"themes/bullet1.gif\" align=\"middle\">";
      echo "<a href=\"userfun.php?action=profile&amp;who=$who&amp;sid=$sid\">Fun And Games</a><br/>";
    
    ////////////////////////////////////////
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    
    
    
    
      }
    
    
    
    
    
    
    
      $whonick = getnick_uid($who);
    
      if($whonick!="")
    
      {
    echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
    echo "<small>Home</small></a>";
    echo " > ";
    echo "<small>$whonick</small><br/>";
    
    
    echo "<br/><table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"0\"><tr>";
    echo "<td id=\"footer\">";
    echo "<p id=\"legal\">&#169; $sitetitle $year</p>";
    
    echo "</td>";
    echo "</tr>";
    echo "</table>";
    
    echo "</body>";
    echo "</html>";
    exit();
    }
      }
    can anyone see where my error are
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    its no good posting half the coding lol
    need to see your function budres aswell :P

    oh btw you have a major scripting error in the above code
    PHP Code:
    if(es==2
    should be
    PHP Code:
    if($ires==2
    Im Surprised the page even opens lol

    Comment


      #3
      ma man rider what happen to yo eyes lolz


      ....................................
      http://photomag.lk/
      ....................................

      Comment


        #4
        core.php

        Code:
        /////////////////////////////////////////////can bud?
        
        function budres($uid, $tid)
        {
        $buds = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='10'"));
         $max_buds = $buds[0];
          //3 = can't bud
          //2 = already buds
          //1 = request pended
          //0 = can bud
          if($uid==$tid)
          {
            return 3;
          }
        
          if (arebuds($uid, $tid))
          {
            return 2;
          }
          $req = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE ((uid='".$uid."' AND tid='".$tid."') OR (uid='".$tid."' AND tid='".$uid."')) AND agreed='0'"));
          if($req[0]>0)
          {
            return 1;
          }
          $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$tid."' OR tid='".$tid."') AND agreed='1'"));
          if($notb[0]>=$max_buds)
          {
        
            return 3;
          }
          $notb = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid='".$uid."' OR tid='".$uid."') AND agreed='1'"));
          if($notb[0]>=$max_buds)
          {
        
            return 3;
          }
          return 0;
        }
        here are the code i use for budres
        ________________
        Jacques
        jacques@gw-designs.co.za
        http://coding.biz.tm
        Come join and lets make it a place to learn all the noobies how to code
        __________________

        NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

        Comment


          #5
          lol u r editing a blingywap script is it ri8 !!!!!!!!!!!!!!

          Comment


            #6
            Debug it and see what numbers you are getting back from it by typing something like:
            echo "Debug: ".budres($uid,$who)."<br/>";

            it looks ok to e so im wondering if the value is set on
            $buds = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE id='10'"));

            debugging it here in core also might help
            echo "debug2: $buds[0]<br/>";

            Comment

            Working...
            X