Skip to content

Commit

Permalink
fix a twitter profile image issue; add 'noq' param to {img} to preven…
Browse files Browse the repository at this point in the history
… tacking on &q=75 to twitter call for profile image
  • Loading branch information
dleffler committed Apr 29, 2018
1 parent 0bb2da5 commit 6f43b94
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion framework/modules/twitter/views/twitter/showall.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
<div class="tweet-content">
{if $config.showimage}
<div class="tweet-image">
{img src="`$item.image`" class="img-rounded" alt="tweet profile image"|gettext}
{img src="`$item.image`" class="img-rounded" alt="tweet profile image"|gettext noq=1}
{*{if $item.retweetedbyme}{img src="`$smarty.const.PATH_RELATIVE`framework/modules/twitter/assets/images/tweeted.png" style="position:relative;top:-16px;left:-58px;"}{/if}*}
</div>
{*{elseif $item.retweetedbyme}*}
Expand Down
31 changes: 18 additions & 13 deletions framework/plugins/function.img.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,33 +33,38 @@
* @param \Smarty $smarty
* @return string
*/
function smarty_function_img($params,&$smarty) {
$closing = (XHTML==1) ? ' />' : '>';
$id = (isset($params['id'])) ? ' id="'.$params['id'].'"' : '';
$alt = (isset($params['alt'])) ? ' alt="'.$params['alt'].'"' : '';
$title = (isset($params['title'])) ? ' title="'.$params['title'].'"' : '';
$class = (isset($params['class'])) ? ' class="'.$params['class'].'"' : '';
$style = (isset($params['style'])) ? ' style="'.$params['style'].'"' : '';
$rel = (isset($params['rel'])) ? ' rel="'.$params['rel'].'"' : '';
function smarty_function_img($params,&$smarty)
{
$closing = (XHTML == 1) ? ' />' : '>';
$id = (isset($params['id'])) ? ' id="' . $params['id'] . '"' : '';
$alt = (isset($params['alt'])) ? ' alt="' . $params['alt'] . '"' : '';
$title = (isset($params['title'])) ? ' title="' . $params['title'] . '"' : '';
$class = (isset($params['class'])) ? ' class="' . $params['class'] . '"' : '';
$style = (isset($params['style'])) ? ' style="' . $params['style'] . '"' : '';
$rel = (isset($params['rel'])) ? ' rel="' . $params['rel'] . '"' : '';
if (isset($params['square']) && (!isset($params['w']) && !isset($params['h']))) {
$params['w'] = $params['square'];
$params['h'] = $params['square'];
} elseif (isset($params['square']) && $params['square'] == 'true' && !isset($params['w'])) {
$params['w'] = $params['h'];
}
// $dims = (isset($params['w']) && isset($params['h']) && isset($params['zc'])) ? ' height="'.$params['h'].'" width="'.$params['w'].'"' : '';
$dims = '';
if (isset($params['w']) && isset($params['h']) && isset($params['zc'])) {
$dims = ' height="'.$params['h'].'" width="'.$params['w'].'"';
$dims = '';
if (isset($params['w']) && isset($params['h']) && isset($params['zc'])) {
$dims = ' height="' . $params['h'] . '" width="' . $params['w'] . '"';
// } elseif (isset($params['w']) && isset($params['h'])) {
// $dims = ' height="'.$params['h'].'" width="'.$params['w'].'"';
// } elseif (isset($params['w'])) {
// $dims = ' width="'.$params['w'].'"';
// } elseif (isset($params['h'])) {
// $dims = ' height="'.$params['h'].'"';
}
}

if (!isset($params['q']) && defined('THUMB_QUALITY')) $params['q'] = THUMB_QUALITY;
if (!isset($params['q']) && defined('THUMB_QUALITY'))
$params['q'] = THUMB_QUALITY;
if (isset($params['noq'])) {
unset($params['q'], $params['noq']);
}

if (empty($params['fulllink']) && !EXPORT_AS_PDF === 1) {
$src = PATH_RELATIVE.'thumb.php?';
Expand Down

0 comments on commit 6f43b94

Please sign in to comment.