1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-30 11:20:25 +02:00

Blurry avatar fix and usersettings template fix. Also added $tp->setThumbSize($w,$h,$crop);

This commit is contained in:
Cameron
2013-05-07 18:32:38 -07:00
parent c2412d1270
commit a47cadb9b9
5 changed files with 51 additions and 16 deletions

View File

@@ -78,8 +78,9 @@ class usersettings_shortcodes extends e_shortcode
function sc_realname($parm)
{
$options = array('title'=> '', 'size' => 40);
{
$pref = e107::getPref();
$options = array('title'=> '', 'size' => 40,'required'=>$pref['signup_option_realname']);
return e107::getForm()->text('realname',$this->var['user_login'], 100, $options);
}
@@ -198,9 +199,12 @@ class usersettings_shortcodes extends e_shortcode
}
/**
* @DEPRECATED - it is integreated with sc_signature now.
*/
function sc_signature_help($parm)
{
return;
$pref = e107::getPref();
if(!check_class(varset($pref['signature_access'],0)))
{
@@ -398,5 +402,13 @@ class usersettings_shortcodes extends e_shortcode
return $ret;
}
function sc_updatesettingsbutton($parm='')
{
return "<input class='button btn btn-primary' type='submit' name='updatesettings' value='".LAN_USET_37."' />";
}
}
?>

View File

@@ -80,15 +80,11 @@ $sc_style['LOGINNAME']['post'] = "</td></tr>\n";
$sc_style['SIGNATURE']['pre'] = "<tr><td style='width:40%;vertical-align:top' class='forumheader3'>".LAN_USER_71.req($pref['signup_option_signature'])."</td>
<td style='width:60%' class='forumheader2'>";
$sc_style['SIGNATURE']['post'] = "</td></tr>\n";
//$sc_style['SIGNATURE']['pre'] = "<tr><td style='width:40%;vertical-align:top' class='forumheader3'></td>
// <td style='width:60%' class='forumheader2'>";
// $sc_style['SIGNATURE_HELP']['pre'] = "</td></tr>"; \
// $sc_style['SIGNATURE_HELP']['post'] = "</td></tr>";
$sc_style['SIGNATURE_HELP']['post'] = "</td></tr>";
$USER_EXTENDED_CAT = "<tr><td colspan='2' class='forumheader'>{CATNAME}</td></tr>";
@@ -169,13 +165,15 @@ $USERSETTINGS_EDIT = "
{USERCLASSES}
{USEREXTENDED_ALL}
{SIGNATURE}
<tr style='vertical-align:top'>
<td colspan='2' style='text-align:center' class='forumheader'><input class='button btn' type='submit' name='updatesettings' value='".LAN_USET_37."' /></td>
{SIGNATURE=cols=58&rows=4}
{SIGNATURE_HELP}
</tr>
</table>
<div>
{UPDATESETTINGSBUTTON}
</div>
</div>
";

View File

@@ -1834,6 +1834,28 @@ class e_parse extends e_parser
return $text;
}
public function setThumbSize($w=null,$h=null,$crop=null)
{
if($w)
{
$this->thumbWidth = intval($w);
}
if($h)
{
$this->thumbHeight = intval($h);
}
if($crop)
{
$this->thumbCrop = intval($crop);
}
}
/**
* @param $url
* @param $options ??

View File

@@ -391,13 +391,15 @@ class e_form
$pref = e107::getPref();
$attr = "aw=".$pref['im_width']."&ah=".$pref['im_height'];
$tp->setThumbSize($pref['im_width'],$pref['im_height']);
$blankImg = $tp->thumbUrl(e_IMAGE."generic/blank_avatar.jpg",$attr);
$localonly = true; //TODO add a pref for allowing external or internal avatars or both.
$idinput = $this->name2id($name);
$previnput = $idinput."-preview";
$optioni = $idinput."-options";
$img = (strpos($curVal,"://")!==false) ? $curVal : $tp->thumbUrl(e_AVATAR_DEFAULT.$curVal,"aw=".vartrue($width)."&ah=".vartrue($height),true);
$img = (strpos($curVal,"://")!==false) ? $curVal : $tp->thumbUrl(e_AVATAR_DEFAULT.$curVal);
if(!$curVal)
{
@@ -433,7 +435,7 @@ class e_form
foreach($avFiles as $fi)
{
$img_path = $tp->thumbUrl(e_AVATAR_DEFAULT.$fi['fname'],$attr,true);
$img_path = $tp->thumbUrl(e_AVATAR_DEFAULT.$fi['fname']);
$text .= "\n<a class='e-expandit' title='Choose this avatar' href='#{$optioni}'><img src='".$img_path."' alt='' onclick=\"insertext('".$fi['fname']."', '".$idinput."');document.getElementById('".$previnput."').src = this.src;\" /></a> ";
//TODO javascript CSS selector
}

View File

@@ -772,9 +772,10 @@ if (e_QUERY == "update")
$text .= "<div class='fborder' style='text-align:center'><br />".str_replace("*", "<span class='required'>*</span>", LAN_USET_9)."<br />".LAN_USET_10."<br /><br /></div>";
}
// e107::scStyle($sc_style);
e107::getScBatch('usersettings')->setVars($curVal);
$text .= $tp->parseTemplate($USERSETTINGS_EDIT, TRUE, $usersettings_shortcodes);
$text .= $tp->parseTemplate($USERSETTINGS_EDIT, false, $usersettings_shortcodes);
$text .= "<div><input type='hidden' name='_uid' value='{$uuid}' /></div>