User Blog And Polls

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

    User Blog And Polls

    im getting this error into user's profile
    Code:
    Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/www/orkutwap.freehostia.com/web/index.php on line 2831
    and im using this code as view user

    Code:
    /////////////////////////////////viewuser profile
    
    else if($action=="viewuser")
    {
      addonline(getuid_sid($sid),"Viewing Users Profile","index.php?action=viewuser&who=$who");
        echo "<head>";
        echo "<title>View Profile</title>";
        echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
        echo "</head>";
        echo "<body>";
        echo mobads();
       echo "<p align=\"center\">";
      $lastloc=$_GET["lstloc"];
    if($lastloc=="cht"){
        $rid= $_GET["rid"];
        $rooms = mysql_fetch_array(mysql_query("SELECT id, name FROM ibwf_rooms WHERE id=&#39;".$rid."&#39;"));
        $rname = $rooms[1];
    }
      if($who==""||$who==0)
      {
        $mnick = $_POST["mnick"];
        $who = getuid_nick($mnick);
      }
      $whonick = getnick_uid($who);
      if($whonick!="")
      {
    
    
    
    if(isowner(getuid_sid($sid)))
      {
      echo "<a href=\"ownercp.php?action=user&amp;sid=$sid&amp;who=$who\">*Owner Tools*</a>
    ";
      }
    if(isheadadmin(getuid_sid($sid)))
      {
      echo "<a href=\"headadmincp.php?action=user&amp;sid=$sid&amp;who=$who\">*Head Admin Tools*</a>
    ";
      }
      if(ismod($uid))
      {
      if(!isowner(getuid_sid($sid)))
      {
      if(!isheadadmin(getuid_sid($sid)))
      {
      echo "<a href=\"admincp.php?action=user&amp;sid=$sid&amp;who=$who\">*Admin Tools*</a>
    ";
      }
      }
      }
    
      $avlink = getavatar($who);
      if($avlink=="")
      {
      echo "";
      }else{
      echo "<img src=\"$avlink\" alt=\"$whonick\"/>
    ";
      }
      if(cansee(getuid_sid($sid), $who))
      {
        $unol = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
        /*if($unol[0]!="")
        {
        echo "Last Penalty Reason: $unol[0]
    ";
        }
        $unol = mysql_fetch_array(mysql_query("SELECT lastplreas FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
        if($unol[0]!="")
        {
        echo "Last Plusses Reason: $unol[0]
    ";
        }*/
      }
      echo "[b]Username:[/b] $whonick
    ";
      echo "[b]Status:[/b] ".getstatus($who)."
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      echo "[b]UserId:[/b] $who
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT sex, birthday, location FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      $uage = getage($nopl[1]);
      if($nopl[0]==&#39;M&#39;)
      {
        $usex = "Male";
      }else if($nopl[0]==&#39;F&#39;){
        $usex = "Female";
      }else{
        $usex = "Argh! No Profile!";
      }
      $nopl[2] = htmlspecialchars($nopl[2]);
      echo "[b]Asl:[/b] $uage/$usex/$nopl[2]
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT regdate FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      $jdt = date("H:i - D jS M y",$nopl[0]);
      echo "[b]Joined:[/b] $jdt
    ";
      $membrage = time() - $nopl[0];
      $membrage = gettimemsg($membrage);
      echo "[b]Member For:[/b] $membrage
    ";
      $nob = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_buddies WHERE (uid=&#39;".$who."&#39; OR tid=&#39;".$who."&#39;) AND agreed=&#39;1&#39;"));
      echo "[b]Buddies:[/b] $nob[0]
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT email FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      echo "[b]E-mail:[/b] $nopl[0]
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT refer FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      echo "[b]Referal User:[/b] $nopl[0]
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT signature FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      $sign = parsepm($nopl[0], $sid);
      echo "[b]Info:[/b] $sign
    ";
      $noi = mysql_fetch_array(mysql_query("SELECT lastact FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      $var1 = date("His",$noi[0]);
      $var2 = time();
      $var21 = date("His",$var2);
      $var3 = $var21 - $var1;
      $var4 = date("s",$var3);
      echo "[b]Idle For:[/b] ";
      $remain = time() - $noi[0];
      $idle = gettimemsg($remain);
      echo "$idle
    ";
      $nopl = mysql_fetch_array(mysql_query("SELECT browserm FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      echo "[b]Browser:[/b] $nopl[0]
    ";
      if(ismod(getuid_sid($sid)))
      {
      $uipadd = mysql_fetch_array(mysql_query("SELECT ipadd FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
      echo "[b]Ip:[/b] <a href=\"lists.php?action=byip&amp;sid=$sid&amp;who=$who\">$uipadd[0]</a>
    ";
      }
    $sql= mysql_fetch_array(mysql_query("SELECT profileview FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
    if ($who==$uid)
    {
    $sql1 = $sql[0];
    }
    else {
    $sql1 = $sql[0]+1;
    }
    mysql_query("UPDATE ibwf_users SET profileview=&#39;".$sql1."&#39; WHERE id=&#39;".$who."&#39;");
    $sql2=mysql_fetch_array( mysql_query("SELECT profileview FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
    echo "Profile viewed $sql2[0] times
    ";
    $sql = mysql_fetch_array(mysql_query("SELECT COUNT(id) FROM lastview WHERE whonick=&#39;".$whonick."&#39;"));
    if ($sql[0]>10)
    {
    $sql = mysql_fetch_array(mysql_query("SELECT MAX(id) FROM lastview WHERE whonick=&#39;".$whonick."&#39;"));
    $sql = $sql[0]-9;
    mysql_query("DELETE FROM lastview WHERE whonick=&#39;".$whonick."&#39; AND id <&#39;".$sql."&#39;");
    }
    $lv=getnick_sid($sid);
    $a = getuid_nick($whonick);
    if($a!=$uid)
    {
    mysql_query("INSERT INTO lastview SET lastview=&#39;".$lv."&#39;, whonick=&#39;".$whonick."&#39;, ltime=&#39;".time()."&#39;");
    }
    $sql= mysql_fetch_array(mysql_query("SELECT lastview,ltime FROM lastview WHERE whonick=&#39;".$whonick."&#39;ORDER BY ltime DESC LIMIT 1"));
    $a = getuid_nick($sql[0]);
    $link = "<a href=\"index.php?action=viewuser&sid=$sid&who=$a\">$sql[0]</a>";
    echo "last viewed by $link -";
    $newtime =$sql[1]+(0 *60 *60); 
    echo date("D d M y - h:i:s a",$newtime);
    echo "<a href=\"index.php?action=10pv&who=$who&sid=$sid\">+</a>
    ";
      if(budres($uid, $who)==0)
      {
        echo "<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=add\">Add Buddy</a>
    ";
      }else if(budres($uid, $who)==1)
      {
        echo "(Queued Buddy Request)
    ";
      }else if(budres($uid, $who)==2)
      {
        echo "<a href=\"genproc.php?action=bud&amp;who=$who&amp;sid=$sid&amp;todo=del\">Del Buddy</a>
    ";
      }
      if (arebuds($uid, $who))
      {
      echo "<a href=\"inbox.php?action=sendpopup&amp;who=$who&amp;sid=$sid\">Send Popup</a>
    ";
      }
      echo "<a href=\"inbox.php?action=sendpm&amp;who=$who&amp;sid=$sid\">Send Inbox</a>
    ";
      $ires = ignoreres($uid, $who);
    if($ires==1)
      {
        echo "<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=add\">Ignore</a>
    ";
      }
      if(isignored($who, $uid))
      {
        echo "<a href=\"genproc.php?action=ign&amp;who=$who&amp;sid=$sid&amp;todo=del\">UnIgnore</a>
    ";
      }
      echo "<a href=\"index.php?action=prostats&amp;who=$who&amp;sid=$sid\">User Stats</a>
    ";
      echo "<a href=\"uinfo.php?who=$who&amp;sid=$sid\">Advanced Profile</a>
    ";
      echo "<a href=\"../users?$whonick\">Personal Wap Site</a>
    ";
       $noi = mysql_fetch_array(mysql_query("SELECT pollid FROM ibwf_users WHERE id=&#39;".$who."&#39;"));
       if($noi[0]>0)
       {
       echo "<a href=\"index.php?action=viewpl&amp;who=$who&amp;sid=$sid\">Poll</a>
    ";
     }
    
       $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_blogs WHERE bowner=&#39;".$who."&#39;"));
       if($noi[0]>0)
       {
       echo "<a href=\"lists.php?action=blogs&amp;who=$who&amp;sid=$sid\">Blogs($noi[0])</a>
    ";
     }
     $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_vault WHERE uid=&#39;".$who."&#39;"));
       if($noi[0]>0)
       {
       echo "<a href=\"lists.php?action=vault&amp;who=$who&amp;sid=$sid\">Vault($noi[0])</a>
    ";
       }
       $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_gbook WHERE gbowner=&#39;".$who."&#39;"));
       echo "<a href=\"lists.php?action=gbook&amp;who=$who&amp;sid=$sid\">Guestbook($noi[0])</a>
    ";
       $judg = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_judges WHERE uid=&#39;".getuid_sid($sid)."&#39;"));
      echo "</p>";
      echo "<p align=\"center\">";
    
       }else{
         echo "<img src=\"../images/notok.gif\" alt=\"X\"/> Member dos not exist
    ";
       }
         if($lastloc=="cht"){
              
        echo "[b]5 [/b]<a accesskey=\"5\" href=\"chat.php?sid=$sid&amp;rid=$rid\">Back to $rname</a>
    "; 
      echo "[b]6 [/b]<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a>
    ";
              echo "[b]7 [/b]<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a>
    ";
              echo "[b]8 [/b]<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a>
    ";
            echo forumlink($sid,9);
    
      echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</body>";
      }else{
      echo "[b]6 [/b]<a accesskey=\"6\" href=\"inbox.php?action=main&amp;sid=$sid\">Inbox</a>
    ";
              echo "[b]7 [/b]<a accesskey=\"7\" href=\"lists.php?action=buds&amp;sid=$sid\">BuddyList</a>
    ";
              echo "[b]8 [/b]<a accesskey=\"8\" href=\"index.php?action=chat&amp;sid=$sid\">Chat</a>
    ";
            echo forumlink($sid,9);
    
      echo "[b]0 [/b]<a accesskey=\"0\" href=\"index.php?action=main&amp;sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
      echo "</p>";
      echo "</body>";
      }
    }
    sigpic
Working...
X