2006-12-02 04:36:16 +00:00
|
|
|
<?php
|
2013-05-20 17:10:38 -07:00
|
|
|
/**
|
2009-11-17 10:46:35 +00:00
|
|
|
* e107 website system
|
|
|
|
*
|
2009-11-18 01:06:08 +00:00
|
|
|
* Copyright (C) 2008-2009 e107 Inc (e107.org)
|
2009-11-17 10:46:35 +00:00
|
|
|
* Released under the terms and conditions of the
|
|
|
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
|
|
|
*
|
|
|
|
*
|
2011-07-01 12:30:18 +00:00
|
|
|
* $URL$
|
|
|
|
* $Id$
|
2013-05-20 17:10:38 -07:00
|
|
|
* @DEPRECATED FILE
|
2009-11-17 10:46:35 +00:00
|
|
|
*/
|
|
|
|
|
2008-12-10 16:37:17 +00:00
|
|
|
if (!defined('e107_INIT'))
|
|
|
|
{
|
|
|
|
exit;
|
|
|
|
}
|
2013-05-20 17:10:38 -07:00
|
|
|
/**
|
|
|
|
* @DEPRECATED
|
|
|
|
* Use e107::getParser()->parseTemplate("{USER_AVATAR=".$avatar."}",true); instead.
|
|
|
|
*/
|
2008-12-10 16:37:17 +00:00
|
|
|
function avatar($avatar)
|
|
|
|
{
|
2017-01-02 14:08:34 -08:00
|
|
|
$data = array('user_image' => $avatar);
|
|
|
|
|
|
|
|
return e107::getParser()->toAvatar($data, array('type'=>'url'));
|
|
|
|
// return e107::getParser()->parseTemplate("{USER_AVATAR=".$avatar."}",true);
|
2013-04-19 22:50:41 -07:00
|
|
|
|
2013-05-20 17:10:38 -07:00
|
|
|
/*
|
2006-12-02 04:36:16 +00:00
|
|
|
global $tp;
|
2008-12-10 16:37:17 +00:00
|
|
|
if (stristr($avatar, '-upload-') !== false)
|
|
|
|
{
|
2013-04-19 22:50:41 -07:00
|
|
|
return e_AVATAR_UPLOAD.str_replace('-upload-', '', $avatar);
|
2008-12-10 16:37:17 +00:00
|
|
|
}
|
|
|
|
elseif (stristr($avatar, 'Binary') !== false)
|
|
|
|
{
|
2006-12-02 04:36:16 +00:00
|
|
|
$sqla = new db;
|
|
|
|
preg_match("/Binary\s(.*?)\//", $avatar, $result);
|
2008-12-10 16:37:17 +00:00
|
|
|
$sqla->db_Select('rbinary', '*', "binary_id='".$tp->toDB($result[1])."' ");
|
2006-12-02 04:36:16 +00:00
|
|
|
$row = $sqla->db_Fetch();
|
2008-12-10 16:37:17 +00:00
|
|
|
return $row['binary_data'];
|
|
|
|
}
|
|
|
|
elseif (strpos($avatar, 'http://') === false)
|
|
|
|
{
|
2011-07-01 12:30:18 +00:00
|
|
|
return SITEURLBASE.e_IMAGE_ABS."avatars/".$avatar;
|
2008-12-10 16:37:17 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2006-12-02 04:36:16 +00:00
|
|
|
return $avatar;
|
|
|
|
}
|
2013-05-20 17:10:38 -07:00
|
|
|
*/
|
2006-12-02 04:36:16 +00:00
|
|
|
}
|
2008-12-10 16:37:17 +00:00
|
|
|
|
2006-12-02 04:36:16 +00:00
|
|
|
?>
|