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.

Archive /

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

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

Gallery Widget


Reply


4 Posts   1383 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, 5513 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
simon_w

Forum Moderator, 474 Posts

17 July 2008 at 5:41pm

I just downloaded the widget [url=http://www.silverstripe.com/Gallery-Widgets/]here[/url] 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