Welcome to Geeklog, Anonymous Thursday, March 28 2024 @ 08:02 am EDT

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
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&amp;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
 Quote

All times are EDT. The time is now 08:02 am.

  • 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