Unable to open remote file.
"; exit;} while (!feof($fp)) { $line = fgets($fp, 2048); $out = array($line); list($K,$V)=split("\:",$out[0]); if ($K=="LOC") $Loc=rtrim($V); if ($K=="DIR") $Dir=rtrim($V); }#end while fclose($fp); #===================== process POST data $cnt=0;$Chk[0]="";$Txt[0]=""; foreach ($_POST as $key => $value) { if ($value=="XXXX") { if ($Chk[$i]=="on")$Chk[$i]=""; else $Chk[$i]="#"; $cnt++;$i=""; #increment cnt and reset variables }#end if if (substr($key,0,9)=="photo_nam"){ $i=substr($key,9); $Name[$i]=$value; } if (substr($key,0,9)=="photo_txt"){ $Txt[$i]=$value; $Txt[$i]=str_replace("\\","",$Txt[$i]); #deal with \ on meta chars $Txt[$i]=str_replace("\"","'",$Txt[$i]); #convert quotes to apostrophes } if (substr($key,0,9)=="photo_chk"){$Chk[$i]=$value;} if (substr($key,0,9)=="photo_dir"){$Fldr[$i]=$value;} if (substr($key,0,9)=="photo_srt"){$Sort[$i]=$value;} if ($Fldr[$i]=="")$Fldr[$i]=$Dir; if ($key=="SelChk") $radio=$value; }#end foreach #===================== Synchronize POST and .lst $fp1=fopen("PhotoMgr_continue.htm","w+"); #prepare a redirect html file fwrite($fp1,""."\n"); fclose($fp1); $fp=fopen($LstFile,"r"); # read existing .lst file to make sure synchronized with POST variables if (!$fp) {echo "Unable to open remote file.
"; exit;} $Ext=0;$j=0; while (!feof($fp)) { #get last line from .lst file $n=$Name[$j++]; $f=fgets($fp); $out = array(trim($f)); list($a,$f1,$b)=split("~",$out[0]); $f1=substr($f1,0,strlen($f1)-4); if ($n!=$f1)$Ext=1; #if names are not same, set flag to avoid corrupting .lst file }#end while if ($Ext==1&&$cnt>0){ # if last image names not same AND not initial session prepare to abort $fp1=fopen("PhotoMgr_continue.htm","w+"); # re-write redirect html file to pause fwrite($fp1,"Unable to open remote file.
"; exit;} while (!feof($fp)) { $line = fgets($fp); list($Fldr[$cnt],$N,$Txt[$cnt])=split("~",trim($line)); $Txt[$cnt]=str_replace("\"","'",$Txt[$cnt]); #convert quotes to apostrophes $Name[$cnt]=substr($N,0,strlen($N)-4); if (substr($Fldr[$cnt],0,1)=="#"){ $Chk[$cnt]=""; $Fldr[$cnt]=substr($Fldr[$cnt],1); }#end if else $Chk[$cnt]="CHECKED"; if ($radio=="A" ||($radio=="C"&&$Chk[$cnt]=="CHECKED") ||($radio=="N"&&$Chk[$cnt]=="") )$Visible[$cnt]=1; else $Visible[$cnt]=0; $cnt++; }#end while fclose($fp); for ($i=0;$i<$cnt;$i++)$DirHash[$Fldr[$i]]=0; #initialize DirHash for ($i=0;$i<$cnt;$i++)if ($Visible[$i]==1)++$DirHash[$Fldr[$i]]; #Make a count visible lines in each Folder $dNo=0;foreach ($DirHash as $key => $value) {if ($key!=""){ $dir[$dNo]=$key; $dNo++; }}sort($dir); #===================== Write .htm file $fp=fopen($HtmFile,"w+"); $s="| Q&D instructions: |
| 1) Allow sufficient time for ALL images to load before making changes. |
| 2) First select photos with check boxes on left of image. |
| 3) Press 'SAVE' button to commit selections. |
| 4) Use radio buttons to show only selected photos. |
| 5) Group photos by modifying folder name in 'Folder' text boxes. |
| 6) Add captions to photo using text boxes on right. |
| 7) Alter ordering within Folders by changing number in Sort box on right. |
| 8) Use Folder Links to navigate among folder groups. |
| 9) Clicking on small image will launch a larger image in another window. |
| |
| C.B.Snow, 6/30/2005 |