Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Gallery Widget


Go to End


4 Posts   1884 Views

Avatar
thbeh

Community Member, 6 Posts

16 July 2008 at 12:41pm

Hi, I have managed to download the Gallery Widget but it cannot be unzipped. Please advice. Thank you.

Avatar
Willr

Forum Moderator, 5523 Posts

17 July 2008 at 5:25pm

I cant untar it ether. Must be a corrupted zip. The author of the widget needs to submit a updated version.

Avatar
(deleted)

Community Member, 473 Posts

17 July 2008 at 5:41pm

I just downloaded the widget here and untared it fine.

Avatar
Anatol

126 Posts

8 August 2008 at 12:54pm

Edited: 08/08/2008 12:54pm

Hi,

The current gallery widget in the download section is just a tar file (not .tar.gz). On Linux/Unix untar with

tar -xvf widgetsgallery.tar.gz

instead of

tar -zxvf widgetsgallery.tar.gz

But it would be nice to have a proper .tar.gz version.

I also noticed one bug in the Gallery Widget (this applies only if used on a Linux server). In the file LatestPicturesWidget.php find the line

$pictures = DB::query("SELECT f.`ID`, f.`Filename`, f.`Name`, f.`Title`, s.`URLSegment` FROM `gallerypage_live` g LEFT JOIN `sitetree_live` s ON g.`ID` = s.`ID` LEFT JOIN `file` f ON f.`ParentID` = g.`FolderID` WHERE f.`ClassName` = 'Image' ORDER BY f.`Created` DESC LIMIT 0,$nrtoshow;");

and replace it with

$pictures = DB::query("SELECT f.`ID`, f.`Filename`, f.`Name`, f.`Title`, s.`URLSegment` FROM `GalleryPage_Live` g LEFT JOIN `SiteTree_Live` s ON g.`ID` = s.`ID` LEFT JOIN `File` f ON f.`ParentID` = g.`FolderID` WHERE f.`ClassName` = 'Image' ORDER BY f.`Created` DESC LIMIT 0,$nrtoshow;");

On Unix systems MySQL table names are case sensitive so you get a MySQL error message and the page is not rendered.

I once had a similar problem when I developed a Silverstripe site on a Windows machine and then uploaded it to a Linux server. The problem here was the database dump that had all table names in lower case. It's quite easy to fix, but it's good to know about this possible pitfall.

Cheers!
Anatol