Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Gallery Widget

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

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

Page: 1
Go to End
Author Topic: 1321 Views
  • thbeh
    Avatar
    Community Member
    6 Posts

    Gallery Widget Link to this post

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

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Gallery Widget Link to this post

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

  • simon_w
    Avatar
    Forum Moderator
    471 Posts

    Re: Gallery Widget Link to this post

    I just downloaded the widget here and untared it fine.

  • Anatol
    Avatar
    126 Posts

    Re: Gallery Widget Link to this post

    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

    1321 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.