News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

Highslide Image Viewer

Started by digger, October 07, 2008, 09:37:35 PM

Previous topic - Next topic

digger

Quote from: LinK187 on February 12, 2009, 10:07:39 PM
Is there a way to disable this mod in an image tag? It's preventing a banner add (.gif) from working. You click on it and it just hangs on the spinny load thing when it should link to a thread on the forum.

Read the first post of topic.

LinK187

Quote from: digger on February 13, 2009, 01:39:29 AM
Quote from: LinK187 on February 12, 2009, 10:07:39 PM
Is there a way to disable this mod in an image tag? It's preventing a banner add (.gif) from working. You click on it and it just hangs on the spinny load thing when it should link to a thread on the forum.

Read the first post of topic.

That works.. but it's sloppy really.. cheers...

exxocet

Any chance to How disable highslide for linked images only for localhost hosted images?

This way the linked images (Imageshack thumbnails per instance) will be highslided nicely, but in the meantime, banners hosted on the local sever will be excepted.

Thank you.

digger

Quote from: exxocet on March 07, 2009, 08:13:15 AM
Any chance to How disable highslide for linked images only for localhost hosted images?

This way the linked images (Imageshack thumbnails per instance) will be highslided nicely, but in the meantime, banners hosted on the local sever will be excepted.

Thank you.

Can i see example of banner's troubles?

ianus

#244
Quote from: digger on February 13, 2009, 01:39:29 AM
Quote from: LinK187 on February 12, 2009, 10:07:39 PM
Is there a way to disable this mod in an image tag? It's preventing a banner add (.gif) from working. You click on it and it just hangs on the spinny load thing when it should link to a thread on the forum.

Read the first post of topic.

Sorry for inconvenience, but I can't figure it out.

The first toppic say's: How disable highslide for linked images.
But the solution will comment out the whole mod, if I'm right.

