I am attempting to change a small piece of code in a forum I run but cannot figure out how to actually return the string of an item contained in an array instead of getting the items position in the array.
Sorry if this does not seem to be making much sense but let me post a small snippet of the code to try to help:
array('select', 'pp_image_size', 'subtext' => $txt['pp_image_size_desc'], array('t', 's', 'm', 'l', 'x')),
The above code displays fine, exactly as it should, showing a drop down list called 'pp_image_size' and the list contains the relevent size strings 't' through to 'x'.
Now I am trying to use the above information to form a URL to grab a thumbnail image. The URL needs to incorporate a size variable, hence the drop down list. This is how the URL is formed:
return '<img src="http://pagepeeker.com/thumbs.php?size=' . $modSettings['pp_image_size'] . '&url=' . $url . '" alt="" />';
The problem I am getting is that the numerical value for the chosen strings position in the array is being used as the 'size' variable of the URL, which does not work.
What I need to do is actually have the string value of the size i.e. 't' and not '0', 's' and not '1' etc...
The finished URL should look like this, for example:
<img src="http://pagepeeker.com/thumbs.php?size=m&url=example.com" alt="" />
I really appreciate any help.
Edited by Cap'nKirk