Skip to content

Commit

Permalink
Fixed admin thumbnail src
Browse files Browse the repository at this point in the history
  • Loading branch information
JoomShaper committed Nov 2, 2015
1 parent 88365ed commit da635d2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
14 changes: 7 additions & 7 deletions plugins/system/fields/spgallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,22 +37,22 @@ protected function getInput()
$output .= '<ul class="sp-gallery-items clearfix">';

if(count($values)) {
foreach ($values as $key => $src) {
foreach ($values as $key => $value) {

$data_src = $src;
$data_src = $value;

$src = JURI::root(true) . '/' . $src;
$src = JURI::root(true) . '/' . $value;

$basename = basename($src);

$thumbnail = JPATH_ROOT . '/' . dirname($src) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
$thumbnail = JPATH_ROOT . '/' . dirname($value) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
if(file_exists($thumbnail)) {
$src = JURI::root(true) . '/' . dirname($src) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
$src = JURI::root(true) . '/' . dirname($value) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
}

$small_size = JPATH_ROOT . '/' . dirname($src) . '/' . JFile::stripExt($basename) . '_small.' . JFile::getExt($basename);
$small_size = JPATH_ROOT . '/' . dirname($value) . '/' . JFile::stripExt($basename) . '_small.' . JFile::getExt($basename);
if(file_exists($small_size)) {
$src = JURI::root(true) . '/' . dirname($src) . '/' . JFile::stripExt($basename) . '_small.' . JFile::getExt($basename);
$src = JURI::root(true) . '/' . dirname($value) . '/' . JFile::stripExt($basename) . '_small.' . JFile::getExt($basename);
}

$output .= '<li data-src="' . $data_src . '"><a href="#" class="btn btn-mini btn-danger btn-remove-image">Delete</a><img src="'. $src .'" alt=""></li>';
Expand Down
10 changes: 5 additions & 5 deletions plugins/system/fields/spimage.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ protected function getInput()
$output .= '<div class="sp-image-upload-wrapper">';

if($this->value) {
$data_src = $this->value;
$src = JURI::root(true) . '/' . $data_src;

$src = $data_src = $this->value;

$basename = basename($src);
$thumbnail = JPATH_ROOT . '/' . dirname($src) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
$basename = basename($data_src);
$thumbnail = JPATH_ROOT . '/' . dirname($data_src) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);

if(file_exists($thumbnail)) {
$src = JURI::root(true) . '/' . dirname($src) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
$src = JURI::root(true) . '/' . dirname($data_src) . '/' . JFile::stripExt($basename) . '_thumbnail.' . JFile::getExt($basename);
}

$output .= '<img src="'. $src .'" data-src="' . $data_src . '" alt="">';
Expand Down

0 comments on commit da635d2

Please sign in to comment.