Welcome to Geeklog, Anonymous Monday, June 17 2024 @ 09:47 pm EDT

Geeklog Forums

New users


Can someone please tell me how can I make a simple PHP script that displays the users that registered today.

Is there anything like this already available?

Thanks. Smile

Status: offline


Site Admin
Registered: 01/12/02
Posts: 13073
Location:Stuttgart, Germany
This is a start ...

bye, Dirk


Thanks for that.

I still have no clue how to do it.

I was trying this code:

Text Formatted Code
$result = mysql_query
("SELECT COUNT(*) FROM gl_users WHERE regdate='".date("M d, Y")."'");

How can I compare the current date with the date (and time) Geeklog uses when users register?

Thanks. Smile


This looks great. I would like to use it. Anyone has done this yet?


Anyone please?

I still didn't manage to get it to work? Sad

Status: Banned


Forum User
Full Member
Registered: 03/22/04
Posts: 1512
this works for me... a variation of phpblock_whos_new for your lib-custom.php
Text Formatted Code
// NOTE: just a slight variation of  ***function phpblock_whos_new()***
// this returns users (up to limit) that have registered today.

function phpblock_whos_new_today(){
    global $_CONF, $_TABLES;

    $today = date("Y-m-d") . ' 00:00:00';
    $numToShow = 5;

    $result = DB_query("SELECT uid,username,photo FROM {$_TABLES['users']} WHERE regdate > '$today' ORDER BY regdate DESC limit $numToShow");

    $nrows = DB_numRows($result);
    for ($i = 1; $i <= $nrows; $i++) {
        $A = DB_fetchArray($result);
        $retval .= '<a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=';
        $retval .= $A['uid'] . '">' . $A['username'] . '</a>';
        if (!empty($A['photo']) AND $_CONF['allow_user_photo'] == 1) {
            $retval .= ' <a href="' . $_CONF['site_url'];
            $retval .= '/users.php?mode=profile&uid=' . $A['uid'] . '"><img src="';
            $retval .= $_CONF['layout_url'] . '/images/smallcamera.gif" border="0"></a>';
        $retval .= '';
    return $retval;


All times are EDT. The time is now 09:47 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