Jump to content


- - - - -

URL for attachment thumbnails


  • Please log in to reply
No replies to this topic

#1 kj512

kj512

    n00b

  • Members
  • Pip
  • 1 posts
  • IPB Version:v3.2.x

Posted Today, 03:50 PM

Hello. I have some PHP code which retrieves news posts from my forums and displays them on the front page of my website. Everything works fine, but I need a way to get the thumbnails for image attachments. At the moment, I'm using preg_replace to replace bbcode, as well as the [attachment] tag.

So [attachment=13:MyImage.png] is replaced with:
<a href='/ipb/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=13'>
<img class='thumbnail' src='/ipb/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=13' />
</a>

The problem is that the above URLs retrieve the full image, which is bandwidth intensive. I just want the thumbnail image, and then if the user clicks on it, they will be taken to the full image. I'm using CSS to resize the full image at the moment which isn't ideal.

So if "/ipb/index.php?app=core&module=attach&section=attach&attach_rel_module=post&attach_id=13" retrieves the full image, is there a link to retrieve the thumbnail?




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users