1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-24 15:13:04 +02:00

Some User-Avatar cleanup.

This commit is contained in:
Cameron
2016-03-08 17:51:29 -08:00
parent daf5495214
commit cf90582418
7 changed files with 95 additions and 13 deletions

View File

@@ -597,11 +597,23 @@ class user_shortcodes extends e_shortcode
}
}
function sc_user_photo($parm)
{
$row = array('user_image'=>$this->var['user_sess']);
return e107::getParser()->toAvatar($row, $parm);
}
function sc_user_picture($parm)
{
$tp = e107::getParser();
$parm['id'] = 'user-profile-avatar';
return $tp->toAvatar($this->var, $parm);
return $tp->parseTemplate("{USER_AVATAR=".$this->var['user_sess']."}",true);
if ($this->var['user_sess'] && file_exists(e_MEDIA."avatars/".$this->var['user_sess']))

View File

@@ -242,9 +242,11 @@ class usersettings_shortcodes extends e_shortcode
function sc_photo_upload($parm)
{
$diz = LAN_USET_27.". ".LAN_USET_28.".";
$text = '';
if(USERPHOTO)
{
$text .= e107::getParser()->parseTemplate("{PICTURE}",true);
}
@@ -373,7 +375,7 @@ class usersettings_shortcodes extends e_shortcode
$fieldList = $sql->db_getList();
foreach($fieldList as $field)
{
cachevars("extendedfield_{$cat['user_extended_struct_name']}", $field);
cachevars("extendedfield_{$field['user_extended_struct_name']}", $field);
//TODO use $this instead of parseTemplate();
$ret .= $this->sc_userextended_field($field['user_extended_struct_name']);
// $ret .= $tp->parseTemplate("{USEREXTENDED_FIELD={$field['user_extended_struct_name']}}", TRUE, $usersettings_shortcodes);

View File

@@ -2,9 +2,19 @@
// $Id$
function user_avatar_shortcode($parm=null) //TODO new function $tp->toAvatar(); so full arrays can be passed to it.
{
if(is_string($parm))
{
$data = array('user_image'=>$parm);
}
elseif(is_array($parm))
{
$data = $parm;
}
return e107::getParser()->toAvatar($data, $data);
/*
global $loop_uid;
$tp = e107::getParser();
$width = $tp->thumbWidth;
$height = ($tp->thumbHeight !== 0) ? $tp->thumbHeight : "";
@@ -87,6 +97,7 @@ function user_avatar_shortcode($parm=null) //TODO new function $tp->toAvatar();
$text = "<img class='img-rounded user-avatar e-tip' title='".$title."' src='".$img."' alt='' style='width:".$width."px; height:".$height."px' />";
// return $img;
return $text;
*/
}
?>

View File

@@ -217,7 +217,58 @@ $USER_EMBED_USERPROFILE_TEMPLATE = "
// Convert Templates from v1.x to v2.x Standards.
// Convert Templates from v1.x to v2.x Standards.
/** TODO EXPERIMENTAL */
/*
if(defset('BOOTSTRAP') == 3)
{
//EXPERIMENTAL
e107::css('inline', "
#user-profile-avatar {
max-width: 150px;
margin-top: -90px;
margin-bottom: 15px;
border: 5px solid #fff;
border-radius: 100%;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
margin-left:auto;
margin-right:auto;
}
");
$USER_FULL_TEMPLATE = '{SETIMAGE: w=600}
<div class="row">
<div class="col-md-12">
<div class="panel panel-default panel-profile">
<div class="ans panel-heading" style="height:180px; background-size: cover;background-image: url({USER_PHOTO: type=url});"></div>
<div class="panel-body text-center">
{SETIMAGE: w=200}
{USER_PICTURE: shape=circle&link=1}
<h5>{USER_NAME}</h5>
<p>{USER_SIGNATURE}</p>
</div>
</div>
</div>
</div>
';
}
*/
$USER_TEMPLATE['view'] = $USER_FULL_TEMPLATE;
$USER_TEMPLATE['extended']['start'] = $EXTENDED_CATEGORY_START;