splittingred / gallery Goto Github PK
View Code? Open in Web Editor NEWA Gallery add-on for MODx Revolution.
Home Page: http://svn.modxcms.com/docs/display/ADDON/Gallery
A Gallery add-on for MODx Revolution.
Home Page: http://svn.modxcms.com/docs/display/ADDON/Gallery
Currently (modx 2.0.0 pl and gallery 1.0.0 rc1) you have to "right click" an album and choose "Update Album" to edit. There is currently no action on "left click" except that the background color changes. Could "Update Album" be the default "left-click" action?
I have two requests/suggestions
Otherwise, good work, thank you!!
I had a website on Revo 2.0.0 working correctly with the Gallery tool. As I then began to upgrade the 2.0.3, then 2.0.4, the file manager stopped working correctly. After much discussion on the modx forum, it came out that MODx was not the issue, but the Gallery tool. For some reason, the folders that I stored images in that I used for my batch loading into the Gallery could no longer be opened by the file manager. I would get the error ""Please specify a valid directory"" and it would cause the tree structure to close. As this is a problem with a live site, and I have an unhappy client, I would appreciate it if this could be looked at. Thanks.
A few of the images I've added to albums need the thumbnail updated. One seems to have had an issue with the original generation of the thumbnail image and I'd like to re-do it, and other images I've had to delete and re-add because the original image used was the wrong one.
Even after deleting an image and re-adding it, the old thumbnail is still in use, and I want a way to fix/update/remove/refresh it.
I have tried looking for where these are stored so I can manually remove the old version but am having trouble doing this also.
[2010-11-04 19:27:13](ERROR @ /assets/components/gallery/connector.php) [Gallery] An error occurred while trying to remove the attachment file at: /home/medieste/public_html/assets/components/gallery/files/2010/11/untitled.png
Hi,
I've just installed 0.1.2 rc2 and discovered, that links to the thumbnails gets a double replacement. Instead of http://example.com/something?another&anything=1 it shows http://example.com/something?another&anything=1
I had to modify the galitem.class.php like this to get it correct:
case 'thumbnail':
$value = $this->getPhpThumbUrl();
if (empty($format)) $format = array();
$format['src']= MODX_URL_SCHEME.MODX_HTTP_HOST.$this->xpdo->getOption('gallery.files_url').$this->get('filename');
$url = $value.'?'.http_build_query($format);
//$value = str_replace('&','&',$url); // This has to be removed.
$value = $url;
break;
Best regards,
sewid
Hi!
In assets/components/gallery/js/mgr/widgets/home.panel.js on line 18 hardcoded title: 'Albums'.
Russian translation here http://dl.dropbox.com/u/3483977/russian.translation.gallery.011pl.zip
In translation i used 'gallery.albums' for hardcoded Albums.
I was wondering if we could have the following features included in the next release/update of the Rev Gallery. The ability to have multiple galleries shown using &album=1,2,3,4
and the all option &album=all
. I think this would be a nice feature that many users would appreciate.
Thanks,
Rossco
*original request - http://modxcms.com/forums/index.php/topic,55871.0 *
In a getResources call with a template containing [[+tv.GalleryItemTV]], the resulting output is the raw Gallery JSON from the output filter:
{"gal_src":"...","gal_id":1,"gal_name":"...","gal_description":"...","gal_image_width":"150","gal_image_height":"150","gal_orig_width":300,"gal_orig_height":360,"gal_album":"1","gal_watermark-text":"","gal_watermark-text-position":"BL","gal_other":"","gal_rotate":"0","gal_sizer":"50","gal_cropCoords":"","gal_cropTop":0,"gal_cropRight":0,"gal_cropBottom":0,"gal_cropLeft":0}
I'm not sure if this is by design (MODx Core) or perhaps a limitation of getResources (ADDON), so I decided to start here since Gallery is the only working example I have seen this happen with to date.
The expected output would have been the HTML tag from the output filter. Are there any options to simply return the phpthumb URL from the output filter if you wanted to customize the way GalleryItemTV is used?
It will be nice to grab a random image (or thumb) from an album (or all albums).
Couple of issues here. I've noticed that some gallery template variable values include the FQDN in the "gal_src" property, eg "http://mydomain.com/assets/components/gallery/files/xxxx.jpg"). This makes it very hard to move a MODx install using Gallery to a different domain.
The other problem is the paths stored in the system_settings table. These are all absolute file system paths and there's no way to change these other than updating the DB directly.
Some of my clients have alot of images to upload into galleries. In the long run being able to upload a ZIP-file or something like that would probably be the best option I think (as it doesn't require any explanation). Is this a possibility that could be researched for future use?
I'd tryed this code:
http://paste.org/pastebin/view/23532
But there is items from gallery1 twice.
Hi,
I just finished the french translation of gallery 1.0.0 pl, it would be great to include it on next releases,
Thanks,
in the manager update album-view:
Options to sort the images (name, creatondate,... ASC and DESC)
this way , when you have a lot of images, it is easier to lookup an image and update it.
The cache continues to increase in size (phpthumb creates new cache images) every time someone views a gallery). CentOS 5.5, Apache 2.2.3, php 5.2.10, mysql 5.0.77.
If i upload a foile with a space in the name, it succeed but the manager fail to show it in the album list
At the moment, {assets_path}images/ is filled in as per standard when I click "Batch upload". I would like to be able to change this to {base_path}images/.
Hi! When I go to the TV page of my resource the gallery TV is there, but I can't see any field to fill up. Is it normal? Or maybe there's something broken? I've also just posted another discussion about an error I get by Firebug.
update image folder,
I automaitcally add images in my image folder through other sites.
So I need to update my albums.
I would like to use batch upload and point to the (existing) folder.
but then it overrides the old entries and I loose the tag information.
any way to let it check wether the the images are allready inthere an if they are, not to update so the tags are kept?
Hi,
the linebreaks in galItemThumb have to be removed, to get valid html.
It has to look like this:
<img class="[[+imgCls]]" src="[[+thumbnail]]" alt="[[+name]]" />
</a>
</div>
Best regards,
sewid
Hi I am trying to recreate one of the examples(nr3)
But I can't seem to find the calls [[ ... ]] made to produce that example.
I think it might be a good Idea to include them in the examples.
That way I could get a good understanding of how it works as wel as recreate it and adjust to my needs:
(only the names instead of the thumbs and more of them on the left...)
Updated russian translation for Gallery 1.0.0-rc1
http://dl.dropbox.com/u/3483977/modx/russian.translation.gallery.100rc1.zip
Bulk upload of a ZIP archive which will be automatically extracted after upload would be a nice feature.
Something like values between 0 and 5, with default to 2. In this way you can define which css-file you want to use by something like "galleriffic-[paramter].css" or wether you want to use your own (0 = don´t register any css file). So then it´s up to oneself to setup the correct css file and to position it in the correct order of other existing stylesheets in the html header. The last advantage is a problem in the current release.
Thanks Peter
Hello I'm working on a site in modx and came to the conclusion,
when I want multi-pull galleries for multi-pull pages it's not possible to filter the gallery list.
I was looking for tags for the galleries but didn't find any.
Grtz Stormbyte
I've called the Gallery as following:
[[Gallery?album=[[+album]]
&containerTpl=galleryContainerTpl
&thumbTpl=galleryThumbTpl
&thumbHeight=73
&useCss=false
&imageHeight=700
]]
But imageHeight doesn't do anything. Site is live @ www.your-identity.info.
Would be nice to specify the order they showed up within a gallery
I think the title says it all.
I have installed Gallery v1.0.1 rc1 and created a TV as directed in the documentation
I can see the gallery plugin on the resources that have been assigned the TV
When I go into the TV and click "Choose an Image" I get a window very similar to the modx file browser but the left column is empty. I expect to see the file tree and some controls (like an upload button).
I am therefore unable to upload or choose any images to put in a gallery!
A placeholder to link directly to an image, without passing it through phpThumb.
oops, accidentally closed it... mind reopening?
Greetings, I am using Gallery with ModX Revolution RC3 and seem to be unable to get the GalleryAlbums snippet to work. Both when implimenting it manually, and when using your example gallery code.
All other functions/snippets work fine, however GalleryAlbums just doesn't render anything. :(
If you use the gallery component in a context (subdomain), the images link to assets/... so they don't show in the subdomain.
There should be a possibility to link the images to the head domain or a separate folder in the subdomain.
The ampersands in the source of my thumbs and in my image-links are being outputted in invalid format (ampersand hasn't been converted to &). Is this a possibility? Thanks!
When trying to do a batch import from a directory already on the webserver it fails because it is trying to create a folder "2010/07/" in the gallery.files_path. I guess it fails because you can't have a / in the middle of a directoryname. Date is formatted this way because webserver has dutch date/time formatting.
Hi! If I click on Components/Gallery, nothing appears, and Firebug say me this:
'GAL is not defined'
manager?a=74 (row 25)
I'm using Revo 2.0.3-pl
After recently installing the gallery (version 1 RC1) into a fresh installation of ModX Rev 2.0PL
I get this error in the terminal
Workspace environment initiated, now installing package...
\n \n\n "[[+name]]"\n </a>\n</div>","locked":0,"properties":""} [guid] => 2ed0530fea465575b4be9f4c5ae20ac4 [native_key] => 1 [signature] => aa0347d9981f7a3c4ec6310aa3789c54 ) ) [Snippets] => Array ( [991566502d690f5c425d92a099d95ec9] => Array ( [preserve_keys] => [update_object] => 1 [unique_key] => name [class] => modSnippet [object] => {"id":0,"name":"Gallery","description":"","editor_type":0,"category":0,"cache_type":0,"snippet":"/\n * Gallery\n *\n * Copyright 2010 by Shaun McCormick \n *\n * Gallery is free software; you can redistribute it and/or modify it under the\n * terms of the GNU General Public License as published by the Free Software\n * Foundation; either version 2 of the License, or (at your option) any later\n * version.\n *\n * Gallery is distributed in the hope that it will be useful, but WITHOUT ANY\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n * A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License along with\n * Gallery; if not, write to the Free Software Foundation, Inc., 59 Temple\n * Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * @Package gallery\n */\n/\n * The main Gallery snippet.\n \n * @Package gallery\n */\n$gallery = $modx->getService('gallery','Gallery',$modx->getOption('gallery.core_path',null,$modx->getOption('core_path').'components/gallery/').'model/gallery/',$scriptProperties);\nif (!($gallery instanceof Gallery)) return '';\n\n/ setup default properties /\n$album = $modx->getOption('album',$scriptProperties,false);\n$plugin = $modx->getOption('plugin',$scriptProperties,'');\n$tag = $modx->getOption('tag',$scriptProperties,'');\n$limit = $modx->getOption('limit',$scriptProperties,0);\n$start = $modx->getOption('start',$scriptProperties,0);\n$sort = $modx->getOption('sort',$scriptProperties,'rank');\n$sortAlias = $modx->getOption('sortAlias',$scriptProperties,'galItem');\nif ($sort == 'rank') $sortAlias = 'AlbumItems';\n$dir = $modx->getOption('dir',$scriptProperties,'ASC');\n$showInactive = $modx->getOption('showInactive',$scriptProperties,false);\n$linkToImage = $modx->getOption('linkToImage',$scriptProperties,false);\n$imageGetParam = $modx->getOption('imageGetParam',$scriptProperties,'galItem');\n$albumRequestVar = $modx->getOption('albumRequestVar',$scriptProperties,'galAlbum');\n$tagRequestVar = $modx->getOption('tagRequestVar',$scriptProperties,'galTag');\n$itemCls = $modx->getOption('itemCls',$scriptProperties,'gal-item');\n\n/ check for REQUEST vars if property set _/\nif ($modx->getOption('checkForRequestAlbumVar',$scriptProperties,true)) {\n if (!empty($_REQUEST[$albumRequestVar])) $album = $_REQUEST[$albumRequestVar];\n}\nif ($modx->getOption('checkForRequestTagVar',$scriptProperties,true)) {\n if (!empty($_REQUEST[$tagRequestVar])) tags
');\n$c->innerJoin('galAlbumItem','AlbumItems');\n$c->innerJoin('galAlbum','Album',$modx->getSelectColumns('galAlbumItem','AlbumItems','',array('album')).' = '.$modx->getSelectColumns('galAlbum','Album','',array('id')));\n\n/* pull by album /\nif (!empty($album)) {\n $albumField = is_numeric($album) ? 'id' : 'name';\n\n $albumWhere = $albumField == 'name' ? array('name' => $album) : $album;\n $album = $modx->getObject('galAlbum',$albumWhere);\n if (empty($album)) return '';\n $c->where(array(\n 'Album.'.$albumField => $album->get($albumField),\n ));\n $galleryId = $album->get('id');\n $galleryName = $album->get('name');\n $galleryDescription = $album->get('description');\n unset($albumWhere,$albumField);\n}\nif (!empty($tag)) { / pull by tag /\n $c->innerJoin('galTag','Tags');\n $c->where(array(\n 'Tags.tag' => $tag,\n ));\n if (empty($album)) {\n $galleryId = 0;\n $galleryName = $tag;\n $galleryDescription = '';\n }\n}\n$c->where(array(\n 'galItem.mediatype' => $modx->getOption('mediatype',$scriptProperties,'image'),\n));\nif (!$showInactive) {\n $c->where(array(\n 'galItem.active' => true,\n ));\n}\n\n$c->sortby($sortAlias.'.'.$sort,$dir);\nif (!empty($limit)) $c->limit($limit,$start);\n$items = $modx->getCollection('galItem',$c);\n\n/ load plugins /\nif (!empty($plugin)) {\n if (($className = $modx->loadClass('gallery.plugins.'.$plugin,$gallery->config['modelPath'],true,true))) {\n $plugin = new $className($gallery,$scriptProperties);\n $plugin->load();\n $scriptProperties = $plugin->adjustSettings($scriptProperties);\n }\n} else {\n if ($modx->getOption('useCss',$scriptProperties,true)) {\n $modx->regClientCSS($gallery->config['cssUrl'].'web.css');\n }\n}\n\n/ iterate /\n$output = '';\nforeach ($items as $item) {\n $itemArray = $item->toArray();\n $itemArray['cls'] = $itemCls;\n $itemArray['filename'] = basename($item->get('filename'));\n $itemArray['image_absolute'] = $modx->getOption('gallery.files_url').$item->get('filename');\n $itemArray['filesize'] = $item->get('filesize');\n $itemArray['thumbnail'] = $item->get('thumbnail',array(\n 'w' => (int)$modx->getOption('thumbWidth',$scriptProperties,100),\n 'h' => (int)$modx->getOption('thumbHeight',$scriptProperties,100),\n 'zc' => (boolean)$modx->getOption('thumbZoomCrop',$scriptProperties,1),\n 'far' => (boolean)$modx->getOption('thumbFar',$scriptProperties,'C'),\n ));\n $itemArray['image'] = $item->get('thumbnail',array(\n 'w' => (int)$modx->getOption('imageWidth',$scriptProperties,500),\n 'h' => (int)$modx->getOption('imageHeight',$scriptProperties,500),\n 'zc' => (boolean)$modx->getOption('imageZoomCrop',$scriptProperties,false),\n 'far' => (string)$modx->getOption('imageFar',$scriptProperties,''),\n ));\n if (!empty($album)) $itemArray['album'] = $album->get('id');\n if (!empty($tag)) $itemArray['tag'] = $tag;\n $itemArray['linkToImage'] = $linkToImage;\n $itemArray['imageGetParam'] = $imageGetParam;\n $itemArray['albumRequestVar'] = $albumRequestVar;\n $itemArray['tagRequestVar'] = $tagRequestVar;\n $itemArray['tag'] = '';\n\n $output .= $gallery->getChunk($modx->getOption('thumbTpl',$scriptProperties,'galItemThumb'),$itemArray);\n}\n\n$containerTpl = $modx->getOption('containerTpl',$scriptProperties,false);\nif (!empty($containerTpl)) {\n $ct = $gallery->getChunk($containerTpl,array(\n 'thumbnails' => $output,\n 'album_name' => $galleryName,\n 'album_description' => $galleryDescription,\n ));\n if (!empty($ct)) $output = $ct;\n}\n\n$toPlaceholder = $modx->getOption('toPlaceholder',$scriptProperties,false);\nif (!empty($toPlaceholder)) {\n $modx->toPlaceholders(array(\n $toPlaceholder => $output,\n $toPlaceholder.'.id' => $galleryId,\n $toPlaceholder.'.name' => $galleryName,\n $toPlaceholder.'.description' => $galleryDescription,\n ));\n} else {\n $placeholderPrefix = $modx->getOption('placeholderPrefix',$scriptProperties,'gallery.');\n $modx->toPlaceholders(array(\n $placeholderPrefix.'id' => $galleryId,\n $placeholderPrefix.'name' => $galleryName,\n $placeholderPrefix.'description' => $galleryDescription,\n ));\n return $output;\n}\nreturn '';","locked":0,"properties":"a:27:{s:5:"album";a:6:{s:4:"name";s:5:"album";s:4:"desc";s:80:"Will load only items from this album. Can be either the name or ID of the Album.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:3:"tag";a:6:{s:4:"name";s:3:"tag";s:4:"desc";s:35:"Will load only items with this tag.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:6:"plugin";a:6:{s:4:"name";s:6:"plugin";s:4:"desc";s:115:"The name of a plugin to use for front-end displaying. Please see the official docs for a list of available plugins.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:8:"thumbTpl";a:6:{s:4:"name";s:8:"thumbTpl";s:4:"desc";s:45:"The Chunk to use as a tpl for each thumbnail.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:12:"galItemThumb";s:7:"lexicon";N;}s:12:"containerTpl";a:6:{s:4:"name";s:12:"containerTpl";s:4:"desc";s:40:"An optional chunk to wrap the output in.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:7:"itemCls";a:6:{s:4:"name";s:7:"itemCls";s:4:"desc";s:33:"The CSS class for each thumbnail.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:8:"gal-item";s:7:"lexicon";N;}s:13:"toPlaceholder";a:6:{s:4:"name";s:13:"toPlaceholder";s:4:"desc";s:101:"If set, will set the output to a placeholder of this value, and the snippet call will output nothing.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:10:"thumbWidth";a:6:{s:4:"name";s:10:"thumbWidth";s:4:"desc";s:49:"The width of the generated thumbnails, in pixels.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"100";s:7:"lexicon";N;}s:11:"thumbHeight";a:6:{s:4:"name";s:11:"thumbHeight";s:4:"desc";s:50:"The height of the generated thumbnails, in pixels.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"100";s:7:"lexicon";N;}s:13:"thumbZoomCrop";a:6:{s:4:"name";s:13:"thumbZoomCrop";s:4:"desc";s:50:"Whether or not the thumbnail will be zoom-cropped.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";N;}s:8:"thumbFar";a:6:{s:4:"name";s:8:"thumbFar";s:4:"desc";s:73:"The "far" value for phpThumb for the thumbnail, for aspect ratio zooming.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";s:1:"C";s:7:"lexicon";N;}s:11:"linkToImage";a:6:{s:4:"name";s:11:"linkToImage";s:4:"desc";s:64:"If true, will link directly to the image. If false, will append ";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:13:"imageGetParam";a:6:{s:4:"name";s:13:"imageGetParam";s:4:"desc";s:137:"The GET param to use when not linking directly to an image. Make sure this matches the getParam property in the GalleryItem snippet call.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:7:"galItem";s:7:"lexicon";N;}s:10:"imageWidth";a:6:{s:4:"name";s:10:"imageWidth";s:4:"desc";s:71:"If being used by a plugin, the width of the currently on-display image.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";i:500;s:7:"lexicon";N;}s:11:"imageHeight";a:6:{s:4:"name";s:11:"imageHeight";s:4:"desc";s:72:"If being used by a plugin, the height of the currently on-display image.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";i:500;s:7:"lexicon";N;}s:13:"imageZoomCrop";a:6:{s:4:"name";s:13:"imageZoomCrop";s:4:"desc";s:94:"If being used by a plugin, whether or not the currently on-display image will be zoom-cropped.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";N;}s:8:"imageFar";a:6:{s:4:"name";s:8:"imageFar";s:4:"desc";s:69:"The "far" value for phpThumb for the image, for aspect ratio zooming.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:4:"sort";a:6:{s:4:"name";s:4:"sort";s:4:"desc";s:28:"The field to sort images by.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:4:"rank";s:7:"lexicon";N;}s:3:"dir";a:6:{s:4:"name";s:3:"dir";s:4:"desc";s:32:"The direction to sort images by.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:3:"ASC";s:7:"lexicon";N;}s:5:"limit";a:6:{s:4:"name";s:5:"limit";s:4:"desc";s:53:"If set to non-zero, will only show X number of items.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";i:0;s:7:"lexicon";N;}s:5:"start";a:6:{s:4:"name";s:5:"start";s:4:"desc";s:108:"The index to start grabbing from when limiting the number of items. Similar to an SQL order by start clause.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";i:0;s:7:"lexicon";N;}s:12:"showInactive";a:6:{s:4:"name";s:12:"showInactive";s:4:"desc";s:43:"If true, will also display inactive images.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";N;}s:23:"checkForRequestAlbumVar";a:6:{s:4:"name";s:23:"checkForRequestAlbumVar";s:4:"desc";s:99:"If true, if a REQUEST var of "album" is found, will use that as the album property for the snippet.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";N;}s:15:"albumRequestVar";a:6:{s:4:"name";s:15:"albumRequestVar";s:4:"desc";s:106:"If checkForRequestAlbumVar is set to true, will look for a REQUEST var with this name to select the album.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:8:"galAlbum";s:7:"lexicon";N;}s:21:"checkForRequestTagVar";a:6:{s:4:"name";s:21:"checkForRequestTagVar";s:4:"desc";s:95:"If true, if a REQUEST var of "tag" is found, will use that as the tag property for the snippet.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";N;}s:13:"tagRequestVar";a:6:{s:4:"name";s:13:"tagRequestVar";s:4:"desc";s:102:"If checkForRequestTagVar is set to true, will look for a REQUEST var with this name to select the tag.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:6:"galTag";s:7:"lexicon";N;}s:6:"useCss";a:6:{s:4:"name";s:6:"useCss";s:4:"desc";s:109:"If true, will use the CSS provided by the Gallery snippet. Set to false to not load any Gallery-provided CSS.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";N;}}","moduleguid":""} [guid] => 1cad30a27c06fdf2f1a791a7a44ff01a [native_key] => 0 [signature] => 213ed368b552ddd2ab68f3aaf968cb4f ) [c896f183dbd1de9d242651267301ada2] => Array ( [preserve_keys] => [update_object] => 1 [unique_key] => name [class] => modSnippet [object] => {"id":1,"name":"GalleryAlbums","description":"","editor_type":0,"category":0,"cache_type":0,"snippet":"/\n * Gallery\n *\n * Copyright 2010 by Shaun McCormick \n *\n * Gallery is free software; you can redistribute it and/or modify it under the\n * terms of the GNU General Public License as published by the Free Software\n * Foundation; either version 2 of the License, or (at your option) any later\n * version.\n *\n * Gallery is distributed in the hope that it will be useful, but WITHOUT ANY\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n * A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License along with\n * Gallery; if not, write to the Free Software Foundation, Inc., 59 Temple\n * Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * @Package gallery\n */\n/\n * Loads a list of Albums\n *\n * @Package gallery\n */\n$gallery = $modx->getService('gallery','Gallery',$modx->getOption('gallery.core_path',null,$modx->getOption('core_path').'components/gallery/').'model/gallery/',$scriptProperties);\nif (!($gallery instanceof Gallery)) return '';\n\n/ setup default properties /\n$rowTpl = $modx->getOption('rowTpl',$scriptProperties,'galAlbumRowTpl');\n$showInactive = $modx->getOption('showInactive',$scriptProperties,false);\n$prominentOnly = $modx->getOption('prominentOnly',$scriptProperties,true);\n$toPlaceholder = $modx->getOption('toPlaceholder',$scriptProperties,false);\n$sort = $modx->getOption('sort',$scriptProperties,'createdon');\n$dir = $modx->getOption('dir',$scriptProperties,'DESC');\n$limit = $modx->getOption('limit',$scriptProperties,10);\n$start = $modx->getOption('start',$scriptProperties,0);\n$parent = $modx->getOption('parent',$scriptProperties,0);\n$showAll = $modx->getOption('showAll',$scriptProperties,false);\n$albumRequestVar = $modx->getOption('albumRequestVar',$scriptProperties,'galAlbum');\n\n/ build query /\n$c = $modx->newQuery('galAlbum');\nif (!$showInactive) {\n $c->where(array(\n 'active' => true,\n ));\n}\nif ($prominentOnly) {\n $c->where(array(\n 'prominent' => true,\n ));\n}\nif (empty($showAll)) {\n $c->where(array(\n 'parent' => $parent,\n ));\n}\n$c->sortby($sort,$dir);\nif ($limit > 0) { $c->limit($limit,$start); }\n$albums = $modx->getCollection('galAlbum',$c);\n\n/ iterate /\n$output = '';\nforeach ($albums as $album) {\n $albumArray = $album->toArray();\n $albumArray['albumRequestVar'] = $albumRequestVar;\n $output .= $gallery->getChunk($rowTpl,$albumArray);\n}\n\nif ($toPlaceholder) {\n $modx->setPlaceholder($toPlaceholder,$output);\n return '';\n}\nreturn $output;","locked":0,"properties":"a:11:{s:6:"rowTpl";a:6:{s:4:"name";s:6:"rowTpl";s:4:"desc";s:36:"The Chunk to use for each album row.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:14:"galAlbumRowTpl";s:7:"lexicon";N;}s:4:"sort";a:6:{s:4:"name";s:4:"sort";s:4:"desc";s:33:"The field to sort the results by.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:9:"createdon";s:7:"lexicon";N;}s:3:"dir";a:6:{s:4:"name";s:3:"dir";s:4:"desc";s:37:"The direction to sort the results by.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:4:"DESC";s:7:"lexicon";N;}s:5:"limit";a:6:{s:4:"name";s:5:"limit";s:4:"desc";s:62:"If set to non-zero, will limit the number of results returned.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:2:"10";s:7:"lexicon";N;}s:5:"start";a:6:{s:4:"name";s:5:"start";s:4:"desc";s:39:"The index to start from in the results.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:1:"0";s:7:"lexicon";N;}s:13:"toPlaceholder";a:6:{s:4:"name";s:13:"toPlaceholder";s:4:"desc";s:67:"If not empty, will set the output to a placeholder with this value.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:0:"";s:7:"lexicon";N;}s:12:"showInactive";a:6:{s:4:"name";s:12:"showInactive";s:4:"desc";s:46:"If true, will show inactive galleries as well.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:0;s:7:"lexicon";N;}s:13:"prominentOnly";a:6:{s:4:"name";s:13:"prominentOnly";s:4:"desc";s:67:"If true, will only display albums marked with a "prominent" status.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";N;}s:6:"parent";a:6:{s:4:"name";s:6:"parent";s:4:"desc";s:54:"Grab only the albums with a parent album with this ID.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:1:"0";s:7:"lexicon";N;}s:7:"showAll";a:6:{s:4:"name";s:7:"showAll";s:4:"desc";s:57:"If true, will show all albums regardless of their parent.";s:4:"type";s:13:"combo-boolean";s:7:"options";s:0:"";s:5:"value";b:1;s:7:"lexicon";N;}s:15:"albumRequestVar";a:6:{s:4:"name";s:15:"albumRequestVar";s:4:"desc";s:106:"If checkForRequestAlbumVar is set to true, will look for a REQUEST var with this name to select the album.";s:4:"type";s:9:"textfield";s:7:"options";s:0:"";s:5:"value";s:8:"galAlbum";s:7:"lexicon";N;}}","moduleguid":""} [guid] => a7f8748bf544ce0bf94be33010583b29 [native_key] => 1 [signature] => 326f18f076490ffe31bc49468cf25688 ) [f7c3ca6960cd677544c101f34e0022d2] => Array ( [preserve_keys] => [update_object] => 1 [unique_key] => name [class] => modSnippet [object] => {"id":2,"name":"GalleryItem","description":"","editor_type":0,"category":0,"cache_type":0,"snippet":"/\n * Gallery\n *\n * Copyright 2010 by Shaun McCormick \n *\n * Gallery is free software; you can redistribute it and/or modify it under the\n * terms of the GNU General Public License as published by the Free Software\n * Foundation; either version 2 of the License, or (at your option) any later\n * version.\n *\n * Gallery is distributed in the hope that it will be useful, but WITHOUT ANY\n * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR\n * A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License along with\n * Gallery; if not, write to the Free Software Foundation, Inc., 59 Temple\n * Place, Suite 330, Boston, MA 02111-1307 USA\n *\n * @Package gallery\n */\n/\n * Display a single Gallery Item\n *\n * @Package gallery\n */\n$gallery = $modx->getService('gallery','Gallery',$modx->getOption('gallery.core_path',null,$modx->getOption('core_path').'components/gallery/').'model/gallery/',$scriptProperties);\nif (!($gallery instanceof Gallery)) return '';\n\n/ get ID of item _/\n$id = (int)$modx->getOption('id',$scriptProperties,false);\nif ($modx->getOption('checkForRequestVar',$scriptProperties,true)) {\n $getParam = $modx->getOption('getParam',$scriptProperties,'galItem');\n if (!empty($_REQUEST[$getParam])) {
Package found...now preparing to install.
Successfully installed package gallery-1.0.0-rc1
Error 23000 executing statement: INSERT INTO modx_categories
(parent
, category
) VALUES ('0', 'Gallery') Array ( [0] => 23000 [1] => 1062 [2] => Duplicate entry 'Gallery' for key 2 )
Language string not found: "gallery.menu_desc"
Attempting to install package with signature: gallery-1.0.0-rc1
After that, the chunks and snippets are not installed, but the component registered as having been installed. Missing " or ; perhaps??
Also I have tried this as both an upgrade from the earlier version and a fresh install of 1.0 RC1
I was wondering whether to try and do this myself, however wouldn't have a clue where to start with repackaging and working with the modx api at this time... Maybe with more time I could.
Basically, instead of uploading to the FTP, why not create a table for all images allowing for the following sizes:
micro
thumbnail
standard
large
Then using a file called img.php you call the image from the db using img.php?type=thumb&id=1, also allowing for mod rewrite img_thumb_1.jpg etc.
Configs to allow for the maximum sizes for each image size, I have built this in a non framework / non modx way if you would like to see an example, and I have a function which works with ImageMagick only, but happy to help where I can. :)
If you need any more information, please do let me know.
I know you mentioned that this was already being considered as a future feature, but thought I'd raise it here as well as it's something I would find really useful. I know phpThumb has watermarking features included in it so will possibly try going down that road but would love for it all to be included in Gallery =)
When developing a site locally using MAMP I have an url with a port number, http://localhost:8888/mysite. But when phpThumb looks for an image I have uploaded, the port number is ignored, like this; http://localhost/mysite/assets/component/gallery/files/2010/07/myimage.jpg.
This results in an error image served by phpThumb that tells me CURL is available but no data was returned.
Would be great if the user could click on an image in the gallery and be taken to a website or MODx page.
Hi,
in the current version (1.0.1 rc1), the phpthumb cache is not working for me. Neither on a windows dev environment, nor on my mac dev environment.
But: gallery is a great plugin! :-)
Best regards,
sewid
Sean - thanks for fixing the '&' -> '&' problem
Unfortunately the issue I flagged as a comment on that ticket is related, but is a different problem and still needs fixing.
In summary - I'm getting URL's like the following
http://axe/modx-2.0.0-rc-1/index.php?id=19?galAlbum=3
You can see the second '?' which should be a '&' this is an incorrectly formatted URL and results the page parameters being ignored.
The following text is a copy of my comment on the original ticket (#2) - it describes what still needs to be done to get Gallery working in a default MODx installation.
It can be worked around by editing pre-defined chunks galAlbumRowTpl and galItemThumb; and creating two custom chunks galItemAlbum and galItemTag. The purpose of these chunks is to swap '?' for '&'. I've added details into the Gallery 0.1.0 rc2 Support thread.
The '&' is needed if MODx is used in default configuration and '?' is needed is Search Engine Friendly URLs are being generated.
The fix is probably to create the URL's in the snippet; doing it in the chunk will be fairly verbose and prone to user error.
When we use the Gallery TV we can choose a previously uploaded image but cannot upload a new one ( if we do "update album" we exit the page and are redirected to a new one ). It will be so usefull if we could have an option to upload a new image from this view.
I usually try to use sane filenames but some images with apostrophes (single quotes) managed to slip into my gallery.
When these images are used in a resource (using the gallery TV), the filenames in the JSON fields are not escaped correctly, causing the JavaScript to break. This usually results in the "Template Variables" tab not rendering correctly, with most TV's unusable.
Cheers,
Phil
Capitalization of the extension makes Gallery ignore the files.
I think there's might be a bug with spaces in paths.
When i'm trying to upload an image to an album
(Components> Gallery> Album: SOMENAME > Upload Item).
i get an Error: 'An error occurred while trying to upload the item'.
the error log output:
(ERROR @ /modx/assets/components/gallery/connector.php)
[Gallery] An error occurred while trying to upload the file:
D:\WebSite Development\server\xampp\tmp\php2852.tmp
to D:/WebSiteDevelopment/server/xampp/htdocs/modx/assets/components/gallery
/files/2010/10/62231_424573019631_566639631_5130233_7671394_n.jpg
i think the space in the path (D:\WebSite Development..) is causing this error.
i might be wrong (:
either way i'd like to know how to resolve this if someone knows.
_
First Posted on:
http://modxcms.com/forums/index.php/topic,53269.msg321315.html#msg321315
It would be nice if pictures in gallery could be sorted randomly.
In firefox 3.6.8,
If you hover over the images on the right in the album, there is an empty line inserted underneath it.
Not a reall problem but annoying.
When we use the TV Output it only generate PNGs instead of showing the output in the same format than the original or letting us to choose what format to output using properties. For example, we have some JPG files wich size is 13Kb but are shown in PNG with a size of 73Kb!!!
The "problem" is in line 66: 'f' => 'png',
of
elements/tv/output/galleryitem.php
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.