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.
Is there anything like this already available?
Thanks.
6
5
Quote
Luke
Anonymous
Thanks for that.
I still have no clue how to do it.
I was trying this code:
("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.
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.
5
10
Quote
Alfred
Anonymous
This looks great. I would like to use it. Anyone has done this yet?
4
2
Quote
Luke
Anonymous
Anyone please?
I still didn't manage to get it to work?
I still didn't manage to get it to work?
3
9
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
// 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;
}
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;
}
3
7
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