help with my online list pls

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

    help with my online list pls

    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
    PHP Code:
    }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&amp;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&amp;who=$item[2]&amp;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&amp;page=$ppage&amp;ses=$ses\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"index.php?action=online&amp;page=$npage&amp;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&amp;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&amp;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&amp;who=$item[2]&amp;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&amp;page=$ppage&amp;ses=$ses\">«PREV</a> ";
        }
        if($page<$num_pages)
        {
          $npage = $page+1;
          echo "<a href=\"index.php?action=online&amp;page=$npage&amp;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&amp;ses=$ses\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
      echo "</p>";
            echo wapfoot();
    
        } 
    

    #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
    PHP Code:
    }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&amp;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&amp;who=$item[2]&amp;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&amp;page=$ppage&amp;ses=$ses\">«PREV</a> "; 
        } 
        if($page<$num_pages) 
        { 
          $npage = $page+1; 
          echo "<a href=\"index.php?action=online&amp;page=$npage&amp;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&amp;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&amp;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&amp;who=$item[2]&amp;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&amp;page=$ppage&amp;ses=$ses\">«PREV</a> "; 
        } 
        if($page<$num_pages) 
        { 
          $npage = $page+1; 
          echo "<a href=\"index.php?action=online&amp;page=$npage&amp;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&amp;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
    Last edited by something else; 26.05.10, 17:12.

    Comment


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

      Comment


        #4
        its already in forum somewhere

        Comment

        Working...
        X