I really need to get this working.... thanks!

Comments

publicmind’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed

Tip 1: http://protip.icecreamyou.com/tip/critical-means-totally-broken-not-look-me
Tip 2: http://protip.icecreamyou.com/tip/just-because-you-cant-figure-it-out-do...

All I know about lightbox is that you provide custom classes to your images, then you set those custom classes in the Lightbox settings and it should work. If it isn't working then you need help from someone who knows more about it, probably in the Lightbox forum.

AntiNSA’s picture

Category: support » feature

you have image cache presetes loaded, but all the lightbox presets are not available . For all the other uses in drupal and when using views, selection of lightob presets are found everywhere imagecache presets aer found. what is the big challenge to hae the same behavior in fbsmp?

mrwhizkid’s picture

Go to: http://www.yoursite.com/admin/settings/lightbox2/automatic -- enter in any name for the automatic preset then hit save.

Then go to http://www.yoursite.com/admin/settings/fbsmp/plugins/photo

Enter in that same name (nothing else) in Additional Classes and hit save.

AntiNSA’s picture

thanks! But is there any reason this does not show my image cache profiles?

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

AntiNSA’s picture

Status: Closed (fixed) » Active

Can you verify this is working? I can not seem to get it to work by adding testx into class and custom class as described above . If you could help me get this to work I would really appreciate it.

Mosco_DJ’s picture

Same problem with colorbox. Overlay is loaded, but stills in "loading". This only happens with Facebook-style Micropublisher

trotsak’s picture

Issue summary: View changes

@AntiNSA, for you have add class to link not to image.

that's adding to image:

Then go to http://www.yoursite.com/admin/settings/fbsmp/plugins/photo

Enter in that same name (nothing else) in Additional Classes and hit save.

mr.andrey’s picture

Version: 6.x-1.x-dev » 7.x-1.x-dev

This is still an issue for D7 and Colorbox because Colorbox requires the class "colorbox" to be set on the link, not the image.

To fix without hacking the module, set the the ImageCache preset to "... linked to image", then add the following to your template.php:

function yourtheme_fbsmp_photo_attachment_imagecache($variables) {
  $presetname = $variables['preset'];
  $style = $variables['style'];
  $attachment = $variables['attachment'];
  $alt = $variables['alt'];
  $title = $variables['title'];
  $attributes = $variables['attributes'];
  
  $attachment_data = $attachment->data;
  $file = (array) _fbsmp_file_load($attachment_data['fid']);
  if (!is_file(drupal_realpath($file['uri']))) {
    return '<!-- File not found: ' . check_plain($file['filename']) . ' -->';
  }

  switch ($style) {
    case 'default':
      return theme('image_style', array('style_name' => $presetname, 'path' => $file['uri'], 'alt' => $alt, 'title' => $title, 'attributes' => $attributes));
    case 'imagelink':
      $thumbnail = theme('image_style', array('style_name' => $presetname, 'path' => $file['uri'], 'alt' => $alt, 'title' => $title, 'attributes' => $attributes));
      $url =  file_create_url($file['uri']);
      return l($thumbnail, $url, array('html' => TRUE, 'attributes' => array('class' => 'colorbox')));
    case 'path':
      return image_style_path($presetname, $file['uri']);
    case 'url':
      return image_style_url($presetname, $file['uri']);
  }
}

The real fix would be to add the ability to add a custom class to either image OR the link.

Cheers,
Andrey.