online list avatars

Started on the old forum in February 2010 · view the original in the archive · old links redirect here

15 replies · 804 views · started 16 years ago · 1 min read

3 participants
wapfuture Developer · 87 posts #1

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

     $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

http://wapmayhem.co.ccmy wap portal http://weedreed.co.ccvirtual weed smoking site;)

riderz Lead · 975 posts #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


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

wapfuture Developer · 87 posts #4
         $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

http://wapmayhem.co.ccmy wap portal http://weedreed.co.ccvirtual weed smoking site;)

riderz Lead · 975 posts #6
/////////////////////////////////////////////////////////
else if($action=="online")
{
 echo "<meta http-equiv=\"refresh\" content=\"20; URL= index.php?action=$action&sid=$sid&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&who=$item[2]&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&page=$ppage&sid=$sid\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=online&page=$npage&sid=$sid\">Next»</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&sid=$sid\">»Longest Online</a><br/>";
	 echo "<a href=\"index.php?action=chat&sid=$sid\">»Chat Rooms</a><br/>";
       echo "<a href=\"index.php?action=main&sid=$sid\"><img src=\"images/themes/$themeimageset[0]/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
    echo xhtmlfoot();
exit();
}

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

riderz Lead · 975 posts #7

here are also option to turn it on and off in forum genproc.php action=ustset

    $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

 $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

  $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

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])) {

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 ";

$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


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

wapfuture Developer · 87 posts #9

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

   $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\"/>";
}
    

http://wapmayhem.co.ccmy wap portal http://weedreed.co.ccvirtual weed smoking site;)

riderz Lead · 975 posts #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


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

wapfuture Developer · 87 posts #15
  ////////// 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

http://wapmayhem.co.ccmy wap portal http://weedreed.co.ccvirtual weed smoking site;)

wapfuture Developer · 87 posts #16

here we go

  ////////// 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 of online avatars😊

http://wapmayhem.co.ccmy wap portal http://weedreed.co.ccvirtual weed smoking site;)

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close