I have the following code to display an image uploaded by the user (cb_logo)much the same as the avatar works (I have that as well), and I have the code working, but it only displays when the user is logged in and site wide. I need it to display for anyone who visits the profile. I need it to display the profile being viewed instead of the viewer, regardless if they are logged in or not.
Code:
<?php
global $_CB_framework, $mainframe;
if ( defined( 'JPATH_ADMINISTRATOR' ) ) {
if ( ! file_exists( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}
include_once( JPATH_ADMINISTRATOR . '/components/com_comprofiler/plugin.foundation.php' );
} else {
if ( ! file_exists( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' ) ) {
echo 'CB not installed!';
return;
}
include_once( $mainframe->getCfg( 'absolute_path' ) . '/administrator/components/com_comprofiler/plugin.foundation.php' );
}
cbimport( 'cb.html' );
$cbUser =& CBuser::getInstance( (int) $_CB_framework->myId() );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
$user =& $cbUser->getUserData();
$logo = $cbUser->getField( 'cb_logo' );
echo $logo;
?>
I apologize in advance for the formatting to make your eyes bleed.