By Sc0tt on
Thanks in advance for your help.
In Drupal 5, I was able use <img src="/files/imagecache/970px/<?php print $field_picture[0]['filepath']; ?>" /> because ['filepath'] contained files/myimage.jpg creating the correct path src="/files/imagecache/970px/files/myimage.jpg".
In Drupal 6, I seem to be stuck with too much data in the ['filepath'] array:sites/default/files/images/2010/01/17/myimage.jpg
Is there a way to remove sites/default/files/ from the beginning of the array and end up with just images/2010/01/17/myimage.jpg ?
Thanks again,
Scott
Comments
=-=
In D5 the files folder was in the root. In D6 it is not by default.
Can anyone recommend an
Can anyone recommend an alternative method?
I tried using
but it didn't work.
Thanks again,
Scott
The code in my previous post
The code in my previous post does work with images contained within the node; but it wont work with a loaded node based on a CCK node reference. Here is what I am trying:
Any suggestions?
Thank you very much,
Scott
Removing sites/default/files
After hours of searching a way to print, in php, the filepath to an imagecache image preset, I did this :
et voilà.
Hope that will help.
David THOMAS
http://www.smol.org