Hi there,
I have been working on this for a few days now and have not been able to get this to work as of yet. What I am trying to accomplish is the following.
I am trying to make a php call to get the logged in users avatar and then call the results with an ajax call into another application within the same file directory. I have managed to make a php call to get the users id but have not been able to get and display the users avatar. The following code seems to work but displays no picture on the output and have no errors showing. Your help with this is appreciated.
Code:
<?php
define('_JEXEC', 1);
if (file_exists(__DIR__ . '/defines.php'))
{
include_once __DIR__ . '/defines.php';
}
if (!defined('_JDEFINES'))
{
define('JPATH_BASE', __DIR__);
require_once JPATH_BASE . '/includes/defines.php';
}
require_once ( JPATH_BASE .'/includes/framework.php' );
$app = JFactory::getApplication('site');
$cbUser =& CBuser::getInstance( $user->id );
if ( ! $cbUser ) {
$cbUser =& CBuser::getInstance( null );
}
function getField( $fieldName, $defaultValue = null, $output = 'html', $formatting = 'none', $reason = 'profile', $list_compare_types = 0 ) {
$avatar = $cbUser->getField( 'avatar', null, 'html', 'none', 'list' );
echo $avatar;
?>