Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

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

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

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

no unfortunately when i do that i get


404: Not Found
Sorry, but the page you requested could not be found.

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

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

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 !

Please Log in or Create an account to join the conversation.

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

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
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

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.134 seconds

Awards for the best Joomla app. This product is gonna win an award for this amazing job. Cook Self Service is the the best application from all over the Joomla universe ! It brings Joomla to a professional level really advanced for developers. It is a real fun to develop with it. The ACL part and security checks implementation are just... so much hours saved. I can now concentrate myself more on the design part and the creative works. Thank you so much. Guys I offer you all my congratulation ! Keep up the works because Joomla is needing it to increase the quality of extensions availables on the JED. I also learned a lot because I can see how to code at the proper place and I found all my answers reading the forum.
lack_hanson (JED)
          

Get Started