2011-07-10, 18:35:51
Cerulean Wrote:The generated code is
So the path to the image is inserted by the Custom Field, but it isn't available for processing when it is needed by the TimThumb script. I'm a PHP novice, but I imagine both scripts are executed at the same time rather than the Custom Field script running first to supply the path to the TimThumb script.Code:<img src="timthumb.php?src=http://yawp.co.nz/getsimple2/data/uploads/dreamstimefree_304388.jpg&w=200">
No! This is a web site: the execution is like this:
- the browser request a page
- a HTML is created on the server (here by calling index.php of GetSimple, which calls the I18N Custom Fields plugin) and sent to the browser
- the browser parses the HTML, recognizes the image URLs and sends requests for the images to the server
- the server serves the images (here by calling the timthumb script) and sends them to the browser
- the browser displays the images
Cerulean Wrote:But if the following is pasted into the browser address bar the resized image is created just fine.
Code:http://yawp.co.nz/getsimple2/timthumb.php?src=http://yawp.co.nz/getsimple2/data/uploads/dreamstimefree_304388.jpg&w=200
... which tells you that you should probably add the path to the image link.
Cerulean Wrote:mvlcek Wrote:You also need a path to the PHP script.In this case the TimThumb script is in the root so there is no path needed.
You don't need the path, if you switch off fancy urls (as the index.php and the timthumb.php are in the same directory). With fancy urls on and no path, if you are on page http://my.server/getsimple2/about/, the browser will request the image at http://my.server/getsimple2/about/timthumb.php?..., which is wrong.