Jump to content

(tng34) Quoted Images as Links - FREE


alexp999

Recommended Posts

%7Boption%7D



File Name: (tng34) Quoted Images as Links - FREE

File Submitter: alexp999

File Submitted: 17 May 2012

File Category: Performance

Supported Versions: IP.Board 3.3.x, IP.Board 3.4.x



If you are experiencing PHP warnings please make sure you are using version 1.1.0 or higher before reporting.

This is the IPB 3.4 & 3.3 version of this hook, for the 3.2 version, click here.

Displays quoted images as Lightbox enabled links to the original image. This saves space in your threads and means a post full of pictures is not repeated when someone quotes it.
Users can also click on the generated link and if they have javascript, a lightbox will open showing the original image.

This hook works by searching for quotes in a post, it will then strip away any BBCode images in those quotes (based on bbc_img class), replacing them with lightbox enabled urls to the original image, shortened and styled like standard BBCode urls.

This hook has been tested on an English board but has been written to hopefully work with any language and will use the alt text of the image, as the title(shown on hover) of the link. (e.g. Posted Image)


NOTE:
This hook was written for IPB 3.4 & 3.3 (Please choose the correct version when downloading)
This hook is only for forum topics and the Global Comments System
This hook only alters the DISPLAY of images quoted in posts, post data is not changed, the database remains untouched and as a result if a post is edited or quoted, the url to the quoted image will still be in %7Boption%7D tags



here to download this file

Link to comment
Share on other sites


The Hook for 3.2 worked very Well on 3.3. Then why upgrade ?



I have à bug now with this version of the Hook on my 3.3.2



Warning: DOMDocument::loadHTML() [domdocument.loadhtml]: htmlParseStartTag: invalid element name in Entity, line: 3 in /home/www/141d2093c0e41809bf75f6f93edc4124/web/forums/hooks/tng33_QuotedImages_817fbec78ec2789e2ce321bef99667c0.php on line 16




It did work, but the method it used to search and replace was ineffecient and often innacurate. It got the job done by constantly going over the same post until no more images were left in quotes.

The new method analyzes the post for what it is, HTML, That means it can lock on to the correct elements a lot more effeciently. The problem is it seems is that the HTML generated by IPB isn't always perfect, so I need to help the HTML parser out.

If the errors are showing up on your site (not just logged to a file), feel free to switch back to the 3.2 version for now.

I will work on a fix for this, but if you can send me the HTML (from page source) of the post you think is causing this, it would really help me speed up the fix. (see next post)
Link to comment
Share on other sites

  • 4 weeks later...

Some members have reported it is showing quoted emoticons as links now.




I did some testing with emoticons and found there can be a bug where the image for the emoticon won't load, but it shouldn't turn into a link. I have just released a new version, please try using 1.2.0 and if you still experience the same problem, then either post or PM me a link to a thread with the issue.
Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 3 weeks later...
  • 1 month later...
  • 2 months later...

Hi, I tried this hook, because I was annoyed that quoted images links open in the same window and i prefer lightbox to keep the user on the same page.

However, it generates the link not to the image, but to the small paperclip in front of it. The one in front of belt.jpg in the following screenshot

post-376756-0-76169600-1366029079_thumb.

Don't know if it is something that recent update broke. I am using 3.4.4

Link to comment
Share on other sites

Hi, I tried this hook, because I was annoyed that quoted images links open in the same window and i prefer lightbox to keep the user on the same page.

However, it generates the link not to the image, but to the small paperclip in front of it. The one in front of belt.jpg in the following screenshot

attachicon.gifUntitled.png

Don't know if it is something that recent update broke. I am using 3.4.4

Can you send me a link to the page this is happening on?

Link to comment
Share on other sites

No problem :smile:

But it doesnt seem to work again. Check again this link: http://magelanci.com/topic/99-%D1%81%D0%B8%D0%B3%D1%83%D1%80%D0%BD%D0%BE%D1%81%D1%82/page-3

post 44.

The paperclip icon is linked and opens in a lightbox, while the jpg files opens in the same window

This is normal IPB behaviour. This hook only affects %7Boption%7D tags, the fix stopped the paperclip turning into a link.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...