Insert this code in your lib-custom.php file and create a new php block: phpblock_whos_new_photo
Text Formatted Code
function phpblock_whos_new_photo() {
global $_CONF, $_TABLES;
//limit the number of photos you want to display
$limit = 22;
//set height and width of a picture in px
$height = 50;
$width = 50;
$sql = "SELECT u.uid,u.username,u.photo,s.sess_id FROM {$_TABLES['users']} as u " .
"LEFT JOIN {$_TABLES['userinfo']} as ui ON u.uid=ui.uid " .
"LEFT JOIN {$_TABLES['userprefs']} as up ON ui.uid=up.uid " .
"LEFT JOIN {$_TABLES['sessions']} as s ON up.uid=s.uid " .
"WHERE u.uid > 2 AND up.showonline = 1 AND ui.lastlogin > 0 AND (u.photo !=NULL OR u.photo !='') ORDER BY u.regdate DESC LIMIT {$limit}";
$result = DB_query($sql);
$display = '<div>';
while ( $U = DB_fetchArray($result) ) {
if ( $U['photo'] != '' && $U['photo'] != NULL ) {
$photo = $_CONF['site_url'].'/images/userphotos/'.$U['photo'];
$display .= '<div style="float:left;padding-top:0;padding-right:5px;padding-left:5px;padding-bottom:5px;">';
$display .= '<a href="'.$_CONF['site_url'].'/users.php?mode=profile&uid='.$U['uid'].'">';
$display .= '<img src="'.$photo.'" height="' . $height . 'px" width="' . $width .'px" style="padding:0px;" alt="'.$U['username'].'" title="'.$U['username'].'" /></a>';
$display .= '</div>';
}
}
$display .= '</div>';
$display .= '<div style="clear:both;"></div>';
return $display;
}