online list avatars

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

    online list avatars

    hi im trying to add this code to my online list to display users avatars but..im not really sure where i should place it


    PHP Code:
         $avlink getavatar($item[2]);
    if (
    $avlink!=""){
    echo 
    "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>
    "
    ;
    }else{
    echo 
    "<img src=\"images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>
    "
    ;

    i want this to replace the male.gif and female.gif icons thanks

    #2
    just look at the scripts ive posted and ull find it also look at the code ive posted of male and female online list its on there

    Comment


      #3
      hmm it doesnt display the avatar it displays nopic.jpg lol
      Last edited by wapfuture; 15.02.10, 20:25.

      Comment


        #4
        PHP Code:
                 $avlink getavatar($who);
            
        $status=mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name='icons'"));
            if(
        $status[0]==1){
         echo 
        "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"\"/>";
            }else{ 
        echo 
        "<img src=\"images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/> 
        "


        would this be more like it

        Comment


          #5
          already fixed dude?


          post your online list i will try to help you
          com site: http://vampist.net
          download site: http://wapdloads.net
          fb: http://www.facebook.com/pmplx

          Comment


            #6
            Code:
            /////////////////////////////////////////////////////////
            else if($action=="online")
            {
             echo "<meta http-equiv=\"refresh\" content=\"20; URL= index.php?action=$action&amp;sid=$sid&amp;page=$page\"/>";
              addonline(getuid_sid($sid),"Online List - xHTML","index.php?action=$action");
            $pstyle = gettheme($sid);
                echo xhtmlhead("Online List",$pstyle);
            
            
              //////ALL LISTS SCRIPT <<
            
                if($page=="" || $page<=0)$page=1;
                $num_items = getnumonline(); //changable
                $items_per_page= 10;
                $num_pages = ceil($num_items/$items_per_page);
                if($page>$num_pages)$page= $num_pages;
                $limit_start = ($page-1)*$items_per_page;
             echo popup($sid);
                //changable sql
                $sql = "SELECT
                        a.name, b.place, b.userid, sex FROM ibwf_users a
                        INNER JOIN ibwf_online b ON a.id = b.userid
                        GROUP BY 1,2 ORDER BY a.lastact DESC
                        LIMIT $limit_start, $items_per_page
                ";
                echo "<p><small>";
                $mols = mysql_fetch_array(mysql_query("SELECT name, value FROM ibwf_settings WHERE id='2'"));
                print "Most online: <b>$mols[1]</b><br/>";
                $mols = mysql_fetch_array(mysql_query("SELECT ppl, dtm FROM ibwf_mpot WHERE ddt='".date("d m y")."'"));
                print "Most online today only: <b>$mols[0]</b><br/>";
            
                $items = mysql_query($sql);
                echo mysql_error();
                while ($item = mysql_fetch_array($items))
                {
            $avlink = getavatar($item[2]);
            if ($avlink!=""){
            echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
            }else{
            echo "<img src=\"images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
            }
                  if ($item[3]=="M"){
                  $icon = "<img src=\"images/male.gif\" alt=\"M\"/>";
                  }else
                  if ($item[3]=="F"){
                  $icon = "<img src=\"images/female.gif\" alt=\"F\"/>";
                  }
            
                  $lnk = "<a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
                  echo "$icon $lnk - $item[1] <br/>";
            
                }
            
                echo "</small></p>";
                echo "<p align=\"center\">";
                if($page>1)
                {
                  $ppage = $page-1;
                  echo "<a href=\"index.php?action=online&amp;page=$ppage&amp;sid=$sid\">&#171;PREV</a> ";
                }
                if($page<$num_pages)
                {
                  $npage = $page+1;
                  echo "<a href=\"index.php?action=online&amp;page=$npage&amp;sid=$sid\">Next&#187;</a>";
                }
                echo "<br/>$page/$num_pages<br/>";
                if($num_pages>2)
                {
                  echo getjumper($action, $sid,"index");
                }
                echo "</p>";
              ////// UNTILL HERE >>
            
              echo "<p align=\"center\">";
              $thid = mysql_fetch_array(mysql_query("SELECT themeid FROM ibwf_users WHERE id='".$uid."'"));
                $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));
                 echo "<a href=\"lists.php?action=longon&amp;sid=$sid\">&#187;Longest Online</a><br/>";
            	 echo "<a href=\"index.php?action=chat&amp;sid=$sid\">&#187;Chat Rooms</a><br/>";
                   echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
            echo "Home</a>";
              echo "</p>";
                echo xhtmlfoot();
            exit();
            }

            Comment


              #7
              here are also option to turn it on and off in forum
              genproc.php
              action=ustset
              Code:
                  $showavatar = $_POST["showavatar"];
                  $showavatarinbox = $_POST["showavatarinbox"];
                  $showavatarforum = $_POST["showavatarforum"];
              
                $res = mysql_query("UPDATE wap_users SET showavatar='".$showavatar."' WHERE id='".$uid."'");
                $res = mysql_query("UPDATE wap_users SET showavatarinbox='".$showavatarinbox."' WHERE id='".$uid."'");
                $res = mysql_query("UPDATE wap_users SET showavatarforum='".$showavatarforum."' WHERE id='".$uid."'");
              online list
              Code:
               $showavatar = mysql_fetch_array(mysql_query("SELECT showavatar FROM wap_users WHERE id='".$uid."'"));
              
               if($showavatar[0]=="1"){
              
              $avlink = getavatar($item[2]);
              if ($avlink!=""){
              echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
              }else{
              echo "<img src=\"images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";
              }
               }
              in stset
              Code:
                $showavatar = mysql_fetch_array(mysql_query("SELECT showavatar FROM wap_users WHERE id='".$uid."'"));
              
               echo "<small>Show avatar Online list?:</small> <select name=\"showavatar\" value=\"$showavatar[0]\">";
                  if($showavatar[0]=="1"){
                  echo "<option value=\"1\" selected=\"1\">Yes</option>";
                  }else{
                  echo "<option value=\"1\">Yes</option>";
                  }
                  if($showavatar[0]=="0"){
                  echo "<option value=\"0\" selected=\"0\">No</option>";
                  }else{
                  echo "<option value=\"0\">No</option>";
                  }
                  echo "</select><br/><br/>";
               echo "<small>Show avatar Inbox?:</small> <select name=\"showavatarinbox\" value=\"$showavatarinbox[0]\">";
                  if($showavatarinbox[0]=="1"){
                  echo "<option value=\"1\" selected=\"1\">Yes</option>";
                  }else{
                  echo "<option value=\"1\">Yes</option>";
                  }
                  if($showavatarinbox[0]=="0"){
                  echo "<option value=\"0\" selected=\"0\">No</option>";
                  }else{
                  echo "<option value=\"0\">No</option>";
                  }
                  echo "</select><br/><br/>";
              
              echo "<small>Show avatar Forum?:</small> <select name=\"showavatarforum\" value=\"$showavatarforum[0]\">";
                  if($showavatarforum[0]=="1"){
                  echo "<option value=\"1\" selected=\"1\">Yes</option>";
                  }else{
                  echo "<option value=\"1\">Yes</option>";
                  }
                  if($showavatarforum[0]=="0"){
                  echo "<option value=\"0\" selected=\"0\">No</option>";
                  }else{
                  echo "<option value=\"0\">No</option>";
                  }
                  echo "</select><br/><br/>";
                  echo "<small>Show Icons on Main Page?:</small> <select name=\"showcons\" value=\"$showcons[0]\">";
                  if($showcons[0]=="1"){
                  echo "<option value=\"1\" selected=\"1\">Yes</option>";
                  }else{
                  echo "<option value=\"1\">Yes</option>";
                  }
                  if($showcons[0]=="0"){
                  echo "<option value=\"0\" selected=\"0\">No</option>";
                  }else{
                  echo "<option value=\"0\">No</option>";
                  }
                  echo "</select><br/><br/>";
              sql
              ibwf_users
              Code:
              showavatar into 100 default 0
               `showavatarforum` int(100) NOT NULL default '1',
                `showavatarinbox` int(100) NOT NULL default '1',
              add this in
              else if($action=="viewtpc")

              just look for this line and put it ontop of it
              if(isonline($ttext[0]))
              {
              Code:
              if($showavatarforum[0]=="1")
              {
               $uid =$ttext[0];
                  $avatar = getavatar($uid);
                 if ($avatar=="")
                {
                echo"<img src=\"images/nopic.jpg\" width=\"32\" height=\"32\" alt=\"avatar\"/>";
                }else{
              echo"<img src=\"$avatar\" width=\"32\" height=\"32\" alt=\"avatar\"/>";
              }
               }
              in inbox readpm

              look for this and put the code ontop of this line echo "$bylnk<br/>";
              Code:
              $showavatarinbox = mysql_fetch_array(mysql_query("SELECT showavatarinbox FROM wap_users WHERE id='".$uid."'"));
              
              if($showavatarinbox[0]=="1"){
                 echo "$ptxt";
                  $uid =$pminfo[1];
                  $avatar = getavatar($uid);
                 if ($avatar=="")
                {
                echo"<img src=\"mages/nopic.jpg\" width=\"32\" height=\"32\" alt=\"avatar\"/>";
                }else{
              echo"<img src=\"$avatar\" width=\"32\" height=\"32\" alt=\"avatar\"/>";
              }
              }
              hope this works good

              Comment


                #8
                ok thank you mate for helping me out

                Comment


                  #9
                  ok and here is the basic avatars in online list that i just coded ..if anybody needs it


                  PHP Code:
                     $avatar getavatar($uid);
                  if (
                  $avatar!=""){
                  echo 
                  "<img src=\"$avatar\" height=\"30\" width=\"30\" alt=\"avatar\"/>";
                  }else{
                  echo 
                  "<img src=\"images/nopic.jpg\" height=\"25\" width=\"25\" alt=\"avatar\"/>";

                  Comment


                    #10
                    nope not you call a coded ..
                    com site: http://vampist.net
                    download site: http://wapdloads.net
                    fb: http://www.facebook.com/pmplx

                    Comment


                      #11
                      hmm ok thought that was right i want it to display nopic girl if the user has no pic and is gir and ffor boy
                      but if they have a avatar display that

                      Comment


                        #12
                        dude this code already being posted months ago u never used the search option to look at them and ofcoz if u have my scripts ive posted then ull have all these codes

                        Comment


                          #13
                          yeah just search it out author!
                          com site: http://vampist.net
                          download site: http://wapdloads.net
                          fb: http://www.facebook.com/pmplx

                          Comment


                            #14
                            okay rider :D

                            Comment


                              #15
                              PHP Code:
                                ////////// display avatars
                              while ($item mysql_fetch_array($items)){
                              $avlink=mysql_fetch_array(mysql_query("SELECT avatar FROM ibwf_users WHERE name='$item[0]'"));

                               echo 
                              "<img src=\"$avlink[0]\" width=35 height=33 alt=\"\"/> - ";
                                  if(
                              $item[5]=='M'){
                                      
                              $atxt="<img src=\"images/male.gif\" alt=\"M\"/>";
                                  }
                                  else if(
                              $item[5]=='F'){
                                      
                              $atxt="<img src=\"images/female.gif\" alt=\"F\"/>";
                                  }
                                  else { 
                              $atxt=""; } 

                              use this its my version

                              Comment

                              Working...
                              X