Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] linking to image on frontend

linking to image on frontend 03 Nov 2014 13:09 #12731

  • cliffordsean
  • cliffordsean's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 1
  • Karma: 1
Hi there

in the backend the image previews pull the images from this url

administrator/index.php?option=com_mycom&task=file&path=[DIR_BANNERS_IMAGE]/skyscraper-160-x-500-1.jpg

However on the frontend i have a custom component and i want to grab this image - can only one tell me how i can do this plz ?


tnx
The administrator has disabled public write access.

linking to image on frontend 03 Nov 2014 13:18 #12733

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Same, but remove 'administrator' :

index.php?option=com_mycom&task=file&path=[DIR_BANNERS_IMAGE]/skyscraper-160-x-500-1.jpg
Coding is now a piece of cake
The administrator has disabled public write access.

linking to image on frontend 03 Nov 2014 13:24 #12734

  • cliffordsean
  • cliffordsean's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 1
  • Karma: 1
no unfortunately when i do that i get


404: Not Found
Sorry, but the page you requested could not be found.
The administrator has disabled public write access.

linking to image on frontend 03 Nov 2014 14:11 #12736

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
Did you tried on a fresh install ?

You might have something that corrupts the process.
I mean, It is exactly the same in back and front.

Do you have special caracters in the Joomla root ? (even this is fixed now)
Did you forked something ?
Is it working in sandbox ?
Coding is now a piece of cake
The administrator has disabled public write access.

linking to image on frontend 04 Nov 2014 11:25 #12740

  • cliffordsean
  • cliffordsean's Avatar
  • Offline
  • Senior Member
  • Posts: 47
  • Thank you received: 1
  • Karma: 1
many thanks and sorry - it was an SEF issue - i had to dissable the SEF component for that component

however follow on question


this works :

index.php?option=com_mycom&task=file&size=200x200&path=[DIR_DEAL_IMAGE]/lscape.jpg


but when i change the size parameter then i get issues

i get a NOT SUPPORTED message


thanks !
The administrator has disabled public write access.

linking to image on frontend 04 Nov 2014 12:39 #12741

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 987
  • Karma: 140
This is a security.

The allowed dimensions are stored on the top of the image class file.
It is not the best place to set up the allowed dimensions, but for the moment I didn't rewrited this class yet, it is old code but working nice and stable.

Why such security ?

1. Because a thumb file is created for each size (hidden file), so if somebody want to ennoy you, he just need a script which call an infinity of combinaisons, and fill you server.
2. Because if the size is too big, it will consume a lot of CPU.

This one is easy to fix.
Open :
classes / image.php

Add some sizes in the constant in top of the class.
Coding is now a piece of cake
The administrator has disabled public write access.
Time to create page: 0.060 seconds

Get Started