Skip to Content Skip to Menu

get user avatar help please

  • txchaser
  • txchaser
  • OFFLINE
  • Posts: 1
  • Thanks: 0
  • Karma: 0
8 years 9 months ago #277156 by txchaser
get user avatar help please was created by txchaser
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; ?>

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum