Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $text .= "
- <script language=\"javascript\">
- <!--
- function showimageraffle()
- {
- if (!document.images)
- returndocument.images.picturesr.src=\'/e107_plugins/raffle/images/raffles/\" + document.edit_raffle.raf_image.options[document.edit_raffle.raf_image.selectedIndex].value + \".png\"
- }
- //-->
- </script>";
- $text .="<fieldset>";
- $dir = dirname(__FILE__)."/images/raffles/";
- if ($raf_image){
- $text .= "<img src=\"/e107_plugins/raffle/images/raffles/".$raf_image.".png\" name=\"picturesr\" height=\"25\">";
- } else {
- $text .= "<img src=\"/e107_plugins/raffle/images/no_image.png\" name=\"picturesr\" height=\"25\">";
- }
- $text .= "<select name=\"raf_image\" size=\"1\" onChange=\"showimageraffle()\"><option value=\"\">None</option>";
- $files = scandir($dir);
- foreach ($files as $entry) {
- if ( substr($entry, 0, 1)=='.' ) continue;
- $dotpos = strrpos($entry, '.');
- if ($dotpos) {
- $ext = substr($entry, $dotpos+1);
- if ($ext === 'jpeg' || $ext === 'gif' || $ext === 'png' || $ext === 'jpg') {
- $entry=substr_replace($entry, '', $dotpos);
- if ($entry==$raf_image) {
- echo "<option selected=\"selected\" value=\"".$entry."\">".$entry."</option>\n";
- }
- else {
- echo "<option value=\"".$entry."\">".$entry."</option>\n";
- }
- }
- }
- }
- $text .= "</select></fieldset>";
Add Comment
Please, Sign In to add comment