I have an image gallery that contains sub-categories. The Flash Gallery module is displaying the simpleviewer flash animation on the subcategory page. How can I remove this?

To demonstrate what I am talking about please see http://stangit.com/fgallery/13

Thanks,

Chris

Comments

demoniac’s picture

Here is what I did to fix the problem that you are having. Open up /modules/flash_gallery/flash_gallery.module (might be a good idea to back it up first).

Replace lines 103-123 with the following code:
if (count($galleries) == 0) {
if ($tid && taxonomy_term_count_nodes($tid, 'image')) {
$location = base_path() . drupal_get_path('module', 'flash_gallery');
$content .= '

';
$content .= t('

Macromedia Flash is required. Download Macromedia Flash.

');
$content .= '

'."\n"; $op[] = $location .'/simpleviewer/viewer.swf'; $op[] = 'viewer'; $op[] = variable_get('flash_width', 700); $op[] = variable_get('flash_height', 600); // minimum Flash version required $op[] = 7; $op[] = '#'. variable_get('flash_background_color', '181818'); $content .= 'var fo = new SWFObject("'. implode('", "', $op) .'");'."\n"; if (variable_get('flash_transparent', 0)) { $content .= 'fo.addParam("wmode", "transparent");'."\n"; } $content .= 'fo.addVariable("preloaderColor", "0x'. variable_get('flash_loader_color', 'ff0000') .'");'."\n"; $content .= 'fo.addVariable("xmlDataPath", "'. url('fgallery_xml/'. $tid) .'");'."\n"; $content .= 'fo.write("flashcontent");'."\n"; $content .= '

';
}
}

Only the top and bottom lines are new, everything else is the same as before. What this does is check to see if there are sub-galleries on the current gallery you are viewing and if there is not then it shows the flash viewer. If there are sub-galleries then it will not show the flash viewer.

One problem with this is if you have a gallery with multiple sub galleries and photos in that gallery then it will not show the flash viewer. This is not a problem for my gallery structure but it could be for others.

Griff1324’s picture

It worked like a charm!

Thanks,

Chris

JPE’s picture

if (count($galleries) == 0) {
if ($tid && taxonomy_term_count_nodes($tid, 'image')) {
$location = base_path() . drupal_get_path('module', 'flash_gallery');
$content .= '

';
$content .= t('

Macromedia Flash is required. Download Macromedia Flash.

');
$content .= '

'."\n"; $op[] = $location .'/simpleviewer/viewer.swf'; $op[] = 'viewer'; $op[] = variable_get('flash_width', 700); $op[] = variable_get('flash_height', 600); // minimum Flash version required $op[] = 7; $op[] = '#'. variable_get('flash_background_color', '181818'); $content .= 'var fo = new SWFObject("'. implode('", "', $op) .'");'."\n"; if (variable_get('flash_transparent', 0)) { $content .= 'fo.addParam("wmode", "transparent");'."\n"; } $content .= 'fo.addVariable("preloaderColor", "0x'. variable_get('flash_loader_color', 'ff0000') .'");'."\n"; $content .= 'fo.addVariable("xmlDataPath", "'. url('fgallery_xml/'. $tid) .'");'."\n"; $content .= 'fo.write("flashcontent");'."\n"; $content .= '/script'; } } /script have <> but i can't post the code here it works for me with multiple sub galleries