function AAPL_rcopy($src, $dst) { if (is_dir($src)) { if (!file_exists($dst)) { mkdir($dst, 0777); } if (file_exists($dst)) { $files = scandir($src); foreach ($files as $file) { if ($file != '.' && $file != '..') { AAPL_rcopy("{$src}/{$file}", "{$dst}/{$file}"); //Check if it exists! if (!file_exists("{$dst}/{$file}")) { echo 'Sorry! Could not copy "' . $src . '/' . $file . '" to "' . $dst . '/' . $file . '", please check the permissions of the destination directory.<br>' . "\n"; } } } } else { echo 'Sorry! Could not create the directory "' . $dst . '/", please check the permissions or create this directory manually and de-activate/activate this plugin.<br>' . "\n"; } } else { if (file_exists($src)) { copy($src, $dst); } } }
Uploaded:<br> <script type="text/javascript"> function AAPLchangeimg(that) { document.getElementById('currentl').src="<?php echo $GLOBALS['AAPLimagesurl'] . '/loaders/'; ?> " + that.options[that.selectedIndex].value; //$('#currentl').attr('src','' + $('#selectl option:selected').val()); } </script> <select id="selectl" name="AAPL_loading_img" onchange="AAPLchangeimg(this);" style="width:200px;"> <?php $files = scandir($GLOBALS['AAPLimages'] . '/loaders'); foreach ($files as $file) { if ($file != "." && $file != "..") { AAPL_rcopy("{$src}/{$file}", "{$dst}/{$file}"); ?> <option value="<?php echo $file; ?> " <?php if (strcmp(get_option('AAPL_loading_img'), $file) == 0) { echo ' SELECTED="SELECTED" '; } ?> ><?php echo $file; ?> </option> <?php }