Ok I fixed the script so that it says "Never" for those who haven't logged in.
Text Formatted Code
$color = "#C0C0C0"; // this set the background color of the switched row.
//get and prep array of user info
$membersprep = DB_query( "SELECT * FROM gl_users, gl_userinfo where gl_users.uid = gl_userinfo.uid ORDER BY username" );
//$members = DB_fetchArray($membersprep);
//figure out haw many users we really have here
$limit = DB_count('gl_userinfo') - 2;
$count = 1;
// tell folks how popular we really are
$putout .= "There are currently " . $limit . " members of the site!";
//Load up the first of the display
$putout .= "<table>";
//create our header row
$putout .= "<TR bgcolor='#FFFFFF'>";
$putout .= "<TD><B><H3>Name</H3></B></TD>";
$putout .= "<TD><B><H3>Join Date</H3></B></TD>";
$putout .= "<TD><B><H3>Last Login Date</H3></B></TD>";
$putout .= "</TR>";
//start spewing out information and switching the bkgrnd color
$switch = false;
while($count <= $limit){
$membersout = DB_fetcharray($membersprep);
switch ( $switch ) {
case true:
$switch = false; // alternating color
$putout .= "<TR bgcolor=' " . $color . "'>";
break;
default:
$switch = true; // default, no back color
$putout .= "<TR bgcolor='FFFFFF'>";
} // switch
$putout .= "<TD><a href='http://www.miplanet.com/admin/user.php?mode=edit&uid=";
$putout .= $membersout['uid'] . " '>" . $membersout['username'] . "</a></TD>";
$putout .= "<TD>" . $membersout['regdate'] . "</TD>";
$curtime2 = COM_getUserDateTimeFormat($membersout['lastlogin']);
if ( ($membersout['lastlogin']) == '0') {
$membersout["lastlogin"] = 'Never';
} else {
$membersout['lastlogin'] = $curtime2[0];
}
$putout .= "<TD>" . $membersout['lastlogin'] . "</TD>";
$putout .= "</TR>";
$count++;
} // while
//close out the table
$putout .= "</TABLE>";
return $putout;
Now we need to address as to why so many seem to be reset to zero or in one case empty. Of course maybe there is a large number who register then never log in?