Image selection with form? - Post ID...

User 463868 Photo


Registered User
89 posts

Question: How would I get a Dropdown list to show a popup with a photo that the user uploaded to be able to show a selected frame around the photo?
I already know how to overlay the image but to toggle from one frame to another would be nice. I have quite a few frames to choice from. I'm assuming java but perhaps someone has already done it.
Thanks
hogansbassets.com
eagleeye360.com
freight360.us
User 463868 Photo


Registered User
89 posts

You can see what it is for at http://hogansbassets.com/CustomShotRecord.php
hogansbassets.com
eagleeye360.com
freight360.us
User 463868 Photo


Registered User
89 posts

I just found this and I think it will work with some tweaking...Any Comments welcome if you see something I don't. Thanks. Jon

18.4.2. How to choose images from a dropdown list
Isn't it more comfortable being able to choose the image for your review (if you are an administrator) from a dropdown list that offers the names of all available images in your image directory, rather than having to enter the full URL to the image each time? You could easily incorporate this functionality if you just cut and pasted the code from the admin/modules/topics.php file. The functionality is in the Topics module already - you don't need to write full URLs to the topics icons, do you?

The relevant part in the Reviews to introduce the code from the Topics module is the following code in modules/Reviews/index.php:

if(is_admin($admin)) {
echo "
<b>"._RIMAGEFILE.":</b><br>
<input type=\"text\" name=\"cover\" size=\"40\" maxlength=\"100\"><br>
<i>"._RIMAGEFILEREQ."</i><br><br>
";
}
Replace it with:
if(is_admin($admin)) {
echo "
<b>"._RIMAGEFILE.":</b><br>
echo "<select name="cover">";
$path1 = explode ("/", "images/reviews/");
$path = "$path1[0]/$path1[1]";
$handle=opendir($path);
while ($file = readdir($handle)) {
if ( (ereg("^([_0-9a-zA-Z]+)([.]{1})([_0-9a-zA-Z]{3})$",$file))
AND $file != "AllTopics.gif") {
$tlist .= "$file ";
}
}
closedir($handle);
$tlist = explode(" ", $tlist);
sort($tlist);
for ($i=0; $i < sizeof($tlist); $i++) {
if($tlist[$i]!="") {
if ($topicimage == $tlist[$i]) {
$sel = "selected";
} else {
$sel = "";
}
echo "<option name="cover" value="$tlist[$i]" $sel>$tlist[$i]n";
}
}
echo "</select><br>";
echo "<i>"._RIMAGEFILEREQ."</i><br><br>
";
}


The part of code that was stolen from the Topics module (from the admin/modules/topics.php file) is between the blank lines in the above code. It will offer you a dropdown list of all images in the images/reviews folder. Just like with the topics images, you must use all small letters and no underscores or other special characters. See choose image for review.

hogansbassets.com
eagleeye360.com
freight360.us

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.