Welcome to Geeklog, Anonymous Wednesday, April 24 2024 @ 08:24 pm EDT

Geeklog Forums

My first try with a "5 last logged in users"


Status: offline

pernas

Forum User
Newbie
Registered: 11/15/03
Posts: 7
Hi!

Could someone please help me with the date conversion here in this block;

Text Formatted Code
function phpblock_5latest()                                                                                                              
{                                                                                                                                        
    global $_CONF;
    $list = "";                                                                                                                          
    $quer = mysql_query ("SELECT uid,lastlogin FROM gl_userinfo ORDER BY lastlogin DESC limit 5");                                        
    while ($line = mysql_fetch_array($quer)){                                                                                            
    $uidsql= mysql_query ("SELECT username FROM gl_users WHERE uid=$line[uid]");                                                          
    $uidresult = DB_fetchArray($uidsql);                                                                                                  
    $lastlogin = mysql_query ("SELECT lastlogin FROM gl_userinfo WHERE uid=$line[uid]");                                                  
/*    $lastlogin = DB_getItem (gl_userinfo, 'lastlogin', "uid = $line[uid]"); */                                                          
    $lasttime = COM_getUserDateTimeFormat ($lastlogin);

    $list = $list.'<a href="'.$_CONF["site_url"].'/users.php?mode=profile&uid='.$line["uid"].'" title="'.$line["lastlogin"].'">'.$uidresul
t[username];                                                                                                                              

    $list = $list.'</a><br>';
    }
return $list;
}
 


Using COM_getUserDateTimeFormat only returns "Array" and before that the format is "1070653936" - not making sense..

Regards,
Per
 Quote

All times are EDT. The time is now 08:24 pm.

  • Normal Topic
  • Sticky Topic
  • Locked Topic
  • New Post
  • Sticky Topic W/ New Post
  • Locked Topic W/ New Post
  •  View Anonymous Posts
  •  Able to post
  •  Filtered HTML Allowed
  •  Censored Content