$ppg) { $pg=str_replace(array("~","#",".phs"),"",$ppg); if (substr($ppg,0,1)=='~') $pg=($ppg=='~rwhgal1.phs' ? 'rwhgal1' : "$pg.txt"); $_g['pages'][$pg][0]=$pg; $imt=substr($imt,1); $ofullist["$imt|$pg"]=array($imt,$pg); } ksort($_g['pages']); ksort($ofullist); $do.="Sources\n\n
imindex.txtdynamic scan\n"; foreach ($_g['pages'] as $pgi) { $do.="
{$pgi[0]}{$pgi[1]}\n"; } $do.="
\n
\n\n"; $do.="JPGs in SQL but not in ". "Work in progress: \"SQL\":\n"; $sres=do_query("select * from general where gal='cw' and width>0"); $row = mysql_fetch_assoc($sres); while ($row!=FALSE) { $_g['sqlist'][$row['frameno']]=array('frameno'=>$row['frameno']); if (isset($_g['fullist']["{$row['frameno']}|rwhgal1"])) $_g['fullist']["{$row['frameno']}|rwhgal1"]['s']=$row['seqno']; else $do.="{$row['frameno']} "; $row=mysql_fetch_assoc($sres); } $do.="
\nEnd of list. ". count($_g['sqlist']) ." JPGs in SQL

\n"; $do.="JPGs detected during file scan but not in SQL:\n"; foreach ($_g['nams'] as $frameno) { if (!isset($_g['sqlist'][$frameno])) $do.="$frameno "; } $do.="
\nEnd of list.

\n"; $do.="JPGs in old full list but not in new full list:
\n"; foreach ($ofullist as $key => $oli) { if (!isset($_g['fullist'][$key])) { $do.="{$oli[0]},{$oli[1]}". (isset($_g['nams'][$oli[0]]) ? ",known" : ",gone "); $_g['fullist'][$key]=array($oli[0],$oli[1],'o'); } } $do.="
\nEnd of list.

\n"; $do.="JPGs in new full list other than those in rwhgal1 but not in old full list:
\n"; foreach ($_g['fullist'] as $key => $li) { if (!isset($ofullist[$key]) && $li[1]!='rwhgal1') { $do.="{$li[0]},{$li[1]} "; $_g['fullist'][$key][2]='n'; } } $do.="
\nEnd of list.

\n"; ksort($_g['fullist']); # $do.="\n"; # foreach ($_g['fullist'] as $li) { $do.="
{$li[0]}{$li[1]}{$li[2]}\n"; } # $do.="
\n"; $do.=count($_g['fullist']) ." ". count($_g['nams']); reset($_g['fullist']); $li=current($_g['fullist']); do { unset($ta); do { if ($li[1]=='rwhgal1') $ta['g']=$li; else $ta[]=$li; $pli=$li; $li=next($_g['fullist']); } while ($pli[0]==$li[0]); # $do.=var_export($ta,true) ."
\n"; $j1=0; do { $g1l=(!isset($ta['g']) ? "" : ""); $otl=$ta[$j1][0]; if (isset($ta[$j1]) && $ta[$j1][2]!='o') { if (substr($ta[$j1][1],-4)=='.txt') { $otl="tplated.php?f="; $ta[$j1][1]=substr($ta[$j1][1],0,strlen($ta[$j1][1])-4); } elseif (substr($ta[$j1][1],-4)!='.php') $otl="cowitin.php?f="; else $otl=""; $otl="{$ta[$j1][0]}"; } $opi="". ($j1 ? "+" : "") ."{$ta[$j1][2]}"; switch (2*isset($ta['g'])+isset($ta[$j1])) { case 1: $opi.="$otl\n"; break; case 2: $opi.="$g1l{$ta['g'][0]}\n"; break; case 3: $opi.="{$g1l}g1\n$otl\n"; break; } $opa[]=$opi; unset($ta['g']); } while ($ta[++$j1]); } while ($li); $numcols=5; $lk="\n". "Contents    \n". "Post List    \n". "Gallery\n"; echo "\n". "\n"; $colength=floor((count($opa)+$numcols-1)/$numcols); reset($opa); $jda=0; for ($colct=0; $colct<$numcols; $colct++) { echo "" : ">"); echo "\n\n
". "Coal and Wine Tax posts - numerical index to pictures\n". "$lk
 \n". "
\n"; for ($j1=0; $j1<$colength; $j1++, $jda++) { echo $opa[$jda]; } echo "
\n\n"; } echo " \n$lk\n \n". "". php_file_date() ."". html5_validator_link() ."\n". "\n\n$do\n\n\n"; exit; # --------------------- obsolete ---------- $numcols=9; $lk="\n". "Contents    \n". "Post List    \n". "Outtakes\n". ""; ?>
Coal and Wine Tax posts - numerical index to pictures
 
\n\n"; for ($j1=0; $j1<$colength; $j1++) { list($imnam,$filnam)=each($oldata); $mnam=substr($imnam,1); $uri=( substr($filnam,1,7)=="rwhgal1" ? "/phots/rwhgal1.php?g=cw&fmt=v&minth=999" : str_replace(array("~", "#", ".phs"), array("tplated.php?f=","cowitin.php?f="),$filnam) ) . "#JP". rawurlencode($mnam); $jdf++; # intentionally pointing one forward if ($imnam) { echo "$mnam". ($dupfl[$jdf] ? " +" : "") ."
\n"; } } } ?>
   \n". "
". php_file_date() ."". html5_validator_link() .""; ?>
'tplated.php', 'wip_sou.txt' => 'tplated.php', 'postrash.txt' => 'tplated.php', 0 => 'http://rhaworth.net/phots/rwhgal1.php?g=cw&minth=9999', 1 => 'http://rhaworth.net/cowi/postlist.php', 'postlist.php'=>'', 'imageidx.php' => '', ); $dirar=scandir("."); foreach ($dirar as $fnam) { if (!is_dir($fnam) && !isset($ress[$fnam])) { scan1file($fnam,$fnam); } } foreach ($ress as $txf => $res) { if (strlen($res)) { if (strlen($txf)<2) { scan1file($res,$txf ? 'postlist.php' : 'rwhgal1'); } else { scan1file(($_g['islocal'] ? "http://localhost/homp/rh.net/web/httpdocs" : "http://rhaworth.net") . "/cowi/$res?f=". substr($txf,0,strlen($txf)-4),$txf); } } } ksort($_g['fullist']); ksort($_g['nams']); ksort($_g['pages']); } function scan1file($fnam,$snam) { global $_g; $tx=file_get_contents($fnam); $jt= $js= 0; while (true) { $jt=stripos($tx,"