Welcome to Geeklog, Anonymous Monday, October 14 2024 @ 05:57 pm EDT

Geeklog Forums

Slight modification to "Who's New"


Status: offline

mrb42

Forum User
Junior
Registered: 10/15/04
Posts: 20
Thought I'd share this, it's simple, but I'm just learning.

I added a Total members count to the bottom of the New member list...

Text Formatted Code
function phpblock_whos_new2()
{
    global $_CONF,$_TABLES;

    // Set the number of new members to show
    $numToShow = 5;

    $result = DB_query("SELECT uid,username,photo FROM {$_TABLES['users']} 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=' . $A['uid'] . '">' . $A['username'] .
 '</a>';
        if (!empty($A['photo']) AND $_CONF['allow_user_photo'] == 1) {
            $retval .= ' <a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '"><img src="
' . $_CONF['layout_url'] . '/images/smallcamera.gif" border="0"></a>';
        }
        $retval .= '<br>';
    }
    //Get Total Number of Members
    $result = DB_query("Select count(email) FROM {$_TABLES['users']}");
    $B = DB_fetchArray($result);
    $retval .= '<center><BR><B>' . $B['count(email)'] . ' members at NEOHM</b></center>';
    return $retval;
}
 
 Quote

Status: offline

1000ideen

Forum User
Full Member
Registered: 08/04/03
Posts: 1298
Thanks, that't a great little add on to the original block. Just what I had been looking for.

Would it be difficult to change it to show the full name if applicable? Though the variable changes a bit from 1.3.11sr3 to 1.4.1b1

in 1.3.11sr3
$_CONF['whosonline_fullname'] = 0;

in 1.4.1b1
// Used by COM_displayName to return Members's Full Name else username (1 = yes, 0 = no)
$_CONF['show_fullname'] = 0;
 Quote

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