**/ //Base plugin class. /* Use $this->plugin( 'cbprofilelink', $this->link) in template */ global $mosConfig_absolute_path; require_once $mosConfig_absolute_path.'/components/com_mtree/Savant2/Plugin.php'; class Savant2_Plugin_cbprofilelink extends Savant2_Plugin { function plugin( &$link, $attr=null ) { global $_MT_LANG, $mtree, $mosConfig_lang, $database; $query = "SELECT id" . "\n FROM #__menu" . "\n WHERE link = 'index.php?option=com_comprofiler'" . "\n LIMIT 1" ; $database->setQuery( $query ); $Itemid = $database->loadResult(); // Blank itemid checker for SEF if ($Itemid == NULL) { $Itemid = ''; } else { $Itemid = '&Itemid='. $Itemid; } $database->setQuery( "SELECT c.avatar, c.avatarapproved, u.name FROM #__comprofiler AS c, #__users AS u WHERE c.user_id='".$link->user_id."' AND u.id='".$link->user_id."'"); $users = $database->loadObjectList(); $user = $users[0]; $html = 'user_id.$Itemid); $html .= '">'; switch($attr) { case 'icon': $html .= 'Click here to see the profile of this user'; break; case 'avatar': $uimage='tn'.$user->avatar; if (file_exists("components/com_comprofiler/plugin/language/".$mosConfig_lang."/images")) $uimagepath="components/com_comprofiler/plugin/language/".$mosConfig_lang."/images/"; else $uimagepath="components/com_comprofiler/plugin/language/default_language/images/"; if($user->avatar=='' || $user->avatar==null || $user->avatarapproved==0) $uimage=$uimagepath."tnnophoto.jpg"; else $uimage="images/comprofiler/".$uimage; $html .= "\"".$user-name."\" title=\"".$user->name."\" border=\"0\" />"; break; case 'name': $html .= $user->name; break; } $html .= ''; return $html; } } ?>