$val) { if (substr($nam,0,3)=='chk') { if (!isset($_g['row-hue'])) { echo "Renaming files in {$_REQUEST['dm']}\n". "\n"; } $chgno=substr($nam,3); $wasnam=$_REQUEST["was$chgno"]; $newpath="$vhroot{$_REQUEST['dm']}/". ($newnam=$_REQUEST["new$chgno"]); echo tr_tag() ."
$wasnam$newnam\n". (file_exists($newpath) ? "new name already exists\n" : (rename("$vhroot{$_REQUEST['dm']}/$wasnam",$newpath) ? "renamed\n" : "rename failed\n") ); } } } if (isset($_g['row-hue'])) { echo "
\n
\n\n"; } if (isset($_REQUEST['transp'])) { $fn=$_REQUEST['dc']; $_REQUEST['dc']=$_REQUEST['dm']; $_REQUEST['dm']=$fn; } echo "
\n". "". "
 
". "  First directory - relative to $vhroot
\n". "
 
". "". "  Second directory - ditto - names modifiable
\n". "     ". "\n". "

\n\n"; echo "

\n\n"; $flm=scandir($vhroot.$_REQUEST['dm']); $flc=scandir($vhroot.$_REQUEST['dc']); foreach($flm as $fn) { $fp="$vhroot{$_REQUEST['dm']}/$fn"; if (!is_dir($fp)) { $shasm[sha1_file($fp)][]=$fn; $ffm[$fn]=0; } } $act_sub="\n"; $miss_td=" missing "; $_g['row-hue']=""; $_g['chgno']=1000; echo "
\n". "\n". "\n". "\n\n$act_sub\n". "$miss_td
{$_REQUEST['dc']}\n". "
{$_REQUEST['dm']}\n\n"; foreach($flc as $fn) { $fp="$vhroot{$_REQUEST['dc']}/$fn"; if (!is_dir($fp)) { $inputype=0; $sha=sha1_file($fp); if (!isset($shasm[$sha])) { echo tr_tag() ."$fn"; if (isset($ffm[$fn])) { echo "$fndifferent\n"; $ffm[$fn]=1; change_line($fn,""); } else { echo "$miss_td\n"; } } else foreach($shasm[$sha] as $fnothr) { echo tr_tag() ."$fn$fnothr"; if ($fn==$fnothr) { echo "identical\n"; } else { echo "same\n"; change_line($fnothr,$fn); } unset($ffm[$fnothr]); } } } foreach($ffm as $fnothr => $status) { if (!$status) echo "
$fnothr\n"; } echo "\n$act_sub
\n
\n"; ?>
 
". "Change? ". "\n"; $_g['chgno']++; } /* . in an input name gets changed to _ during the posting process */ function tr_tag() { global $_g; $_g['row-hue']=(strlen($_g['row-hue']) ? "" : " style='background: #FEE'"); return ""; } ?>