Online List

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

    Online List

    Online List
    Code:
    else if($action=="online")
    {
    
      addonline(getuid_sid($sid),"Online List","");
    $pstyle = gettheme($sid);
        echo xhtmlhead("Online List",$pstyle);
    
    
      //////ALL LISTS SCRIPT <<
    
        
    if($page=="" || $page<=0)$page=1;
    $num_items = getnumonline();
    $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;
    
    $sql = "SELECT a.name, b.place, b.userid, a.sex, a.mood FROM ibwf_users a INNER JOIN ibwf_online b ON a.id = b.userid GROUP BY 1,2 LIMIT $limit_start, $items_per_page";
    echo "
    
    [size="1"]";
    $items = mysql_query($sql);
    echo mysql_error();
    
    
    
    while ($item = mysql_fetch_array($items)){
    
    
    $mymood = substr(parsemsg($item[4],$sid),0,10);
    $imood = explode(" ",$mymood);
    $mood = parsemsg($imood[0],$sid);
    
    if($item[3]=="M"){
    $avlink = getavatar($user);
      if ($avlink=="")
      echo "
    <img src=\"$avlink\" alt=\"avatar\"/>";
      $lnk = "<img src=\"images/male.gif\" alt=\"*\"/><a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
    }else{
      $avlink = getavatar($user);
      if ($avlink=="")
        echo "
    <img src=\"$avlink\" alt=\"avatar\"/>";
      $lnk = "<img src=\"images/female.gif\" alt=\"*\"/><a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
    }
    
    if(empty($mood)){
    echo "$lnk - $item[1]
    ";
    } else {
    echo "$lnk ($mood) $item[1]
    ";
    }
    
    
    
        }
        echo "[/size]</p>";
        echo "<p align=\"center\">";
        if($page>1)
        {
          $ppage = $page-1;
          echo "<a href=\"index.php?action=online&amp;page=$ppage&amp;sid=$sid\">«Prev</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"index.php?action=online&amp;page=$npage&amp;sid=$sid\">Next»</a>";
        }
        echo "
    $page/$num_pages
    ";
        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=&#39;".$uid."&#39;"));
        $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id=&#39;".$thid[0]."&#39;"));  
        echo "<a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
      echo xhtmlfoot();
    }
    Who can help me to get this code right that it can pic up the user avatar in profile

    Please
    Code:
    f($item[3]=="M"){
    $avlink = getavatar($user);
      if ($avlink=="")
      echo "
    <img src=\"$avlink\" alt=\"avatar\"/>";
      $lnk = "<img src=\"images/male.gif\" alt=\"*\"/><a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
    }else{
      $avlink = getavatar($user);
      if ($avlink=="")
        echo "
    <img src=\"$avlink\" alt=\"avatar\"/>";
      $lnk = "<img src=\"images/female.gif\" alt=\"*\"/><a href=\"index.php?action=viewuser&amp;who=$item[2]&amp;sid=$sid\">$item[0]</a>";
    }
    Ive added above code for avatar

    #2
    :P

    $avlink = getavatar($item[2]);
    if ($avlink!=""){
    echo "<img src=\"$avlink\" alt=\"avatar\"/>
    ";
    }

    Comment


      #3
      Code:
      [img]tmp/avatars/75028.jpg[/img]
      who can help me to get the code that the user can add his profile must i make another sql for it and in control panel or how the first code i tried dnt work

      Comment


        #4
        did you use != instead of == ? iv made it bold in above code :P

        that code in php will be

        echo "<img src=\"tmp/avatars/75028.jpg\" class=\"online\" width=\"40\" height=\"40\" alt=\"\" />";

        if thats what u mean?

        Comment


          #5
          oh and if your using height and width reduction on your avatars on online list it will slow your online list down because the image kb will stay the same ............... if you have got 10 people online with large images your online list will run slow for mobile users.
          there is a few ways round that and thats to have an uploader which resizes the avatars or have a switch to turn off avatars on/off on the online list or just have pre select avatars that are just for the online list

          Comment


            #6
            Wow ive got it right but how can i make my avatar smaller and mabe that option to switch it of

            Code:
            $avlink = getavatar($item[2]);
            if ($avlink!=""){
            echo "<img src=\"$avlink\" height=\"25\" width=\"25\" alt=\"avatar\"/>
            ";
            }
            can sumone help me to let it show the nopic icon if user dnt have an avatar and mabe option to switch of the avatars

            Comment


              #7
              if your not using uploaders then width=\"40\" height=\"40\"
              and making a switch u need more sql on ibwf_users and loads more coding which i cant be bothered to do lol

              Comment


                #8
                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\"/>
                ";
                }
                Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
                Visit: WapMasterz Coming Back Soon!
                _______
                SCRIPTS FOR SALE BY SUBZERO
                Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
                FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
                _______
                Info & Tips
                php.net
                w3schools.com

                Comment


                  #9
                  U guys are a really good help to me im learning allot from u all THANK YOU

                  Comment

                  Working...
                  X