Flash Gallery inside Node's body with Filter

heimstein - May 4, 2007 - 17:16
Project:Flash gallery
Version:5.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

hello maintainers,

what do you think about intergrating fgalleries inside node's using a filter?

- just add the following snippet to flash_gallery.module
- activate the new filter at admin/settings/filters
- add into a node-body somthing like [FG id=\"123\"] where 123 is the term's id

imoh, this is not enogh to create a seperated module for that, so if you like it, please consider to merge it to the next release

<?php
function flash_gallery_filter($op, $delta = 0, $format = -1, $text = '') {
  switch (
$op) {
    case
'list':
      return array(
t('Flash Galery Filter'));

    case
'description':
        return
t('Provides a filter for Image embedding');

    case
'prepare':
        return
$text;
           
    case
'process':
       
$GLOBALS[flash_gallery_count] = 0;
       
$find = '/\[FG (.+?)\]/i';
       
$text = preg_replace_callback($find, "flash_gallery_process_callback", $text);
        return
''.$text;

    default:
        return
$text;
  }
}

function
flash_gallery_process_callback($text) {
   
$GLOBALS[flash_gallery_count]++;
   
$text = $text[1];
   
$text = str_replace('&quot;','"',$text); //translate quotes
// get attributes
   
preg_match('/id="(.+?)"/i', $text, $matches);   $id = $matches[1];
    return
''
       
. flash_gallery_render($id);
}



/**
* Implementation of hook_filter_tips().
*/
function flash_gallery_filter_tips($delta, $format, $long = false) {
  switch (
$long) {
    case
0:
      return
t("Use [FG id=\"123\"] where 123 is the term's id");
    case
1:
      return
t("Use [FG id=\"123\"] where 123 is the term's id");
  }
}
?>

#1

sime - May 6, 2007 - 03:07

I am happy to add features to the stand-alone version of Flash Gallery, but you'll need to provide a proper patch.

Please note, there is parallel development of Flash Gallery to work with SWF Tools. Since SWF Tools already has filter support, the plan is to extend this filter support to cover all integrated modules.

So you've got two options there.

#2

damien_vancouver - May 10, 2007 - 15:08

This looks like a pretty useful feature that would be worth jamming in the standalone flash_gallery. The standalone flash_gallery will be retired in favour of the swftools module once that is ready.

But this is a really simple feature to add looks like and I can imagine it being really useful, so I will try it and create a patch against HEAD and follow up with it, sometime in the next week.

D.

#3

damien_vancouver - May 10, 2007 - 15:16

er, I mean a patch against DRUPAL-5 (the standalone version of flash_gallery) But if the feature is useful I will create one against HEAD too so it can maybe go into swftools if it will jive.

#4

sime - May 11, 2007 - 03:27

No need to worry about future versions, flash_filter will handle all filters in swftools.

#5

thomasmuirhead - May 14, 2007 - 13:37

Can anybody help with this?

I am trying to ensure flash gallerys appear beneath dhtml layers. The simpleviewer page gives some guidance (refer to end of this post)

I am using the following function to call a gallery onto a particular node.

<?php
print(flash_gallery_render(1));
?>

Just struggling to find where to insert the code fo.addParam("wmode", "opaque"); within my drupal site.

I know the next version of the module is under development and may well help me solve this problem but if anyone has a quick fix that would be greatly appreciated.

Thomas

"You can have the SimpleViewer SWF appear under DHTML layers by adding this code under the SWFObject line in the HTML document:"

fo.addParam("wmode", "opaque");

http://www.airtightinteractive.com/simpleviewer/faq.html

#6

thomasmuirhead - May 14, 2007 - 13:39

Can anybody help with this?

I am trying to ensure flash gallerys appear beneath dhtml layers. The simpleviewer page gives some guidance (refer to end of this post)

I am currently using the following function to call a gallery onto a particular node.

<?php
print(flash_gallery_render(1));
?>

Just struggling to find where to insert the code fo.addParam("wmode", "opaque"); within my drupal site.

I know the next version of the module is under development and may well help me solve this problem but if anyone has a quick fix that would be greatly appreciated.

Thomas

From...

http://www.airtightinteractive.com/simpleviewer/faq.html

"You can have the SimpleViewer SWF appear under DHTML layers by adding this code under the SWFObject line in the HTML document:"

fo.addParam("wmode", "opaque");

#7

sime - May 14, 2007 - 13:54
Category:feature request» support request

I just looked at the flash_gallery code, this is the spot:

<?php
   
if (variable_get('flash_transparent', 0)) {
     
$content .= 'fo.addParam("wmode", "transparent");'."\n";
    }
?>

You can see the logic is pretty simple. You may like to try hacking it.

Leaving this as an active support request for a while. Essentially this wmode setting is already in SWF Tools, so it's not really a feature request.

Thanks

#8

sime - April 1, 2008 - 23:49
Project:SWF Tools» Flash gallery
Version:5.x-1.x-dev» 5.x-1.x-dev
Component:Flash Gallery» Code

** Moving Flash Gallery issues to own queue **

 
 

Drupal is a registered trademark of Dries Buytaert.