Online List

Started on the old forum in January 2009 · view the original in the archive · old links redirect here

8 replies · 663 views · started 17 years ago · 1 min read

3 participants
Rider Developer · 128 posts #1

Online List

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&who=$item[2]&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&who=$item[2]&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&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 "
$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='".$uid."'"));
    $themeimageset = mysql_fetch_array(mysql_query("SELECT themedir FROM ibwf_iconset WHERE id='".$thid[0]."'"));  
    echo "<a href=\"index.php?action=main&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

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&who=$item[2]&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&who=$item[2]&sid=$sid\">$item[0]</a>";
}

Ive added above code for avatar

something else Fellow · 2,296 posts #2

😛

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

Rider Developer · 128 posts #3
[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

something else Fellow · 2,296 posts #4

did you use != instead of == ? iv made it bold in above code 😛

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?

something else Fellow · 2,296 posts #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 🙂

Rider Developer · 128 posts #6

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

$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

something else Fellow · 2,296 posts #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

subzero Super moderator Fellow · 3,954 posts #8
$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... _______…

Rider Developer · 128 posts #9

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

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