26

(12 replies, posted in Showkase Support)

Sure thing. You'll find my email address just below my username in the column to the left of this post. (You'll need to be logged into the forum see the Email link.)
Let me know the errors and send me your 'layout.tpl' file and I'll take a look. Thanks.

27

(12 replies, posted in Showkase Support)

Every valid web page should have a <head> section but not every web page has a 'footer'.
Showkase pages do, indeed, have a <head> section but they also have a <header> and <footer>.

I expect when Google says that their code should go in the header and footer that the code should be placed at the top and bottom of the web page respectively (i.e. in the <head> section and just before the closing </body> tag at the very end of the web page).

If you need your code to be placed inside Showkase's own <header> and <footer> sections (which not all web pages will have), then you can insert the code just after the opening <header> tag or just before the closing </footer> tag in the layout.tpl file.

I think the <head> section and the bottom of the <body> section would be fine, though.

28

(12 replies, posted in Showkase Support)

If you added the code to any of the HTML pages generated by Showkase, then you'd lose the code each and every time you republished your site (via the 'Publish' button).

However, you could add the code to a particular Showkase source file in order for the code to automatically be added to every HTML page that Showkase generates on publishing the site.

Open up your showkase/_themes/base/pagetypes/layout.tpl file in a plain text editor.
You can then add your code between the <head> ... </head> tags (if the code is to go in the <head> section) or just before the closing </body> tag (if that's where Google is recommending the code to go).

After re-uploading the modified layout.tpl file to its original location (overwriting the old version), your custom code will be included within every HTML file throughout your site each time the site is published (without needing to manually add it to any pages).

29

(12 replies, posted in Showkase Support)

The CMS is "Showkase". (The big 3 CMSs are Drupal, Joomla and WordPress but you're using Showkase.)

30

(1 replies, posted in Showkase Support)

That seems strange...
Dynamic properties were deprecated in PHP 8.2 (as noted here) so you should not be receiving this error message under PHP 8.0 or PHP 8.1.
Could you maybe double-check that the problem happens under PHP 8.0 and PHP 8.1?

The developers are aware of the problem and it should be resolved in the next release (although I do not know when this might be).
In the meantime, the workaround really ought to be to use either PHP 8.0 or PHP 8.1 (before dynamic properties were deprecated) or, indeed, any version of PHP from PHP 5.2.0 up to PHP 8.1.17 so please make sure that your web site is definitely using PHP 8.0 or PHP 8.1 rather than PHP 8.2 and let me know how you get on.
Thank you.

I have two buttons!

Nice! I'm glad you've got the functionality you need.
Thanks for the update.

You're welcome!

After rebuilding my gallery, I have just unzipped them to over write the new versions, and bingo the sort order is restored.

Good thinking! That'll work.

As a matter of interest, your multi-tread explanation does seem to fit. I couldn't replicate the problem on shared hosting today...

Yes, this theory does seem to make sense.

I have no doubt messing about with the showkase directories and content is generally a very bad idea and is frowned upon...

Not frowned upon... just not officially supported.
Having said that, if you really want a button to regenerate only images and don't want to create one yourself (I don't know how many source files would be involved) or wait to see if the developers introduce one, then you could maybe re-purpose the existing 'Rebuild' button to process only images by commenting out the lines of code which deal with regenerating the accompanying text files.

A couple of caveats:
(1) You'd no longer be able to use the 'Rebuild' button for its original purpose/full functionality.
(2) It would work only if no images are added to or removed from the gallery and if all filenames remain exactly the same. (I know you are aware of this. It's worth mentioning again, though, just in case anyone else is reading this.)

With this in mind, if you want to try it out, open your site's admin/commands/advanced.php file in a plain text editor and comment out (or remove) lines 77 to 86 (inclusive) and also lines 88 and 89. You can comment out lines of PHP code by adding // at the beginning, as follows:

// $page->gallery->saveGallery();
// Board::addMessage('Gallery xml file rebuilt');
// $pageSet->setPagesDataImageCount(
    // $pageIndex,
    // $page->getImageCount()
// );
// $pageSet->savePagesData();
// $pageSet->setPagesPref('publishing', 'unpublished');
// $pageSet->savePagesPrefs();
// Board::addMessage('Page data cache updated');
// $page->savePageHtml($pageSet, new Nav($pageFactory, $pageSet), new GalleryIndex($pageSet), new Smarty());
// Board::addMessage('Page html rebuilt');

Just re-upload the file after editing it (to its original location, overwriting the existing file). You might like to make a backup of the original file first (although you could always just extract the stock version of the file from the Showkase zip file if you need it).

This is untested and, being a source code modification, as far as I can take this in my capacity as official support.
I hope it points you in the right direction, though.

Email received. Thank you!

Thank you very much for all the effort you've gone to in documenting this issue.

After some extensive testing, I've been able to reproduce the problem and I've now seen this happen with not only galleries built with Lightroom but also with JuiceboxBuilder and Showkase itself.

It seems to be more noticeable in large galleries (e.g. 100 images or more) and happens more often than not when 'Site -> Customize Viewers -> Juicebox-Pro 1.5.1 -> Edit -> Pro Viewer Options -> Multi-size Images (Pro) -> Medium image resize' is selected (in conjunction with a change to 'Max width' and/or 'Max height').

Being that the image order after each 'Rebuild' seems random and that it seems to be more noticeable in large galleries (where there are a lot of images to process), it still looks like a result of multi-threading to me (with a lot of images being processed concurrently and not always finishing in the same order) but at least I've now got enough information to log a bug report with the developers (which I've just done).

Even if multi-threading is at the root of the problem, it would almost certainly be faster than sequential processing of images so it's likely to remain. Maybe the answer would be to re-order the images (perhaps to a default setting, e.g. filename order) after each rebuild which would be preferable to a random order. I'll leave it in the hands of the developers.

I've been trying to reproduce the problem you've described (rebuilding the gallery results in a random image order) but I've been unable to (on an Apache server).

I imported a Juicebox-Pro gallery with a custom image order and Showkase successfully imported the gallery and retained the custom image order and image titles and captions.

An initial 'Pages -> Edit Page -> Advanced -> Rebuild' rebuilt the gallery and changed the image order (to filename order) but retained image titles and captions.
All subsequent 'Pages -> Edit Page -> Advanced -> Rebuild' actions did not change anything at all.

I see your screenshots and don't doubt what you are experiencing but I don't know what's causing it.
I guess we're both using the same version of Showkase (v1.7.6) and you mentioned that you've seen the problem on an Apache server (which I was also using for testing) so other variables are the PHP installation/settings and the import gallery.

The import gallery shouldn't make a difference but if you like, you could send me the gallery (zip the gallery, upload the zip file somewhere and provide a link) and I'll try rebuilding it several times to see what happens. We should then perhaps be able to eliminate this from the equation (which would leave just PHP installation/settings as the main difference between your setup and mine).

My initial thought (regarding multi-threading) could still be possible but it's really difficult to troubleshoot an issue I can't reproduce.
I hope you can work around it.

It would really great if you could produce a 'script' that just regenerates the images.

Thank you for posting your request in the Feature Requests thread. I'm not the author of Showkase but the your request will definitely be seen by the developers over there.

36

(3 replies, posted in Showkase Support)

You're welcome!

37

(3 replies, posted in Showkase Support)

To add images to any existing gallery page:

(1) Edit the gallery page from the 'Pages' tab.
(2) Go to the 'Upload' tab.
(3) Drag and drop your new images into the upload module (in HTML 5 mode).
(4) Click the 'Start Upload' button and wait for the images to finish uploading.
(5) Click 'Publish' (or add captions on the 'Images' tab or sort the images on the 'Sort' tab first if you like).

(The Library is really just for individual images that you might want to use for a site logo or add to a Basic page.)

I hope that helps.

Thanks for the detailed description and screenshots.
So, in a nutshell, the issue is 'Pages -> Edit Page -> Advanced -> Rebuild' changes the images order (to a different order each time).

Here's my best guess at what's going on...

It certainly seems odd that a random image order would be obtained each time the gallery is rebuilt.
There's definitely no forced randomization going on (as far as I know) so my best guess is that the new image generation may be a multi-threaded process on the web server and Showkase adds each image to the gallery when its image generation is completed.
Multi-threading would certainly get the job done faster than a one-by-one sequential process and you can always sort the images afterwards on the Sort tab.
I don't know for sure if that's what's going on but it would be a possible explanation.

Incidentally, I'm pretty sure rebuilding a gallery was intended as a repair process (e.g. to reconstruct a corrupt XML file) rather than part of a gallery's import procedure.

You seem to have a good grasp of how Showkase works, though, so I hope you can find the workflow that works best for you.

Hmm.. I don't know what the image order was previously and I don't know what it is now (alphabetical, date order, random) so it's hard for me to know what might be happening.

I'm a little unclear as to all the steps you've taken to get your new images into your existing gallery.
Is there any chance you could list everything you did in order so that I can better understand the situation?
e.g.
(1) Re-uploaded 'large' images to an already imported gallery's source folder.
(2) Re-imported gallery to obtain a new imported gallery (with new images).
(3) Copied all image size files from the new imported gallery to the original imported gallery's 'images' directory.
(4) Deleted the new imported gallery (which was only created to generate new images in all sizes) via Showkase's interface (on the 'Pages' tab).

I'm not sure if this is exactly what you've done.
If it is, then I can't explain why the image order would have changed. The gallery's XML file which holds all the image data (including image order) would not have been modified.

With regard to image titles and captions, you could maybe embed them within your images as IPTC metadata so that the titles and captions are part of the images themselves and they travel with the images. Wherever the images go, their titles and captions go, too. Showkase can extract IPTC metadata (a limited subset but enough for titles and captions) for use as titles and captions. You can instruct Showkase to extract the IPTC title and/or IPTC description for all images at once.

Please see 'Editing Individual Captions' in the Pages section of the Showkase User Guide for details on how to extract the image's IPTC title and description.

There are some special codes that can be entered into titles, captions and descriptions:
{iptctitle} causes Showkase to look for embedded iptc metadata in the image and insert the contents of the title field if present.
{iptcdescription} is translated into the iptc description field if present.

If entering IPTC data via Adobe Photoshop, {iptctitle} corresponds to the IPTC 'Document Title' field and {iptcdescription} corresponds to the IPTC 'Description' field. I expect these labels will be the same for Lightroom (but I'm not 100% sure).

40

(2 replies, posted in Showkase Support)

It sounds like a caching problem: either client side (in your browser) or server side.
Caching can be very useful but it can also be a hindrance when developing a web site.

First of all, try completely clearing your browser's cache before reloading your gallery's web page to ensure that your browser is using the latest versions of all the files fresh from your web server (instead of older, cached versions).
Alternatively, try viewing your gallery's web page using a different browser (one that you have not used to view your gallery's web page before): Chrome, Edge, Firefox, Opera or Safari.

There is a chance that your web host uses server-side caching and even though Showkase is updating the files on your website, older versions of those file could still be served to browsers for a certain amount of time.

I have an account with a web host that uses Varnish server caching. After I upload a new version of a file to my web server, the new version is not seen (and the old version is still served) for about 20 minutes afterwards. For this reason, I have Varnish disabled.

Ask your web host if they have server-side caching enabled on your hosting account and, if so, ask if they could disable it.

If neither of the suggestions above help, then please post the link to your gallery's web page and let me know what you see and what you expect to see.
I'll take a look myself, let you know what I see and hopefully figure out what the problem is.
Thank you.

41

(4 replies, posted in Showkase Support)

I still don't know the exact cause of your problems but it appears that you've been able to sort things out which is good.

Avoiding any manual edits to the Showkase directory (making sure everything is done within the Showkase interface) should prevent things from breaking.

Also, when importing a gallery, upload the gallery folder to somewhere outside the Showkase directory if possible.
If this is not possible (e.g. your Showkase directory is your web server root directory), then create an 'import' folder (use a name that Showkase is not already using for a page folder name), upload your gallery folder to this new folder and import the gallery from there. This will allow Showkase to give the imported gallery folder the same name as the original gallery folder (as the two gallery folders will not be in the same directory) which might be less confusing than seeing a lot of folders with -2, -3, etc. suffixes. Also, it'll not matter whether or not you delete gallery folders after import as they'll all be in the 'import' folder which Showkase will have no knowledge about.

Incidentally, I've installed the Attachment extension to the forum so you should be able to add images to posts now.

I hope all goes well with the fixup.

42

(4 replies, posted in Showkase Support)

I'm sorry to hear about your troubles with Showkase and that you were unable to upload a screenshot. (The best thing to do would be to just upload the screenshot elsewhere (e.g. Dropbox, Google Drive, your website) and provide a link.)

I think a mismatch between Showkase's page records and the actual contents in the Showkase directory is the most likely cause of this.

Have you ever deleted any galleries manually or renamed any gallery folders (via FTP) rather than using the Showkase interface?
If so, then Showkase would expect the gallery folders to be present (the galleries would still be listed in Showkase's page records) and might try to recreate them on a subsequent publish.

Also, if you have ever uploaded a gallery folder (via FTP) to the Showkase directory to import into that particular Showkase site, then have you ever forgotten to delete the gallery folder afterwards?

I'm not sure what else would cause such a problem.

When importing galleries, I'd recommend not uploading them to the Showkase directory to which they will be imported. Showkase would be forced to rename the imported gallery folder (as the original gallery folder would be there during import) and it might be confusing, at a glance, to know which folders within the Showkase directory are actually part of the Showkase site and which are not.
It's a good idea not to modify anything within the Showkase folder manually (via FTP)
I'm not suggesting that you are doing this (I simply don't know) but it's just a general tip for anyone reading this.

If you still need to sort things out, then first of all, I'd recommend taking a complete backup of your site, just in case anything further goes wrong and you need to reinstate your current files at a later date.

With a full backup in hand, try sorting the pages out on the 'Pages' tab (deleting whatever galleries you do not want) and then go to 'System -> Repairs -> Repair' to rebuild the page records.

If this does not help, then you could perhaps create a new Showkase site (in a separate directory from your original site) and then import the pages/galleries that you need from your original site (via 'Site -> Import').

You can retain the Showkase settings from your original site by manually copying the following files and folders from your original site to your new site (overwriting the default versions which will be in place after a fresh install).

  • _data/sitedata (folder)

  • _data/themedata (folder)

  • _data/pagesprefs.txt (file)

  • _data/theme.txt (file)

Do not copy the _data/pagesdata.txt file though, as this lists the pages present in each site (which will be different after a fresh install).

If you use a custom logo via an image stored in the library, for example, then you might also like to copy the _library folder from your original site to your new site.

If you have modified any Showakse source files or used the custom.css or custom.js files, then please remember that you will need to reinstate your customized files after a fresh install.

... after a site rebuild some of my galleries image order changed for no apparent reason...

I really do not know what might have caused this. A gallery's image order is stored in the gallery's 'config.xml' file and the file would have to be modified to change the image order. What I think might be happening is that the gallery you are looking at is one of the new phantom galleries which Showkase has recreated (from a missing or renamed gallery folder?) rather than the original gallery from which the phantom gallery was  based. Showkase might just see a folder of images and create the phantom gallery with no knowledge of the original gallery's image order.
It's just a guess (again, based on the assumption that a gallery folder might have been renamed or deleted manually via FTP).

I know this doesn't definitively pinpoint the cause of the problem or provide a quick and easy solution but I hope that my notes are at least able to shed some light on what might be happening.

43

(16 replies, posted in Showkase Support)

@petax

I'll glad the fix helped. Thank you for letting me know.

44

(16 replies, posted in Showkase Support)

That's good to hear. Thanks for testing!

I've notified the developers of this fix so it will be included in the next version (but I don't know when this might be).

