<?php
// one_image_website_generic_changes.php
// April, 2026

$res='';

if (isset($_POST['offdr'])) {
   $res='<p>Nothing to do.</p>';
   if ($_POST['offdr'] != '') {
     if (file_exists($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['offdr'])))) {
       foreach(glob($_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . str_replace('+',' ',urldecode($_POST['offdr'])) . DIRECTORY_SEPARATOR . '*[ph][th][pm]*') as $filename) {
          if (strpos($filename, 'GETME') === false && strpos($filename, 'backup') === false) {
          $cont=file_get_contents($filename);
          $newcont=$cont;
          $parts=explode('image_list = new Array();', $cont);
          $partsagain=explode('initthearr(image_list);', $cont);
          $partsscrone=explode('SCRIPT LANGUAGE=', $cont);
          $partsscr=explode('/onrightclick.js', $cont);
          if (basename($filename) == 'index.php') { // block up the top only
          } else if (basename($filename) == 'index.html' || basename($filename) == 'index.htm') { // fair few interventions and rearragements
          } else if (strpos(basename($filename),'.htm') !== false) { // one intervention, as required
          }
          if ($newcont != $cont) {
            file_put_contents($filename . '_backup', $cont);
            file_put_contents($filename, $newcont);
          }
          }
       }
     }
   }
}



?>
<html>
<body>
<?php echo $res; ?>
<form method=POST target=_self action='./one_image_website_generic_changes.php'>
<input type=text value='' placeholder='Eg. streetart' name=offdr id=offdr></input>
<input type=submit id=fsub value='Process this One Image Website folder HTML and PHP'></input>
</form>
</body>
</html>
