Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 06:34 pm EST

Geeklog Forums

New users


Luke

Anonymous
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
 Quote

Status: offline

Dirk

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

bye, Dirk
 Quote

Luke

Anonymous
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
 Quote

Alfred

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

Luke

Anonymous
Anyone please?

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

Status: Banned

machinari

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;
}

 
 Quote

All times are EST. The time is now 06:34 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