If you use Facebook Connect plugin (1.4.1) and have a theme with profile pictures of registered users, you can use this to display their FB profile picture. It defaults to a standard image for users without FB or when something goes wrong.
In plugins/Facebook/index.php add this function under fbc_button function:
function fbc_image($user, $width, $height, $default) {
$manager = User::newInstance();
$manager->dao->select('i_facebook_uid');
$manager->dao->from( DB_TABLE_PREFIX.'t_facebook_connect' );
$manager->dao->where( 'fk_i_user_id', $user );
$result = $manager->dao->get();
if($result->result()!=array()) {
$row = $result->row();
echo '
https://graph.facebook.com/' . $row['i_facebook_uid'] . '/picture?width=' . $width . '&height=' . $height;
} else {
echo $default;
}
}
In your theme php page use this syntax:
<?php fbc_image( osc_user_id(), *WIDTH OF IMAGE*, *HEIGHT OF IMAGE*, *PATH TO DEFAULT PICTURE*); ?>
Example:
<img src="<?php fbc_image( osc_user_id(), 200, 200, '/oc-content/themes/osclass/img/user_default.png'); ?>" />