list all user

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

    list all user

    Hi,

    How can i make on lavalair script to see all user.

    #2
    if you dont understand basic PHP why would you try to operate a site beyond an off the shelf product ???

    theory
    Code:
    $res = mysql_query("SELECT * FROM users ORDER BY username");
    while($arr = mysql_fetch_assoc($res))
     echo $arr['username']."<br />";
    If your trying to learn php then i suggest you have a stab at it yourself, once you know how its around 3 lines of code to do and 2 minutes work (1min30secs of which is making it colorful and adding in links where you need them)

    Comment


      #3
      djlee mabe u can help me i just tought of this how to show all the users on the site in the online list and the first few pages show the online members when u go further it will show all the ofline members?
      Code:
      ////////////////////////////////
      else if($action=="online")
      {  $pstyle = gettheme($sid);
          echo xhtmlhead("Online List",$pstyle);
      $nouo = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_online WHERE hidden = 1"));
      gettimebar();
      getnewmsg($sid);
      getalert($sid);
      getshouts($sid);
      $num_items = getnumonline(); //changable
      if (ismod($uid)){
      	$clkd = "<a href=\"index.php?action=onlineh&amp;sid=$sid\">hidden</a>.";
      }
      else{
      	$clkd = "hidden.";
      }
      boxstart("Online Users");
      echo "$num_items users are currently online among which ".$nouo[0]." are $clkd.<br/>";
          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, sex FROM ibwf_users a
                  INNER JOIN ibwf_online b ON a.id = b.userid WHERE b.hidden = 0
                  GROUP BY 1,2
                  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();
      boxstart("Online Users");
          while ($item = mysql_fetch_array($items))
          {
            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&amp;who=$item[2]&amp;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&amp;page=$ppage&amp;sid=$sid\">&#171;PREV</a> ";
          }
          if($page<$num_pages)
          {
            $npage = $page+1;
            echo "<a href=\"index.php?action=online&amp;page=$npage&amp;sid=$sid\">Next&#187;</a>";
          }
          echo "<br/>$page/$num_pages<br/>";
          if($num_pages>2)
          {
            echo getjumper($action, $sid,"index");
          }
          echo "</p>";
        ////// UNTILL HERE >>
      
      /////////main menu footer
      echo "
               <div class=\"footer\">
      
      	   <center><small>
      	     <a href=\"index.php?action=online&amp;sid=$sid\" accesskey=\"5\">Online Users(".getnumonline().")</a> |
      	     <a href=\"index.php?action=mainthm&amp;sid=$sid\">Theme Manager</a> <br/>
      	     <a href=\"index.php?action=chbmsg&amp;sid=$sid\">Set Mood</a> |
                   <a href=\"index.php?action=stats&amp;sid=$sid\">Site Stats</a><br/>
                     <a href=\"index.php?action=main&amp;sid=$sid\">HOME</a><br/>
      
      <b>&#169; copyright $date &#169;</b><br/>www.$stitle.$sdomain<br/>
                 </small></center>
      
      	 </div>
      ";
      boxend();exit();
      }

      Comment


        #4
        thats easy
        riderz u just call up every member but order by online 1st then offline will appear the further u go thru it

        Comment


          #5
          like
          $sql = mysql_query("SELECT * FROM users WHERE banned = '0' ORDER BY lastseen DESC");
          something like that should do trick

          Comment


            #6
            i have done this thank you, one more questions how can i add more field on register
            Last edited by joker12; 19.01.10, 13:02.

            Comment


              #7
              indeed ori is correct. just order the users as needed and created your pager system and away you go.

              @joker: this is quite basic stuff buddy, and if you've read any of my posts you'll realise two things... 1st i dont often provide fully functioning code as i prefer to teach people how to do it themselves (and partially due to numero 2), 2nd i dont use any source bases for any site i create so i dont know the code layout or even the sql layout.

              But what you need is quite simple, you already have the display and processing, you just need to add to it, look at what you have already, hell you can even copy and paste it, if you wanna add a mob number field for example, copy the username field, change the name of the input and thats about it, then in the actually registration process (the real php part that inserts the user) copy username again changing it to assign $mob=$_POST['mobnum'] and then add mobnum to the (usually fairly large) insert query.

              Just have a go and use google A LOT. You'll learn a lot more by fooking up 5 times than you will by being told exactly (actually most of the stuff i learn comes from going the wrong way around things)

              Comment


                #8
                Originally posted by djlee View Post
                indeed ori is correct. just order the users as needed and created your pager system and away you go.

                @joker: this is quite basic stuff buddy, and if you've read any of my posts you'll realise two things... 1st i dont often provide fully functioning code as i prefer to teach people how to do it themselves (and partially due to numero 2), 2nd i dont use any source bases for any site i create so i dont know the code layout or even the sql layout.

                But what you need is quite simple, you already have the display and processing, you just need to add to it, look at what you have already, hell you can even copy and paste it, if you wanna add a mob number field for example, copy the username field, change the name of the input and thats about it, then in the actually registration process (the real php part that inserts the user) copy username again changing it to assign $mob=$_POST['mobnum'] and then add mobnum to the (usually fairly large) insert query.

                Just have a go and use google A LOT. You'll learn a lot more by fooking up 5 times than you will by being told exactly (actually most of the stuff i learn comes from going the wrong way around things)
                its work one more questions how can i add to send auto e-mail when the user register like new auto pm

                Comment

                Working...
                X