Hello again people:
Well, I'm trying to do this in a better way (server side).
So now I want to pass the user's screen width as a hidden field in a form. So, when I have that value on the server, I do the math and send the correct size image directly to the user, using phpThumb. If the user wants to download the full-size image, it just clicks on download button...
The problem is that I cannot make it work. I think that I will need a form for each thumb, so if you click on any of them, you will be always sending your screen with along with the URL.
Look what I have done (it's just a test approach, I have to use getElementbyId() function and assing the width value to the hidden field):
In functions.php, line 354 (may be other line, my functions.php is heavy modified, sorry I don't have the original code):
$thumb = "<form name=\"img".$image_id."\" \"id=\"img".$image_id."\" action=\"".$site_sess->url(ROOT_PATH."details.php?".URL_IMAGE_ID."=".$image_id.((!empty($mode)) ? "&mode=".$mode : ""))."\"><a onClick=\"document.img".$image_id.".submit()\">".$thumb."</a><input name=\"hsize\" type=\"hidden\" value=\"hola\" /></form>"
The result of this would be:
<form name="img58" id="img58" action="./details.php?image_id=58"><a onClick="document.img58.submit()"><img src="./data/thumbnails/5/IMG_0368_2.JPG" border="1" width="75" height="100" alt="ER 56" /></a><input name="hsize" type="hidden" value="hola" /></form>
As far as I can see, the link works, but it takes me directly to the homepage, instead of sending me to the action URL of the form.
I'm doing all OK?
There is another -simpliest- way to do what I want?.
Thanks in advance.
Best regards.
WR.