A ver si esto vale... administrator/com_profiler/plugins.fundation.php
function getField( $fieldName, $defaultValue = null, $output = 'html', $formatting = 'none', $reason = 'profile', $list_compare_types = 0 ) {
global $_CB_framework, $_PLUGINS;
$tabs =& $this->_getCbTabs();
$fields = $tabs->_getTabFieldsDb( null, $this->getInstance( $_CB_framework->myId() ), $reason, $fieldName );
if ( isset( $fields[0] ) ) {
$field = $fields[0];
$value = $_PLUGINS->callField( $field->type, 'getFieldRow', array( &$field, &$this->_cbuser, $output, $formatting, $reason, $list_compare_types ), $field );
} else {
$value = $defaultValue;
}
return $value;
}
// Por
function getField( $fieldName, $defaultValue = null, $output = 'html', $formatting = 'none', $reason = 'profile', $list_compare_types = 0 ) {
if ($fieldName == "avatar") {
$db =& JFactory::getDBO();
$db->setQuery("SELECT avatar FROM #__fb_users WHERE userid=".$this->user_id);
$avatar = $db->loadResult();
if (!empty($avatar)) {
if(!file_exists(JPATH_ROOT.DS.'images'.DS.'fbfiles'.DS.'avatars'.DS.'s_' . $avatar)) {
return JURI::root() . 'images/fbfiles/avatars/' . $avatar;
}
else {
return JURI::root() . 'images/fbfiles/avatars/';
}
}
else {
return JURI::root() . 'images/fbfiles/avatars/nophoto.jpg';
}
}
global $_CB_framework, $_PLUGINS;
$tabs =& $this->_getCbTabs();
$fields = $tabs->_getTabFieldsDb( null, $this->getInstance( $_CB_framework->myId() ), $reason, $fieldName );
if ( isset( $fields[0] ) ) {
$field = $fields[0];
$value = $_PLUGINS->callField( $field->type, 'getFieldRow', array( &$field, &$this->_cbuser, $output, $formatting, $reason, $list_compare_types ), $field );
} else {
$value = $defaultValue;
}
return $value;
}
// Y
function avatarFilePath( $show_avatar = 2 ) {
global $_CB_framework;
$oValue = null;
if ( $this->_cbuser ) {
$avatar = $this->_cbuser->avatar;
$avatarapproved = $this->_cbuser->avatarapproved;
$absolute_path = $_CB_framework->getCfg( 'absolute_path' );
$live_site = $_CB_framework->getCfg( 'live_site' );
if ( $avatarapproved == 0 ) {
return selectTemplate() . 'images/avatar/tnpending_n.png';
} elseif ( ( $avatar == '' ) && $avatarapproved == 1 ) {
$oValue = null;
} elseif ( strpos( $avatar, 'gallery/' ) === false ) {
$oValue = 'images/comprofiler/tn' . $avatar;
} else {
$oValue = 'images/comprofiler/' . $avatar;
}
if ( ! is_file( $absolute_path . '/' . $oValue ) ) {
$oValue = null;
}
if ( ( ! $oValue ) && ( $show_avatar == 2 ) ) {
return selectTemplate() . 'images/avatar/tnnophoto_n.png';
}
}
if ( $oValue ) {
$oValue = $live_site . '/' . $oValue;
}
return $oValue;
}
// Por
function avatarFilePath( $show_avatar = 2 ) {
$db =& JFactory::getDBO();
$db->setQuery("SELECT avatar FROM #__fb_users WHERE userid=".$this->user_id);
$avatar = $db->loadResult();
if (!empty($avatar)) {
if(!file_exists(JPATH_ROOT.DS.'images'.DS.'fbfiles'.DS.'avatars'.DS.'s_' . $avatar)) {
return JURI::root() . 'images/fbfiles/avatars/' . $avatar;
}
else {
return JURI::root() . 'images/fbfiles/avatars/';
}
}
else {
return JURI::root() . 'images/fbfiles/avatars/nophoto.jpg';
}
}