Best wishes!

45

(16 replies, posted in Showkase Support)

Thank you, once again, for all the information that you have provided. It really does make troubleshooting that much easier.

I was instantly able to replicate the problem by setting thumbnail dimensions of 81 x 54 and I see that I overlooked a couple of other variables (cropHeight and cropWidth) that could potentially not be integers (where integers are required).

However, rather than changing their definitions in the code (like I did previously for deltaX and deltaY in my original fix), it might be better to ensure that all numeric variables are integers for the two functions that require integers, which will also cover the edge case of a user entering decimal values for thumbnail dimensions in the Showkase interface (which, ideally, should not happen but is technically possible).

So, here's a new fix.
From a fresh, unmodified 'thumbnail.php' file:

(1) Change line 110 from:

$imageDest = imagecreatetruecolor($thumbWidth, $thumbHeight);

... to:

$imageDest = imagecreatetruecolor((int)$thumbWidth, (int)$thumbHeight);

(2) Change line 116 from:

if (!imagecopyresampled($imageDest, $imageSrc, 0, 0, $deltaX, $deltaY, $thumbWidth, $thumbHeight, $cropWidth, $cropHeight)) {

... to:

if (!imagecopyresampled($imageDest, $imageSrc, 0, 0, (int)$deltaX, (int)$deltaY, (int)$thumbWidth, (int)$thumbHeight, (int)$cropWidth, (int)$cropHeight)) {

I hope this completely fixes the problem this time around.
Thanks again for your help and for reporting the problem in the first instance.

46

(16 replies, posted in Showkase Support)

That's strange.
I tested the fix with all three of your source images yesterday and all three images uploaded without issue.
I've just checked again today with 'Image2.jpg' from your most recent email and, again, it works without any errors or warnings at all.
(I've been testing with Showkase v1.7.6 under PHP 8.1.1.6.)

There must be some other difference between our setups that is causing the problem but not being able to replicate the problem makes troubleshooting difficult.

What version of PHP are you using? Is it PHP 8.1.0 or another version in the 8.1 branch?
Do you have any custom image sizes set within Showkase or are all image sizes defaults?
Do you have any other images that still fail (with the fix in place) that I can use to test with? Maybe I'll see a pattern in all the images that fail.

I'll keep looking at this but if you can provide any further information that might help me to pinpoint the problem (or replicate it), then that would be great.
Thanks.

47

(16 replies, posted in Showkase Support)

I have looked for your email address but I could not find it in the post.

That's odd. It should be located below my username to the left of each post.

Anyway, thank you for providing such a clear explanation of the problem and some source images.
I've been able to replicate the problem (it's due to the deprecation I noted above) and have formulated a fix.

Until the fix can be integrated into a new version of Showkase, here are the details:

(1) Open your Showkase site's admin/classes/thumbnail.php file in a plain text editor.

(2) Change line 83 from:

$deltaY = ($imageHeight - $cropHeight)/2;

... to:

$deltaY = (int)(($imageHeight - $cropHeight) / 2);

(3) Change line 88 from:

$deltaX = ($imageWidth - $cropWidth)/2;

... to:

$deltaX = (int)(($imageWidth - $cropWidth) / 2);

(4) Save the 'thumbnail.php' file with the changes above and re-upload it to your Showkase site's admin/classes/ folder, overwriting the existing 'thumbnail.php' file.

Thank you for bringing this to our attention and apologies for any inconvenience caused.

Incidentally, the line numbers above refer to the current version of Showakse (v1.7.6).

48

(16 replies, posted in Showkase Support)

Unfortunately, it looks like you've run into an issue which no-one has reported before (most likely due to this deprecation in PHP 8.1).

I've not been able to replicate the problem myself with a batch of test images running Showkase-Pro v1.7.6 under PHP 8.1.1.

You can find my email address in the column to the left of this post (just look for and click the word 'Email'). You'll need to be logged into the forum to see this.

I might be able to replicate the problem if I know the original dimensions of the source images that fail and your chosen resize dimension (but it would be better if I had access to the images that fail).

Please email me the images that fail if you can and I'll follow this up as soon as possible.
Thank you.

49

(16 replies, posted in Showkase Support)

@MBene

Could you confirm if that could be the problem...

The only version of Showkase which is fully compatible with PHP 8.0 and 8.1 is the latest version (Showkase v1.7.6) so the use of Showkase v1.7.3 under PHP 8.0/8.1 could be the problem (though I can't be 100% sure).
Are you able to check your web server logs and browser developer tools console to see if you can find any warning or error messages that would give a reason for the problem? If we know exactly what the problem is, we'd have a better chance of figuring out how to fix it.

I'd certainly recommend upgrading Showkase to see if this resolves the issue.
Instructions for upgrading Showkase can be found here.

Upgrading is essentially just a case of uploading the new Showkase source files on top of the existing installation so it should be a fairly quick and easy (and risk-free) process. You should not lose any custom data or pages (only source files are overwritten). (See link above for full details.) Having said, that, I'd strongly recommend that you make a complete backup of your existing site first. Please check the notes below.

Notes:

(1) When upgrading your Showkase site, please be sure to make a complete backup of your existing site first, just in case anything should go wrong and you need to reinstate your original files at a later date. You should not encounter any problems upgrading Showkase but it would be wise to have a backup of your site should anything unexpected happen. Also, if you have made manual customizations to any Showkase source files or have used your theme's custom.css or custom.js files, then please note that these will be overwritten when you upgrade and you'll need a backup in order to reinstate them afterwards.

(2) Please remember that Showkase-Standard comes bundled with Juicebox-Lite (the free version of Juicebox) so, if you have purchased Showkase-Standard and Juicebox-Pro separately, then after upgrading your Showkase site, you'll need to reinstate your Juicebox-Pro files by following the Installing Juicebox Pro instructions here.

(I included these notes are they might help others reading this thread. I know that you are a Showkase-Pro user and that Note #2 is not relevant to your case.)

I have sent you a new download link for your Showkase-Pro purchase so that you can download the latest version of Showkase (v1.7.6). (Download links always point towards the latest version rather than the version you purchased.)

I hope this helps but if you continue to experience difficulties, please post back to let me know (with further details of the problem, if possible) and I'll try to help further.
Thank you.

50

(3 replies, posted in Showkase Support)

You're welcome! I hope you get on well with Showkase.
You should hopefully find that Showkase is easy to install and use but if you run into any difficulties, just let me know and I'll do my best to help you out.