Support Forum

Upload addon and "Click To Enlarge"

TP Tim Peterson
Tim Peterson
Member

I’ve used the upload attachment addon to add some image files to a post on my forum as a test. The files upload just fine but the thumbnail is not clickable to enlarge the image. The tooltip says above the image on hover to “Click to Enlarge” but its not clickable… any suggestions?

 

Here is a link: http://www.weedwackers.org/ww/forum-2/seen-at-the-field/amazing-model/#p15

 

30 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

Curious…. for reasons that will need investigating the url of the image is malformed. It starts with a single quote (as it should) but ends with a double quote. Not something I believe I have seen before.

Do you have any WordPress plugins active that in any way might effect the formatting and display of post content? Anything that might look for links for example – or try and alter the basic formatting of text?

TP Tim Peterson
Tim Peterson
Member

 

Interesting. To answer your question about format and display altering plugins, I do not believe I have anything like that installed. The only plugins I have for simple press are the ones I’ve downloaded from your site. The plugins for the site at large are pretty standard stuff. Certainly nothing that would alter a link…. at least on purpose :)

I did purchase the site theme and hope that is not a factor. Please let me know if you can figure this one out.

YS Yellow Swordfish
Yellow Swordfish
Member

It is the WordPress plugins that are of interest here.
Can you tell me what plugins you have active?

TP Tim Peterson
Tim Peterson
Member

The list of active plugins is below.

 

 

Configure SMTP

 

Configure SMTP mailing in WordPress, including support for sending e-mail via SSL/TLS (such as GMail).
Gallery Plugin

 

This plugin allows you to implement gallery page into web site.

 

Google Analytics for WordPress

 

This plugin makes it simple to add Google Analytics to your WordPress blog, adding lots of features, eg. custom variables and automatic clickout and download tracking.
Jetpack by WordPress.com

 

Bring the power of the WordPress.com cloud to your self-hosted WordPress. Jetpack enables you to connect your blog to a WordPress.com account to use the powerful features normally only available to WordPress.com users.

Version 2.2 

NOAA Weather

 

Display the current NOAA weather in the sidebar. Be sure to set your NOAA Code!

Version 1.2.0 

Piklist

 

A Framework for Building Powerful Websites with WordPress.

Version 0.7.2 

Simple:Press

 

Fully featured but simple page-based forum

Version 5.2.6

User Role Editor

 

It allows you to change/add/delete any WordPress user role (except administrator) capabilities list with a few clicks.

Version 3.10 

Viper’s Video Quicktags

 

Easily embed videos from various video websites such as YouTube, DailyMotion, and Vimeo into your posts.

Version 6.4.5 

WordPress Helpers

 

Enhanced settings for WordPress. Located under TOOLS > HELPERS

 

 

YS Yellow Swordfish
Yellow Swordfish
Member

Would you be willing to try briefly deactivating ‘Jetpack’ and the ‘Gallery Plugin’ and then reloading the page with the forum images on it to see if that resolves it? reactivate afterwards of course…

TP Tim Peterson
Tim Peterson
Member

I deactivated both gallery and jetpack.

To test the deactivated status I checked our gallery page… was dead.

Tried the post again, but the results were no different. The thumbnails were not expanding as expected.

 

YS Yellow Swordfish
Yellow Swordfish
Member

Oh well – it was worth a try. Some of the Jetpack features ride roughshod over quite a lot of other plugins.
what abut the Wp theme itself? Any chance you could try with the WP default theme – again – as a very quick test?

TP Tim Peterson
Tim Peterson
Member

Ok…

I reverted the theme back to a standard theme and the forum attachment images still did not enlarge as expected. Had a heck of a time getting my theme back up and running after the toggle. So, my guess is the theme is not the issue. can you tell me which php file generates the code that puts in the enlarge JS link? I’m familiar with php so wont be scared to play around in there if needed.

 

Thanks,

Tim

YS Yellow Swordfish
Yellow Swordfish
Member

Sorry abouyt that but worth a try. This really is a one-off so it still points to an environmental issue..

The filter is in the file /sp-api/sp-api-filters.php. In the function sp_format_display_image(). You need the but where it alls the javascript routine spjPopupImage().

Actually – if you are ok with php then you would be well placed to see what values are coming in and out of there at the time and try and find out where and when they are getting changed…

TP Tim Peterson
Tim Peterson
Member

Thanks for the help.

 

I’ve found this portion of the mentioned function:

if ($anchor) {
if($width[1] ? $w = $width[1] : $w = ‘auto’);
if($height[1] ? $h = $height[1] : $h = ‘auto’);
# Use popup or not?
if ($sfimage[‘enlarge’] == true) {
$out = ‘<a href=”javascript:void(null)” class=”vtip” title=”‘.sp_text(‘Click image to enlarge’).'” onclick=”spjPopupImage(”.$src[1].”, ”.$w.”, ”.$h.”, ”.$sfimage[‘constrain’].”);” >’;
$out = apply_filters(‘sph_display_image_popup’, $out, $src[1]);
} else {
$out = ‘<a href=”‘.$src[1].'” ‘.$thistitle.’>’;
}
}

This is the HTML its rendering:

onclick=”spjPopupImage(‘http://www.weedwackers.org/ww/wp-content/sp-resources/forum-image-uploads/weedwack/2013/03/IMG_3627.JPG” title=”Click image to enlarge” href=”javascript:void(null)”>

 

I notice the closing paren for the spjPopupImage function is missing in the HTML… My knowledge of PHP only goes so far. Do you see any issues with the function? improper escape characters? Something I’m missing?

 

On a side note, I’ve upgraded the simple press plugin to the most recent version to see if that helped… to no avail.

TP Tim Peterson
Tim Peterson
Member

Actually, Here is the full section of that html output. 

 

<a class=”vtip” ‘1’);”=”” ‘768’,=”” ‘1024’,=”” ,=”” onclick=”spjPopupImage(‘http://www.weedwackers.org/ww/wp-content/sp-resources/forum-image-uploads/weedwack/2013/03/IMG_3627.JPG” title=”Click image to enlarge” href=”javascript:void(null)”>
<img class=”sfimageleft” width=”100″ alt=”IMG_3627.JPG” src=”http://www.weedwackers.org/ww/wp-content/sp-resources/forum-image-uploads/weedwack/2013/03/IMG_3627.JPG”>
<img class=”sfimageleft sfmouseleft” alt=”” src=”http://www.weedwackers.org/ww/wp-content/sp-resources/forum-themes/default/images/sp_Mouse.png”>
</a>
 
looks a little off in the first part after the class call out.
YS Yellow Swordfish
Yellow Swordfish
Member

Yes – that’s the code I was pointing you to. And yes – as I said – the closing quotes are double not single. That code is not doing that. if you look at the escaping you can see that.
And that is why i was asking about other WP plugins that might be running filters on post content as this sort of thing can occur with a badly behaved filter

YS Yellow Swordfish
Yellow Swordfish
Member

That makes two of us!

I trawled through these forums looking for any evidence of a prior issue but found none and I don’t remember one. I remain suspicious of some errant text formatter or filter somewhere but those other plugins you have there look innocuous enough. I will try and find time this morning to download them and try them out locally.