Advertisement:

Author Topic: Highslide Image Viewer  (Read 271937 times)

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Highslide Image Viewer
« Reply #240 on: February 13, 2009, 01:39:29 AM »
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.

Offline LinK187

  • Full Member
  • ***
  • Posts: 406
  • Gender: Male
    • London Bass
Re: Highslide Image Viewer
« Reply #241 on: February 13, 2009, 01:53:42 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...

Offline exxocet

  • Jr. Member
  • **
  • Posts: 121
Re: Highslide Image Viewer
« Reply #242 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.

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Highslide Image Viewer
« Reply #243 on: March 09, 2009, 04:28:04 PM »
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?

Offline ianus

  • Jr. Member
  • **
  • Posts: 391
    • Firopolis
Re: Highslide Image Viewer
« Reply #244 on: March 11, 2009, 11:00:23 AM »
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.
Code: [Select]
[img width=150 height=94]http://img113.imageshack.us/img113/5954/20gr7707672.th.jpg[/img]Second one: Own URL warped around image.
Code: [Select]
[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.
Code: [Select]
[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?
« Last Edit: March 11, 2009, 12:27:01 PM by ianus »

Offline exxocet

  • Jr. Member
  • **
  • Posts: 121
Re: Highslide Image Viewer
« Reply #245 on: March 13, 2009, 06:22:03 PM »
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:
Code: [Select]
[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:
Code: [Select]
[URL=www.paypal.com][IMG]/paypalbutton.jpg[/IMG][/URL]


 

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Highslide Image Viewer
« Reply #246 on: March 15, 2009, 10:40:58 PM »
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:
Code: [Select]
[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:
Code: [Select]
[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.

Offline fotografo74

  • Jr. Member
  • **
  • Posts: 184
  • Gender: Male
    • Macrofotografia.net
Re: Highslide Image Viewer
« Reply #247 on: March 16, 2009, 03:44:47 AM »
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
« Last Edit: March 16, 2009, 07:28:18 AM by fotografo74 »

Offline Xavi-Nena

  • Full Member
  • ***
  • Posts: 458
  • Gender: Female
  • ♥ I am my own malfunction....Xavi-Nena ♥
Re: Highslide Image Viewer
« Reply #248 on: March 16, 2009, 08:06:13 PM »
I must be missing something... I have installed it and all show success however it is not changing anything with my attached images?

Offline Spuds

  • SMF Hero
  • ******
  • Posts: 1,798
  • Gender: Male
Re: Highslide Image Viewer
« Reply #249 on: March 16, 2009, 08:34:31 PM »
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

Offline LinK187

  • Full Member
  • ***
  • Posts: 406
  • Gender: Male
    • London Bass
Re: Highslide Image Viewer
« Reply #250 on: March 16, 2009, 09:31:55 PM »
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.

Offline Xavi-Nena

  • Full Member
  • ***
  • Posts: 458
  • Gender: Female
  • ♥ I am my own malfunction....Xavi-Nena ♥
Re: Highslide Image Viewer
« Reply #251 on: March 16, 2009, 09:42:34 PM »
I have done this and still shows no change?

Offline TinkyWinky

  • Semi-Newbie
  • *
  • Posts: 14
  • Gender: Male
    • Novi Beograd
Re: Highslide Image Viewer
« Reply #252 on: March 18, 2009, 05:49:29 AM »
Great mod, thanks

Serbian language translation attached
[nofollow]

Offline exxocet

  • Jr. Member
  • **
  • Posts: 121
Re: Highslide Image Viewer
« Reply #253 on: March 18, 2009, 08:18:24 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:
Code: [Select]
[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:
Code: [Select]
[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!

Offline gianko82

  • Semi-Newbie
  • *
  • Posts: 58
Re: Highslide Image Viewer
« Reply #254 on: March 20, 2009, 07:35:08 AM »
 ;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:
Code: [Select]
// 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."
};
« Last Edit: March 20, 2009, 08:16:41 AM by gianko82 »

Offline digger

  • Sr. Member
  • ****
  • Posts: 787
  • Gender: Male
    • realdigger on GitHub
    • SMF Russian Community
Re: Highslide Image Viewer
« Reply #255 on: March 20, 2009, 09:12:14 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

Italian translation there:

Thank you for new language.

Offline Mastrgamr

  • Semi-Newbie
  • *
  • Posts: 51
  • Gender: Male
  • Wanna-be PHP programmer
    • teKnowlogy
Re: Highslide Image Viewer
« Reply #256 on: March 22, 2009, 10:26:38 PM »
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).

Offline ghof

  • Semi-Newbie
  • *
  • Posts: 57
Re: Highslide Image Viewer
« Reply #257 on: March 24, 2009, 06:04:29 PM »
I need coding help  O:)

Code: [Select]
// 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)

« Last Edit: March 24, 2009, 06:35:28 PM by ghof »

Offline TomW

  • Jr. Member
  • **
  • Posts: 294
  • Gender: Male
Re: Highslide Image Viewer
« Reply #258 on: April 02, 2009, 08:20:37 PM »
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 ?

Offline qtime

  • Full Member
  • ***
  • Posts: 501
Re: Highslide Image Viewer
« Reply #259 on: April 07, 2009, 06:59:46 PM »
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.