Posted on: 12/06/02 11:34am
By: Anonymous (robot-penguin)
I've made another "Who's New" block. It displays all new members in an ordered list starting with the newest member.
function phpblock_whosnew() {
global $_CONF,$_TABLES,$_DB_table_prefix;
$retval='<p><center><i>Newest first</i></center></p>';
// Set the number of new members to show
$numToShow = 7;
$result = DB_query("SELECT uid,username,photo FROM `".$_DB_table_prefix."users` ORDER BY regdate DESC limit $numToShow");
$nrows = DB_numRows($result);
for ($i = 1; $i <= $nrows; $i++) {
$A = DB_fetchArray($result);
if (!empty($A['photo']) && $_CONF['allow_user_photo'] == 1) {
$retval .= '<ol compact start='.$i.'><li><a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' .$A['username']
.'</a> <a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '"><img src="' . $_CONF['layout_url']
. '/images/smallcamera.gif" border="0"></a></li></ol>';
}
elseif (empty($A['photo']) || $_CONF['allow_uer_photo'] == 0) {
$retval .= '<ol compact start='.$i.'><li><a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' .$A['username'] .'</a></li></ol>';
}
}
return $retval;
}
Posted on: 12/06/02 02:11pm
By: Dirk
... |/code] pseudo-tags when posting sections of code. It also makes your moderator's life a bit easier ;-)
bye, Dirk
Posted on: 12/06/02 04:05pm
By: rkozsan
Looks like a small typo in :
elseif (empty($A['photo']) || $_CONF['allow_uer_photo'] == 0) {
Should be 'allow_user_photo'... no?
rk
Posted on: 12/07/02 03:47am
By: Anonymous (robot-penguin)
Posted on: 01/04/03 01:51am
By: thedude
Posted on: 01/04/03 02:24am
By: thedude
Posted on: 07/26/04 07:32pm
By: Anonymous (Ryan)
Posted on: 07/26/04 09:22pm
By: TechSys
<br> or <p>codes.
Posted on: 07/26/04 09:27pm
By: Anonymous (Ryan)
Posted on: 07/26/04 09:33pm
By: TechSys
function phpblock_whosnew() { global $_CONF,$_TABLES,$_DB_table_prefix; $retval=''; // Set the number of new members to show $numToShow = 7; $result = DB_query("SELECT uid,username,photo FROM `".$_DB_table_prefix."users` ORDER BY regdate DESC limit $numToShow"); $nrows = DB_numRows($result); for ($i = 1; $i <= $nrows; $i++) { $A = DB_fetchArray($result); if (!empty($A['photo']) && $_CONF['allow_user_photo'] == 0) { $retval .= '<'.$i.'><a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' .$A['username'] .'</a> <a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '"><img src="' . $_CONF['layout_url'] . '/images/smallcamera.gif" border="0"></a><br>'; } elseif (empty($A['photo']) || $_CONF['allow_uer_photo'] == 0) { $retval .= '<'.$i.'><a href="' . $_CONF['site_url'] . '/users.php?mode=profile&uid=' . $A['uid'] . '">' .$A['username'] .'</a><br>'; } } return $retval; }