I have two kinds of image links.
First one: No URL warped around the image.
[img width=150 height=94]http://img113.imageshack.us/img113/5954/20gr7707672.th.jpg[/img]
Second one: Own URL warped around image.
[URL=http://www.firopolis.de][img]http://img211.imageshack.us/img211/348/24gr7628668.th.jpg[/img][/URL]
Third one: Link-URL to image warped around image.
[URL=http://img15.imageshack.us/my.php?image=25gr7610059.jpg][img width=150 height=85]http://img15.imageshack.us/img15/2678/25gr7610059.th.jpg[/img][/URL]

If I put /* */ around the highslide code in subs.php, the first one is shown (without highslide), the second one is linked to source (obviously).

If I remove /* */ highsilde is working for the first one but not for the second one with a different url than the image url.

If the given URL leads to the image source, highslide is workung also.


Maybe I get something wrong?

exxocet

Quote from: digger on March 09, 2009, 04:28:04 PM
Quote from: exxocet on March 07, 2009, 08:13:15 AM
Any chance to How disable highslide for linked images only for localhost hosted images?

This way the linked images (Imageshack thumbnails per instance) will be highslided nicely, but in the meantime, banners hosted on the local sever will be excepted.

Thank you.

Can i see example of banner's troubles?

Well, let's presume we have a PayPal button. It looks like this:
[URL=www.paypal.com][IMG]www.onesite.com/paypalbutton.jpg[/IMG][/URL]

Basicaly it's a linked image. It won't work in highslide, won't sent you to paypal.com, it just hangs on "Load..."
The same with the banners, which are linked images, instead of redirecting to target URL it will just "Load"...


So, I'm just thinking if it's not possible to except from this behaviour the images hosted on localhost (which can be used like /image.jpg , without http;//...). Now it will look like this:
[URL=www.paypal.com][IMG]/paypalbutton.jpg[/IMG][/URL]




digger

Quote from: exxocet on March 13, 2009, 06:22:03 PM
Quote from: digger on March 09, 2009, 04:28:04 PM
Quote from: exxocet on March 07, 2009, 08:13:15 AM
Any chance to How disable highslide for linked images only for localhost hosted images?

This way the linked images (Imageshack thumbnails per instance) will be highslided nicely, but in the meantime, banners hosted on the local sever will be excepted.

Thank you.

Can i see example of banner's troubles?

Well, let's presume we have a PayPal button. It looks like this:
[URL=www.paypal.com][IMG]www.onesite.com/paypalbutton.jpg[/IMG][/URL]

Basicaly it's a linked image. It won't work in highslide, won't sent you to paypal.com, it just hangs on "Load..."
The same with the banners, which are linked images, instead of redirecting to target URL it will just "Load"...


So, I'm just thinking if it's not possible to except from this behaviour the images hosted on localhost (which can be used like /image.jpg , without http;//...). Now it will look like this:
[URL=www.paypal.com][IMG]/paypalbutton.jpg[/IMG][/URL]

I am working on a next version with some new features.
I will try to do something with  locally linked images.

fotografo74

#247
Thanks digger, nice and useful Mod :-)
I have little problem: in IE6/7, Safari, Opera, Firefox 2 works ok.
In Firefox 3, only in topic's page , it opens new page with photo and highslide not works.
Why it happens?
I have SMF Gallery Mod installed.
Thanks
Antonio

[EDIT] This problem it happens only with Admin and Moderator membergroup, not with regular members

Xavi-Nena

I must be missing something... I have installed it and all show success however it is not changing anything with my attached images?

Spuds

If you are using a custom theme you need to manually edit those files.  Read the manual install docs for the mod to see what files to change

LinK187

In helpful terms:

the index.template.php from your custom theme needs to be modifed in the same way as the same filename in your default theme.

Xavi-Nena

I have done this and still shows no change?

TinkyWinky

Great mod, thanks

Serbian language translation attached
[nofollow]

exxocet

Quote from: digger on March 15, 2009, 10:40:58 PM
Quote from: exxocet on March 13, 2009, 06:22:03 PM
Quote from: digger on March 09, 2009, 04:28:04 PM
Quote from: exxocet on March 07, 2009, 08:13:15 AM
Any chance to How disable highslide for linked images only for localhost hosted images?

This way the linked images (Imageshack thumbnails per instance) will be highslided nicely, but in the meantime, banners hosted on the local sever will be excepted.

Thank you.

Can i see example of banner's troubles?

Well, let's presume we have a PayPal button. It looks like this:
[URL=www.paypal.com][IMG]www.onesite.com/paypalbutton.jpg[/IMG][/URL]

Basicaly it's a linked image. It won't work in highslide, won't sent you to paypal.com, it just hangs on "Load..."
The same with the banners, which are linked images, instead of redirecting to target URL it will just "Load"...


So, I'm just thinking if it's not possible to except from this behaviour the images hosted on localhost (which can be used like /image.jpg , without http;//...). Now it will look like this:
[URL=www.paypal.com][IMG]/paypalbutton.jpg[/IMG][/URL]

I am working on a next version with some new features.
I will try to do something with  locally linked images.

Sounds great buddy. Can't wait for the release!

gianko82

#254
 ;D
Thanks digger! great mod!
I have also installed the easing_equations. why don't you put all into the install pack?

Italian translation there:

// Traduzione italiana by gianko82
hs.lang = {
loadingText : "Caricamento...",
loadingTitle : "Click per annullare",
focusTitle : "Click per portare in primo piano",
fullExpandTitle : "Espandi a dimensioni reali",
creditsText : "Powered by <i>Highslide JS</i>",
creditsTitle : "Vai all'homepage Highslide JS",
previousText : "Precedente",
nextText : "Successiva",
moveText : "Sposta",
closeText : "Chiudi",
closeTitle : "Chiudi (esc)",
resizeTitle : "Ridimensiona",
playText : "Play",
playTitle : "Avvia presentazione (spazio)",
pauseText : "Pausa",
pauseTitle : "Pausa presentazione (spazio)",
previousTitle : "Precedente (freccia sinistra)",
nextTitle : "Successiva (freccia destra)",
moveTitle : "Sposta",
fullExpandText : "Dimensioni efettive",
number: "Immagine %1 di %2",
restoreTitle : "Click per chiudere, click & drag per spostare l'immagine. Usa i tasti freccia sx e dx per la precedente e la successiva."
};


digger

Quote from: gianko82 on March 20, 2009, 07:35:08 AM
I have also installed the easing_equations. why don't you put all into the install pack?

Easing_equations library is published under a BSD licence, and has no link to the Highslide licence

Quote from: gianko82 on March 20, 2009, 07:35:08 AM
Italian translation there:

Thank you for new language.

Mastrgamr

Where is the Usage instructions, apparently I did something wrong.

I installed it (100% on 1.1.8), and my images dont pop up when i use the [img] tags. Is there something else i'm supposed to do?
My tip for making themes: If you are able to choose a 'better' theme out of your collection created theme, then the theme you didn't choose isn't good enough. Remake it.
Themes in the works: 3 (1 premium).

ghof

#257
I need coding help  O:)

// If this is block level, eat any breaks after it.
if (!empty($tag['block_level']) && substr($message, $pos + 1, 6) == '<br />')
$message = substr($message, 0, $pos + 1) . substr($message, $pos + 7);

// Are we trimming outside this tag?
if (!empty($tag['trim']) && $tag['trim'] != 'outside' && preg_match('~(<br />|&nbsp;|\s)*~', substr($message, $pos + 1), $matches) != 0)
$message = substr($message, 0, $pos + 1) . substr($message, $pos + 1 + strlen($matches[0]));
}

// Close any remaining tags.
while ($tag = array_pop($open_tags))
$message .= $tag['after'];

if (substr($message, 0, 1) == ' ')
$message = '&nbsp;' . substr($message, 1);

// Cleanup whitespace.
$message = strtr($message, array('  ' => ' &nbsp;', "\r" => '', "\n" => '<br />', '<br /> ' => '<br />&nbsp;', '&#13;' => "\n"));

// Aeva - START
// Do the actual embedding
global $sourcedir;
@include_once($sourcedir . '/Subs-Aeva.php');
if (function_exists('aeva_parse_bbc2'))
aeva_parse_bbc2($message, $smileys, $cache_id);
// Aeva - END

  // * Highslide mod
// Disable for signatures & on stats page
if((empty($cache_id) || substr($cache_id, 0, 3) != 'sig') && $context['current_action'] != 'stats')
{
// Grab all linked and non-linked images
if(preg_match_all('~(<a href="([^"]*?)"(?:[^>]*?)>|)(<img src="((?!'. preg_quote($modSettings['smileys_url'], '#') .').*?)"(?:[^>]*?)>)(?:</a>|)~ism'.($context['utf8'] ? 'u' : ''), $message, $images, PREG_SET_ORDER))
{
//  Output key of images - for each match
// 0. entire match
// 1. <a> or blank
// 2. url or blank
// 3. <img>
// 4. imageurl
// 5. Replacement string

// Cycle through each image
foreach($images as $a => $b)
{
// Match images hosted by Imageshack, Photobucket, iPicture.ru or Fotosik.pl
$c = @parse_url($b[4]);
        $c = empty($c['host']) ? '' : $c['host'];

// Non-linked images won't have all the data, so make it up
if(empty($b[1]) && empty($b[2])
&& ((preg_match("~<img[^>]*?(width|height)[^>]*?>~ism", $b[3]))
|| (strpos($c, 'imageshack') !== false && preg_match('~(.*?)\.(?:th\.|)(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4]))
|| (strpos($c, 'photobucket') !== false && preg_match('~(.*?)/(?:th_|)([^/]*?)\.(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4]))
|| (strpos($c, 'ipicture') !== false && preg_match('~(.*?)/(?:thumbs|)/([^/]*?)\.(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4]))
|| (strpos($c, 'fotosik') !== false && preg_match('~(.*?)\.(?:m\.|)(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4]))
|| (strpos($b[4], 'GalleryItem.php') !== false && preg_match('~(thumb|preview)$~is'.($context['utf8'] ? 'u' : ''), $b[4])) // SMF Media Gallery
)
)
{
$b[1] = '<a href="'.$b[4].'">';
$b[2] = $b[4];
$b[5] = '<a href="'.$b[4].'">'.$b[3].'</a>';
}
else
$b[5] = $b[0];

if(strpos($c, 'imageshack') !== false)
{
// Fix Imageshack thumbnails and for non-direct page links
if(preg_match('~(.*?)\.(?:th\.|)(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4], $out))
{
$out = $out[1].'.'.$out[2];
$d = $b[1];
$b[1] = str_replace($b[2], $out, $b[1]);
$b[2] = $out;
$b[5] = str_replace($d, $b[1], $b[5]);
unset($c, $d, $out);
}
}
elseif(strpos($c, 'photobucket') !== false)
{
// Fix Photobucket thumbnails
if(preg_match('~(.*?)/(?:th_|)([^/]*?)\.(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4], $out))
{
$out = $out[1].'/'.$out[2].'.'.$out[3];
$d = $b[1];
$b[1] = str_replace($b[2], $out, $b[1]);
$b[2] = $out;
$b[5] = str_replace($d, $b[1], $b[5]);
unset($c, $d, $out);
}
}
elseif(strpos($c, 'ipicture') !== false)
{
// Fix iPicture thumbnails
if(preg_match('~(.*?)/(?:thumbs|)/([^/]*?)\.(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4], $out))
{
$out = $out[1].'/'.$out[2].'.'.$out[3];
$d = $b[1];
$b[1] = str_replace($b[2], $out, $b[1]);
$b[2] = $out;
$b[5] = str_replace($d, $b[1], $b[5]);
unset($c, $d, $out);
}
}
elseif(strpos($c, 'fotosik') !== false)
{
// Fix Fotosik thumbnails
if(preg_match('~(.*?)\.(?:m\.|)(png|gif|jp(e)?g|bmp)$~is'.($context['utf8'] ? 'u' : ''), $b[4], $out))
{
if (substr($out[1], -1)=='m') $out[1] = substr($out[1], 0, strlen($out[1])-1);
if (substr($out[1], -3)=='med') $out[1] = substr($out[1], 0, strlen($out[1])-3);
$out = $out[1].'.'.$out[2];
$d = $b[1];
$b[1] = str_replace($b[2], $out, $b[1]);
$b[2] = $out;
$b[5] = str_replace($d, $b[1], $b[5]);
unset($c, $d, $out);
}
}

// Add rel="highslide"
$c = $b[1];
        // Http links don't use highslide
        if(preg_match('~\.(png|gif|jp(e)?g|bmp)~is', $b[2]))
       
        // Fix SMF Media Gallery thumbs
if(preg_match('~MGalleryItem.php~is', $b[4]));
{
          $b[1] = str_replace($b[2], $b[2].'" class="highslide" rel="highslide', $b[1]);
          $b[1] = str_replace($b[4], str_replace(array(';preview', ';thumb'), '', $b[4]), $b[1]);
          $b[5] = str_replace('alt=""', 'alt="' . str_replace(array(';preview', ';thumb'), '', $b[4]) . '"', $b[5]); // Add filename to caption
        }
       
$b[1] = str_replace($b[2], $b[2].'" class="highslide" rel="highslide', $b[1]);
$b[5] = str_replace($c, $b[1], $b[5]);
$b[5] = str_replace('alt=""', 'alt="' . $b[2] . '"', $b[5]); // Add filename to caption
$b[5] = $b[5] . '<div class="highslide-heading">' . (!empty($context['subject']) ? $context['subject'] : '') . '</div>'; // Add subject to header

// Replace the link in the message
$message = str_replace($b[0], $b[5], $message);

// Tidy up
unset($a, $b, $c, $d);
}
// Tidy up
unset($a, $b, $links);
}
}
  // Highslide mod *

// Cache the output if it took some time...
if (isset($cache_key, $cache_t) && array_sum(explode(' ', microtime())) - array_sum(explode(' ', $cache_t)) > 0.05)
cache_put_data($cache_key, $message, 240);

return $message;
}

// Parse smileys in the passed message.
function parsesmileys(&$message)
{
global $modSettings, $db_prefix, $txt, $user_info, $context;
static $smileyfromcache = array(), $smileytocache = array();

// No smiley set at all?!
if ($user_info['smiley_set'] == 'none')
return;


This is the highslide code in subs.php, there has been some strange errors in the forum, and now i found out what makes the problem, this highslide code.

I removed it, then all was fixed, so i know this is where the problem is.
Either BEFORE or AFTER, some character needed to close the code properly, so it doesnt destroy what comes after highslide code


Where is the problem? plz help me  :)

The main problem(probably more) is that icons in other places where highslide should definitly not be is affected by highslide and uses it ,  and Highslide is NOT working where it should, in posts.

It seems that if i remove:

// Non-linked images won't have all the data, so make it up
            if(empty($b[1]) && empty($b[2])
               && ((preg_match("~<img[^>]*?(width|height)[^>]*?>~ism", $b[3]))

Then highslide in posts is working,  but also everywhere else. (see the attached image which happens in a profile)


TomW

I am using PostImage and noticed that the mod for subs.php does not have the code for it.  How can I make this work with PostImage ?

qtime

This is a great mod, it gives a nice interface.
I am using the inline attachment modification, so the attachments are visible inside the post. The attached files will be showed nice, but the inline attachment will not be different.
the code in the postfield is: [attachment=1] [attachment=2] etc
Any help will be much appreciated.

Advertisement: