News:

Wondering if this will always be free?  See why free is better.

Main Menu

Highslide 4 SMF

Started by Spuds, May 01, 2010, 01:03:29 PM

Previous topic - Next topic

Spuds

I don't see a way to quickly figure out the original link (what we need) when given the thumbnail link.  Most sites just change a couple of characters so you just have to add/remove/change a thumbnail link to get the full sized link.

In the case above ... given
http://farm8.staticflickr.com/7177/6935446545_3b8391bd51_t.jpg 
we would need to figure out how to get
http://farm8.staticflickr.com/7177/6935446545_7c2d60ff03_o.jpg

unfortunately the hash changed, so I don't see how to get 7c2d60ff03_o.jpg given 3b8391bd51_t.jpg .... if it was just changing the _t to an _o we would be set .... the best I can see doing is a link to the large image, but not the original .... which does use the same hash ... e.g. link it to  http://farm8.staticflickr.com/7177/6935446545_3b8391bd51_b.jpg  which is a good sized image to highslide

MadTogger

Quote from: Spuds on March 31, 2012, 12:28:18 PM
I don't see a way to quickly figure out the original link (what we need) when given the thumbnail link.  Most sites just change a couple of characters so you just have to add/remove/change a thumbnail link to get the full sized link.

In the case above ... given
http://farm8.staticflickr.com/7177/6935446545_3b8391bd51_t.jpg 
we would need to figure out how to get
http://farm8.staticflickr.com/7177/6935446545_7c2d60ff03_o.jpg

unfortunately the hash changed, so I don't see how to get 7c2d60ff03_o.jpg given 3b8391bd51_t.jpg .... if it was just changing the _t to an _o we would be set .... the best I can see doing is a link to the large image, but not the original .... which does use the same hash ... e.g. link it to  http://farm8.staticflickr.com/7177/6935446545_3b8391bd51_b.jpg  which is a good sized image to highslide

Cheers Spuds for looking at this

I never spotted the hash change on the original size.

A link to the large size would indeed be perfectly suitable.

Regards..,

MadTogger

Hi Spuds,

I have been looking into getting this working for my Flickr images and have made some headway but now I am a little stuck.

Line 45 of hs4smf-Subs.php I added 'flickr' to the array of $image_hosters

then under the 'function hs4smf_fix_link($image)'

I added:

elseif (stripos($image['domain_url'], 'flickr') !== false && preg_match('~(.*?)\.(?:t\.|)(png|gif|jp(e)?g|bmp)$~is' . ($context['utf8'] ? 'u' : ''), $image[4], $out))

from copying the photobucket code.

An example hash for a Flickr image is:

318968374d_t.jpg - for the thumbnail
318968374d_b.jpg - for the large image.

I understand that the above code would strip off the 't' from the has but how do I then get it to output the new link with it adding the 'b' in the place of the 't'?

I appreciate you help.

Regards..,

MT

Eudemon

got any instruction on use it outside of smf system?
for example i create a php page that uses ssi.php

MadTogger

Quote from: Spuds on April 02, 2012, 07:47:35 PM
Quote from: MadTogger on April 02, 2012, 03:00:32 PM
Hi Spuds,

I have been looking into getting this working for my Flickr images and have made some headway but now I am a little stuck.

Try the attached version ... it should work with a _t style link (inside IMG tags of course)

Quote from: Eudemon on April 02, 2012, 05:30:03 PM
got any instruction on use it outside of smf system?
for example i create a php page that uses ssi.php
Sorry no  :(

Thanks Spuds, I'll take a look at the file.  ;)

MadTogger

Hi Spuds,

OK, I installed the mod without any problems.

I am now trying to test the use of the mod with Flickr images but cannot get my head around what I am supposed to post on a thread as the initial img link.

Flickr gives two options for the image code, see below:

BB Code version;
[url=http://www.flickr.com/photos/kjevans/6893415958/][img]http://farm8.staticflickr.com/7197/6893415958_ac6be76985_t.jpg[/img][/url]
[url=http://www.flickr.com/photos/kjevans/6893415958/]SWMEE2012 - 006[/url] by [url=http://www.flickr.com/people/kjevans/]MadTogger[/url], on Flickr

HTML version;
<a href="http://www.flickr.com/photos/kjevans/6893415958/" title="SWMEE2012 - 006 by MadTogger, on Flickr"><img src="http://farm8.staticflickr.com/7197/6893415958_ac6be76985_t.jpg" width="100" height="74" alt="SWMEE2012 - 006"></a>

both of which displays the image thumbnail and links it to the actual images page on Flickr.

Now if I use the BBCode version on my page, it shows the thumbnail correctly but upon clicking the image I am just taken to the images own page on Flickr, no Highslide lightbox appears.

To be able to use the HTML version on my forum I have to wrap the code in [html][/html] tags but get exactly the same result as with the BBCode version.

I have Enabled the Highslide MOD.

What exactly should I be posting to get the image to display and work with Highslide?

Regards..,

Spuds

The updates in that copy should work if you post it as [img]http://farm8.staticflickr.com/7197/6893415958_ac6be76985_t.jpg[/img] which is just the thumbnail ... from that it figures out the location of the large image and highslides that. 

I'll look at the full bbc you posted to see if it can use that as well, but for now it only needs the img thumbnail

Eudemon

Quote from: Spuds on April 02, 2012, 07:47:35 PM
Quote from: Eudemon on April 02, 2012, 05:30:03 PM
got any instruction on use it outside of smf system?
for example i create a php page that uses ssi.php
Sorry no  :(

ok :(

in case there is a misunderstand, i meant to make the images on that page have highslide
and the highslide settings are inherited from the mod setting
if you alrdy got what i meant then just ignore this

MadTogger

Quote from: Spuds on April 03, 2012, 10:46:56 AM
The updates in that copy should work if you post it as [img]http://farm8.staticflickr.com/7197/6893415958_ac6be76985_t.jpg[/img] which is just the thumbnail ... from that it figures out the location of the large image and highslides that. 

I'll look at the full bbc you posted to see if it can use that as well, but for now it only needs the img thumbnail

Cheers Spuds, got it working now. Super MOD thanks.  ;D

Regards..,

MT

MadTogger

Hi Spuds,

sorry to bother you again.

The MOD works great with both the BB Code & HTML code versions of the image link from Flickr, although there is something I would like to add.

When using the BB Code, due to it's limitations, there is no way to display the image caption, however it is displayed as a link back to the originating Flickr page under the Thumbnail in the post. To me though, this does not look very tidy.

If I use the HTML version of Flickr's image code, I can get the caption to display on the slideout and this does not have the messy text below the Thumbnail image, but due to Flickr's T&C each image has to have a link back to the image's originating page.

Is it at all possible to make the caption a clickable link to the image's homepage on Flickr?

Kind regards..,

MT

Iomega0318

So just noticed this error, it came from modifying a post which had no images btw..

http://www.uofreeshards.net/index.php?action=post;msg=***;topic=**.**
Apply Filter: Only show the errors with the same message
8: Undefined index: hs4smf_img_count
Apply Filter: Only show the errors from this file
File: /***/Sources/hs4smf-Subs.php
Line: 292
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

jan.van.gent

I'm having troubles on my forum.
A few times a day i'm getting this error:


Fatal error: Out of memory (allocated 7077888) (tried to allocate 79 bytes) in /var/www/vhosts/bimmerboard.be/httpdocs/forum/Sources/Load.php(217) : runtime-created function on line 4

Fatal error: Out of memory (allocated 6029312) (tried to allocate 122880 bytes) in /var/www/vhosts/bimmerboard.be/httpdocs/forum/Sources/Load.php(2153) : eval()'d code on line 127

Fatal error: Out of memory (allocated 4718592) (tried to allocate 122880 bytes) in /var/www/vhosts/bimmerboard.be/httpdocs/forum/Sources/hs4smf-Subs.php on line 848

The last line shows it has something to do with the HS4SMF file. Does anyone knows a solution to this problem?

FrizzleFried

Forgive my ignorance...

I have an ARCADE SHOUTOUT mod that shouts arcade scores to my shoutbox.  It includes images.  These images all have borders around them now that I've installed highslide.   I would like to add the alt="ns" option to the mod to prevent this behavior. 

How does the "alt="ns"" option work in HTML?   I tried the following line with zero luck:

Original line:

$trophy = '&nbsp;&nbsp;&nbsp;<img src="'. $boardurl.'/Themes/default/images/arc_icons/'. $position .'.gif" alt="" title="Trophy" />';

I just tried to add the ns to the existing alt...

$trophy = '&nbsp;&nbsp;&nbsp;<img src="'. $boardurl.'/Themes/default/images/arc_icons/'. $position .'.gif" alt="ns" title="Trophy" />';

That did nothing for me.

Any suggestions would be great.  Thanks!

FrizzleFried

As a follow up...

The issue 1 response above has been rectified.  The Illori at the Unofficial SMF Help Forum (www.smfhelp.org) was able to help me out.  Thanks Illori!

http://smfhelp.org/index.php?topic=32.msg303#msg303


Spuds

Quote from: Iomega0318 on April 23, 2012, 01:10:08 AM
So just noticed this error, it came from modifying a post which had no images btw..
I understand the error and can mask it, but I'd like to be able to replicate first ... please let me know what your settings are in the mods control panel and some details of the post that caused the error (how many messages / pages / images / etc) a link would be good.

QuoteI'm having troubles on my forum.
A few times a day i'm getting this error:
Thats an out of memory error, the mod does not even ask for more memory so this is something else with your setup.  You will need to increase your PHP memory limit, check with your host on how to do that and if you can.

QuoteThe issue 1 response above has been rectified.
Cool



Iomega0318

#375
Quote from: Spuds on May 07, 2012, 04:17:48 PM
Quote from: Iomega0318 on April 23, 2012, 01:10:08 AM
So just noticed this error, it came from modifying a post which had no images btw..
I understand the error and can mask it, but I'd like to be able to replicate first ... please let me know what your settings are in the mods control panel and some details of the post that caused the error (how many messages / pages / images / etc) a link would be good
To be honest not sure what caused the error, it doesn't happen all the time sometimes it even shows the error occurs on the index.php.. The topic in question has 21 posts, 2 pages, 2 images on the first page, and 5 on the second.. but the post I was modifying has no images..
Here are the settings I have set for the mod:



**EDIT**
Ok I was having trouble replicating it but found the post I initially got the error on, you wont be able to see it since it's under a test section and registered users can't even see it.. but here is the code I was playing around with when I got the message if you put it into a post and click preview you should get an error for it..
Removed
Was playing around with some index php scripts and trying to add them into an iframe..

**EDIT TWO**
Hmm.. nope it's something in the thread.. tried a fresh topic and got no error.. soooo.. go ahead and register on my forum and I will give you access to the thread causing the error so you can check it.. I have to warn you though the thread is a complete mess :)

**EDIT THREE**
After some further investigation I believe I know why it's tossing an error, I use the Inline Attachments mod and have images that show inline in one of the posts instead of in the attachment area, when I modify any of the messages on that page I get an error showing that topic, however if I modify that message specifically and click preview I get the error for that message ONLY not the topic..
**Confirmed, went to another topic with one post and one image attached but inline and went to modify/preview and got the error, this one is public so here is the link:
http://www.uofreeshards.net/index.php?topic=85.0
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

Spuds

Strange indeed ....

I set up my test site with just those two mods, and duplicated the posts you linked to ... no errors :(

I'm guessing that it might have something to do with another mod and/or the custom theme that you are using and where the slideshow tracking code is being called.

You can mask the error by doing this in the hs4smf-Subs.php file in the sources directory:

Code (find) Select
function hs4smf_track_slidegroup($id_msg)
{
// sets the array key if it has not been set or updates the key if already set and the new value is greater
global $modSettings, $context;


Code (replace) Select
function hs4smf_track_slidegroup($id_msg)
{
// sets the array key if it has not been set or updates the key if already set and the new value is greater
global $modSettings, $context;

// this should not happen, but here we find ourselfs
$context['hs4smf_img_count'] = isset($context['hs4smf_img_count']) ? $context['hs4smf_img_count'] : 0;



FrizzleFried

Any way possible to prevent this mod from "breaking" SMF Quiz?   With this (awesome) mod installed, SMF Quiz will not call up actual questions... remove the mod and it works fine?!

Thanks!


Iomega0318

#378
Quote from: Spuds on May 10, 2012, 05:26:24 PM
Strange indeed ....

I set up my test site with just those two mods, and duplicated the posts you linked to ... no errors :(

I'm guessing that it might have something to do with another mod and/or the custom theme that you are using and where the slideshow tracking code is being called.

You can mask the error by doing this in the hs4smf-Subs.php file in the sources directory:

Code (find) Select
function hs4smf_track_slidegroup($id_msg)
{
// sets the array key if it has not been set or updates the key if already set and the new value is greater
global $modSettings, $context;


Code (replace) Select
function hs4smf_track_slidegroup($id_msg)
{
// sets the array key if it has not been set or updates the key if already set and the new value is greater
global $modSettings, $context;

// this should not happen, but here we find ourselfs
$context['hs4smf_img_count'] = isset($context['hs4smf_img_count']) ? $context['hs4smf_img_count'] : 0;



I have a file and an image uploaded to the post, in the post I added this:
[attach=1]
[attachimg=2]

Then once posted I modify it and click preview, thats when the error occurs..
I might have to get you my mod because my version shows up as InLine Attachments 1.11, but anyways the fix you provided at least keeps my error log free lol..

**EDIT**
Here is the one I use:
http://custom.simplemachines.org/mods/index.php?mod=2481
and according to him he has made edits since 1.11 to work with your mod... soooooooo.. this was all my fault for not updating it even though it was supposed to notify me on updates LOL.. so I updated my mod but left your fix in so haven't tested it yet..

**EDIT TWO**
Ok removed your fix and tried the same way to replicate the error and got nothing.. so your mod works flawlessly now with the ILA update! Woot! Sorry for all the hassle I put you through lol but thank you so much for your help!
UOFreeshards.net
UOFreeshards.net 2.1 Aplha Test Site
"I believe in Christianity as I believe in the sun...
not because I see it but because by it I see everything else."
C.S. Lewis

Heed what I say, for it shall be mentioned only once.

azretl

Fatal error: Call to undefined function hs4smf() in /home/u953745372/public_html/Sources/Subs.php on line 2422

the attached file

Advertisement: