%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
| Server IP : 14.207.165.8 / Your IP : 216.73.216.26 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/thread-self/root/var/www/html/old/libraries/kunena/integration/ |
Upload File : |
<?php
/**
* Kunena Component
* @package Kunena.Framework
* @subpackage Integration
*
* @copyright (C) 2008 - 2014 Kunena Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* @link http://www.kunena.org
**/
defined ( '_JEXEC' ) or die ();
/**
* Class KunenaAvatar
*/
class KunenaAvatar {
public $avatarSizes = null;
protected $resize = false;
protected static $instance = false;
static public function getInstance($integration = null) {
if (self::$instance === false) {
JPluginHelper::importPlugin('kunena');
$dispatcher = JDispatcher::getInstance();
$classes = $dispatcher->trigger('onKunenaGetAvatar');
foreach ($classes as $class) {
if (!is_object($class)) continue;
self::$instance = $class;
break;
}
if (!self::$instance) {
self::$instance = new KunenaAvatar();
}
}
return self::$instance;
}
public function load($userlist) {}
public function getEditURL() { return ''; }
protected function _getURL($user, $sizex, $sizey) { return ''; }
public function getSize($sizex=90, $sizey=90) {
$size = new StdClass();
$size->x = intval($sizex);
$size->y = intval($sizey);
if (!intval($sizex)) {
$template = KunenaFactory::getTemplate();
$name = ucfirst(strtolower($sizex));
$size->x = intval($template->params->get('avatarSizeX'.$name, 90));
$size->y = intval($template->params->get('avatarSizeY'.$name, 90));
}
return $size;
}
public function getURL($user, $sizex=90, $sizey=90) {
KUNENA_PROFILER ? KunenaProfiler::instance()->start('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
$size = $this->getSize($sizex, $sizey);
if (!$size->x || !$size->y) return;
$result = $this->_getURL($user, $size->x, $size->y);
KUNENA_PROFILER ? KunenaProfiler::instance()->stop('function '.__CLASS__.'::'.__FUNCTION__.'()') : null;
return $result;
}
public function getLink($user, $class='', $sizex=90, $sizey=90)
{
$size = $this->getSize($sizex, $sizey);
$avatar = $this->getURL($user, $size->x, $size->y);
if (!$avatar) return;
if ($class) $class=' class="'.$class.'"';
// Style is needed to resize avatar for JomSocial and other integration that do not have automatic resizing
if (!$this->resize) $style = 'style="max-width: '.$size->x.'px; max-height: '.$size->y.'px"';
else $style = '';
$link = '<img'.$class.' src="'.$avatar.'" alt="'.JText::sprintf('COM_KUNENA_LIB_AVATAR_TITLE', $user->getName()).'" '.$style.' />';
return $link;
}
}