Posted by CasaDelGato on August 18, 2009 at 5:05am
Jump to:
| Project: | Fast Gallery |
| Version: | 7.x-1.1-beta2 |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | patch (to be ported) |
Issue Summary
I'd like to be able to have multiple separate galleries. They should not have any direct links to each other, so just referencing a sub-album won't work.
I found the (generally undocumented) [fg:gallery] tag, but as far as I can tell, it only lets you select which album from the one and only gallery.
Comments
#1
I second this. Is it possible with Fast Gallery?
#2
PLease, any answers to this?
Jaya
#3
Anyone? I hope so, this would be great!
#4
this is not that easy to accomplish with the current design of the module. If somebody wants to do it... go ahead and write a patch.
#5
This small patch solved this (for me...)
--- default.storage.inc.orig 2009-12-09 21:27:40.000000000 +0100
+++ default.storage.inc 2011-03-20 21:51:31.111311605 +0100
@@ -65,7 +65,7 @@
//incase we want to display the subfolder first
if (variable_get('fg_folder_first', FALSE)) {
- $return = array_merge($return, $this->getFolders($foid));
+ $return = array_merge($return, $this->getFolders($foid,$folder));
}
$sort_order = variable_get('fg_sort_order', 'filename');
@@ -84,7 +84,7 @@
//incase we display the subfolders last
if (!variable_get('fg_folder_first', FALSE)) {
- $return = array_merge($return, $this->getFolders($foid));
+ $return = array_merge($return, $this->getFolders($foid,$folder));
}
// just incase ... store cache
@@ -107,7 +107,7 @@
* @param int $foid
* @return array
*/
- private function getFolders($foid) {
+ private function getFolders($foid,$folder='') {
$sort_order = variable_get('fg_sort_order', 'filename');
$sort_direction = variable_get('fg_sort_direction', 'asc');
@@ -116,11 +116,14 @@
$sort_order = 'folder';
break;
}
-
+ $foldertest = '';
+ if ($folder!='') {
+ $foldertest = " AND folder LIKE '".$folder."/%' ";
+ }
$folders = array();
$row = db_query("SELECT folder FROM {fast_gallery_hierarchy}
- WHERE pid = :foid
- ORDER BY $sort_order $sort_direction",
+ WHERE pid = :foid ".$foldertest."
+ ORDER BY $sort_order $sort_direction",
array(':foid' => $foid), array('fetch' => PDO::FETCH_ASSOC));
foreach ($row as $folder) {
$folders[] = new FGImage($folder['folder'], array('dir' => TRUE));
@@ -218,6 +221,4 @@
return $ar[$image->getFolder()];
}
-
-
-}
\ No newline at end of file
+}