I'm using this plugin for many pages in many many configurations and never had problems. Works with no problems with i18n special pages 1.3.5 and GS 3.3.12 or newer
(2018-04-25, 19:21:00)ChronosMe1 Wrote: Hello! There is a problem with SSL. If I add HTTPS in the settings, then the thumbnails disappear. And I can not add new pictures.
I think the problem is somewhere in the validator.php.
Enable debuging mode in GS define('GSDEBUG', true);
Try to open thumbnail url in browser, and see what is happening.
2018-04-26, 00:41:17 (This post was last modified: 2018-04-26, 03:22:10 by ChronosMe1.)
(2018-04-25, 23:29:18)mganko Wrote:
(2018-04-25, 19:21:00)ChronosMe1 Wrote: Hello! There is a problem with SSL. If I add HTTPS in the settings, then the thumbnails disappear. And I can not add new pictures.
I think the problem is somewhere in the validator.php.
Enable debuging mode in GS define('GSDEBUG', true);
Try to open thumbnail url in browser, and see what is happening.
If I enable debugging mode, this only works on the site, not on the admin area.
Pictures open normally. They are not visible only inside the editing page.
Here is an example: if I output direct links in the listing of pages (see attachments), pictures are available. If I open edit page, there are no pictures.
If I change https to http in settings/website URL, everything is fine.
If I open thumbnail url: https://vashdom-kazan.ru/plugins/SpecialPagesExtras/thumb/?mode=image-field-thumb&img=https%3A%2F%2Fvashdom-kazan.ru%2Fdata%2Fuploads%2Fworks%2Fwrk9.jpg
he says "Wrong path"
UPDATE: Almost found the reason. The problem is in the validator.php file in function findImagePath ($url).
if ($pathParts['filename'] == 'changedata') //while saving page or while validating by ajax
$subDir = substr($pathParts['dirname'], 0, strrpos($pathParts['dirname'], $GSADMIN)); //find page subdir
else
$subDir = substr($pathParts['dirname'], 0, strpos($pathParts['dirname'], $pluginsDirPart.'SpecialPagesExtras')); //find page subdir
$siteHost = http_protocol()."://". $host;
//delete site host and subdir and data from image url
if ( substr($url, 0, strlen($siteHost.$subDir.$dataDirPart) ) == $siteHost.$subDir.$dataDirPart) {
$path = substr($url, strlen($siteHost.$subDir.$dataDirPart));
}
else if (substr($url, 0, strlen($subDir.$dataDirPart) ) == $subDir.$dataDirPart){ //if its root relative (ex. /data/uploads/image.jpg)
$path = substr($url, strlen($subDir.$dataDirPart));
}
else{ //wrong path, not full and root relative
return false;
}
(2015-03-11, 23:51:02)shawn_a Wrote: nono use foreach much easier to write and read, and faster then counting each iteration ( and your missing quotes )
2018-08-10, 01:38:54 (This post was last modified: 2018-08-10, 01:43:54 by vanfruniken.)
(2018-08-07, 23:42:03)linden Wrote:
(2015-03-11, 23:51:02)shawn_a Wrote: nono use foreach much easier to write and read, and faster then counting each iteration ( and your missing quotes )
As far as I can tell (GS 3.3.13), the thumbnails that I have in /GS/data/uploads/path-to-imageFile/$imageFileName are automatically generated, and they can be found in two sizes:
as /GS/data/thumbs/path-to-imageFile/{'thumbnail.'$imageFileName} (200x200)
and as /GS/data/thumbs/path-to-imageFile/{'thumbsm.'$imageFileName} (48x48)
Up to you to generate the proper $thumbnail string for each $image. Probably better to store only 'path-to-imageFile/$imageFileName' in your special fields.
(2015-03-11, 23:51:02)shawn_a Wrote: nono use foreach much easier to write and read, and faster then counting each iteration ( and your missing quotes )
As far as I can tell (GS 3.3.13), the thumbnails that I have in /GS/data/uploads/path-to-imageFile/$imageFileName are automatically generated, and they can be found in two sizes:
as /GS/data/thumbs/path-to-imageFile/{'thumbnail.'$imageFileName} (200x200)
and as /GS/data/thumbs/path-to-imageFile/{'thumbsm.'$imageFileName} (48x48)
Up to you to generate the proper $thumbnail string for each $image. Probably better to store only 'path-to-imageFile/$imageFileName' in your special fields.
Thanks but i forgot to mention that i am using "Multi image field" and also I dont know PHP
So I would greatly appreciate an example if anyone could help me.
2018-08-16, 18:57:04 (This post was last modified: 2018-08-16, 19:07:25 by vanfruniken.)
(2018-08-11, 21:51:44)linden Wrote: Thanks but i forgot to mention that i am using "Multi image field" and also I dont know PHP
So I would greatly appreciate an example if anyone could help me.
Let me rephrase more precisely, with proper php syntax:
As far as I can tell (GS 3.3.13), thumbnails for each image, which should be located at
$image = '/GS/data/' . 'uploads/' . $path_to_imageFile . $imageFileName
are automatically generated in two sizes:
- either (as 200x200) $thumbnail = '/GS/data/' . 'thumbs/' . $path_to_imageFile . 'thumbnail.' . $imageFileName
- or (as 48x48) $thumbnail = '/GS/data/' . 'thumbs/' . $path_to_imageFile . 'thumbsm.' . $imageFileName
Up to you to extract the proper $path_to_imageFile and $imageFileName for each $image from your "Multi image field".
If you did store the complete $image in your "Multi image field", then
$thumbnail can be derived from $image by
- first replacing
'/data/uploads/' with '/data/thumbs/'
i.e.,
$partiallyFixedPath = str_replace('data/uploads/','data/thumbs',$image);
and
- also replacing
$imageFileName with 'thumbnail.' . $imageFileName or 'thumbsm.' . $imageFileName
i.e.,
$imageFileName = pathinfo($image)['basename'];
$thumbnail = str_replace($imageFileName,'thumbnail.'.$imageFileName,$partiallyFixedPath);
or
$thumbnail = str_replace($imageFileName,'thumbsm.'.$imageFileName,$partiallyFixedPath);
I am not myself fluent with the special fields plugins, so I can't help with that kind of details.
Hope this helps.