Welcome to Geeklog, Anonymous Wednesday, November 27 2024 @ 06:34 pm EST
Geeklog Forums
Who's new photo
Status: offline
::Ben
Forum User
Full Member
Registered: 01/14/05
Posts: 1569
Location:la rochelle, France
Insert this code in your lib-custom.php file and create a new php block: phpblock_whos_new_photo
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;
}
See demo in the footer page
Ben
I'm available to customise your themes or plugins for your Geeklog CMS
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;
}
See demo in the footer page
Ben
I'm available to customise your themes or plugins for your Geeklog CMS
16
15
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