help with my online list pls

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

3 replies · 391 views · started 16 years ago · 1 min read

2 participants
berty14 Developer · 52 posts #1

can som one plz help me i want this online list to edit plz.i want it show next to the user online a male or female icon under the username there als and idle time and also i want a security bot can some pls help me

}else if($action=="online")
{

  addonline(getuid_ses($ses),"Online List","");
	if($mime== WEB)
	{
		echo webhead($uthm,$stitle);
 //////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;

    //changable sql
    $sql = "SELECT
            a.name, b.place, b.userid 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 "<p align=\"center\">";
  		$timeout = 180;
  		$timeon = time()-$timeout;
  		$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'"));
  		echo "Staff Online: <a href=\"index.php?action=stfol&ses=$ses\">".$noi[0]."</a>";
      	echo "<br/>";
echo "</p>";
    echo "<p>";
    $items = mysql_query($sql);
    echo mysql_error();
    while ($item = mysql_fetch_array($items))
    {
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&ses=$ses\">$item[0]</a>";
      echo "$lnk - $item[1] <br/>";
    }
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"index.php?action=online&page=$ppage&ses=$ses\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=online&page=$npage&ses=$ses\">Next»</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
      echo getjumper($mime,$action, $ses,"index");
    }
    echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
  echo "<a href=\"index.php?action=main&ses=$ses\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
		echo webfoot();

}else{
		echo waphead($stitle);
 //////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;

    //changable sql
    $sql = "SELECT
            a.name, b.place, b.userid 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 "<p align=\"center\">";
  		$timeout = 180;
  		$timeon = time()-$timeout;
  		$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'"));
  		echo "Staff Online: <a href=\"index.php?action=stfol&ses=$ses\">".$noi[0]."</a>";
      	echo "<br/>";
echo "</p>";
    echo "<p>";
    $items = mysql_query($sql);
    echo mysql_error();
    while ($item = mysql_fetch_array($items))
    {
      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&ses=$ses\">$item[0]</a>";
      echo "$lnk - $item[1] <br/>";
    }
    echo "</p>";
    echo "<p align=\"center\">";
    if($page>1)
    {
      $ppage = $page-1;
      echo "<a href=\"index.php?action=online&page=$ppage&ses=$ses\">«PREV</a> ";
    }
    if($page<$num_pages)
    {
      $npage = $page+1;
      echo "<a href=\"index.php?action=online&page=$npage&ses=$ses\">Next»</a>";
    }
    echo "<br/>$page/$num_pages<br/>";
    if($num_pages>2)
    {
      echo getjumper($mime,$action, $ses,"index");
    }
    echo "</p>";
  ////// UNTILL HERE >>

  echo "<p align=\"center\">";
  echo "<a href=\"index.php?action=main&ses=$ses\"><img src=\"images/home.gif\" alt=\"*\"/>";
echo "Home</a>";
  echo "</p>";
		echo wapfoot();

	}
something else Fellow · 2,296 posts #2

This is in many scripts on here already but anyway here is quick script update by me... I cant remember the data for sex is Male or M so you will have to adjust that and idle time you may want to code into mins also

}else if($action=="online") 
{ 

  addonline(getuid_ses($ses),"Online List",""); 
    if($mime== WEB) 
    { 
        echo webhead($uthm,$stitle); 
 //////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; 

    //changable sql 
    $sql = "SELECT 
            a.name, b.place, b.userid, a.sex, a.lastact 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 "<p align=\"center\">"; 
          $timeout = 180; 
          $timeon = time()-$timeout; 
          $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'")); 
          echo "Staff Online: <a href=\"index.php?action=stfol&ses=$ses\">".$noi[0]."</a>"; 
          echo "<br/>"; 
echo "</p>"; 
    echo "<p>"; 
    $items = mysql_query($sql); 
    echo mysql_error(); 
    while ($item = mysql_fetch_array($items)) 
    { 
if($item[3]=="Male"){ // cant remember if its Male or M ?? 
$img = '<img src="../images/male.gif" alt="M"/>';
}else{
$img = '<img src="../images/female.gif" alt="f"/>';
}

$idle = time()-$item[3];

      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&ses=$ses\">$item[0]</a>"; 
      echo "$img $lnk - $item[1] $idle<br/>"; 
    } 
    echo "</p>"; 
    echo "<p align=\"center\">"; 
    if($page>1) 
    { 
      $ppage = $page-1; 
      echo "<a href=\"index.php?action=online&page=$ppage&ses=$ses\">«PREV</a> "; 
    } 
    if($page<$num_pages) 
    { 
      $npage = $page+1; 
      echo "<a href=\"index.php?action=online&page=$npage&ses=$ses\">Next»</a>"; 
    } 
    echo "<br/>$page/$num_pages<br/>"; 
    if($num_pages>2) 
    { 
      echo getjumper($mime,$action, $ses,"index"); 
    } 
    echo "</p>"; 
  ////// UNTILL HERE >> 

  echo "<p align=\"center\">"; 
  echo "<a href=\"index.php?action=main&ses=$ses\"><img src=\"images/home.gif\" alt=\"*\"/>"; 
echo "Home</a>"; 
  echo "</p>"; 
        echo webfoot(); 

}else{ 
        echo waphead($stitle); 
 //////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; 

    //changable sql 
    $sql = "SELECT 
            a.name, b.place, b.userid, a.sex, a.lastact 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 "<p align=\"center\">"; 
          $timeout = 180; 
          $timeon = time()-$timeout; 
          $noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE perm>'0' AND lastact>'".$timeon."'")); 
          echo "Staff Online: <a href=\"index.php?action=stfol&ses=$ses\">".$noi[0]."</a>"; 
          echo "<br/>"; 
echo "</p>"; 
    echo "<p>"; 
    $items = mysql_query($sql); 
    echo mysql_error(); 
    while ($item = mysql_fetch_array($items)) 
    { 
if($item[3]=="Male"){ // cant remember if its Male or M ?? 
$img = '<img src="../images/male.gif" alt="M"/>';
}else{
$img = '<img src="../images/female.gif" alt="f"/>';
}

$idle = time()-$item[3];

      $lnk = "<a href=\"index.php?action=viewuser&who=$item[2]&ses=$ses\">$item[0]</a>"; 
      echo "$img $lnk - $item[1] $idle<br/>"; 
    } 
    echo "</p>"; 
    echo "<p align=\"center\">"; 
    if($page>1) 
    { 
      $ppage = $page-1; 
      echo "<a href=\"index.php?action=online&page=$ppage&ses=$ses\">«PREV</a> "; 
    } 
    if($page<$num_pages) 
    { 
      $npage = $page+1; 
      echo "<a href=\"index.php?action=online&page=$npage&ses=$ses\">Next»</a>"; 
    } 
    echo "<br/>$page/$num_pages<br/>"; 
    if($num_pages>2) 
    { 
      echo getjumper($mime,$action, $ses,"index"); 
    } 
    echo "</p>"; 
  ////// UNTILL HERE >> 

  echo "<p align=\"center\">"; 
  echo "<a href=\"index.php?action=main&ses=$ses\"><img src=\"images/home.gif\" alt=\"*\"/>"; 
echo "Home</a>"; 
  echo "</p>"; 
        echo wapfoot(); 

    } 

As for security bot your are far better off coding it in core.php 🙂

berty14 Developer · 52 posts #3

and bro i need the code to send pm to all members

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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