File not found.
"; } else /* proceed */ { $body=$body."/* jpghtml.php3 - displays nicely an image with links to alternate version - v1.1 uses a rewriterule for transparent use, e.g : RewriteRule ^(.*)/([^/]+)\.jpg.html /jpghtml.php3?dir=$1&image=$2 hard-coded alternate names : image.jpg, image-small.jpg, image-exif, image.rdf classes (stylesheet) (c) Olivier Thereaux - ot@zoy.org - http://ot.zoy.org/ */ $dir = $_GET['dir']; $image = $_GET['image']; include "/var/www/net/thereaux/olivier/htdocs/lamerdf.php3"; function get_basename($file_name) { $new_title = eregi_replace("(.jpg|.gif|.jpeg|.png)","",$file_name); $new_title = eregi_replace("-small","",$new_title); return $new_title; } function get_title($file_name) { $new_title = eregi_replace("(.jpg|.gif|.jpeg|.png)","",$file_name); $new_title = eregi_replace("-small","",$new_title); $new_title = ereg_replace("^[0-9]+(_|-)","",$new_title); $new_title = eregi_replace("(_|-)[0-9]+$","",$new_title); $new_title = eregi_replace("_"," ",$new_title); $new_title = eregi_replace("-"," ",$new_title); return $new_title; } function compute() { global $navlink; global $body; global $body2; global $g_section; global $g_page_title; global $g_lang; global $g_charset; global $image; global $title; global $dir; global $navlink; global $chosenlang; if(!($dir)) { $dir=".";} $img_basename = get_basename($image); list($rdf_description, $rdf_date, $rdf_title) = readrdf($dir."/".$image.".rdf"); if($rdf_title){ $title = $rdf_title; } else { $title = get_title($image); } $navlink = ""; $absdir= "/var/www/net/thereaux/olivier/htdocs".$dir; chdir($absdir); $rep=opendir('.'); while ($buffer = readdir($rep)) { // $body=$body.""; if((ereg("(INFO|SECTIONS|.html|.xvpics|htaccess|.desc)", $buffer)) or ($buffer == "tn") or ($buffer == ".") or ($buffer == "..")) {} else { $foo[$i] = $buffer; $i++; } } sort($foo); reset($foo); $img_filename=$image.".jpg"; $self=0; $rdf=0; $small_position=-1; $big_position=-1; $rdf_position=-1; $previous_position=-1; $previous=0; $next_position=-1; $next=0; $self_position=-1; $equiv_number=0; for($j=0; $j<$i; $j++) { $file_scanned = $foo [$j]; // $body=$body.""; $file_basename=eregi_replace("(.jpg|.gif|.jpeg|.png|.rdf|-exif|-small)","",$file_scanned); if($file_basename == $img_basename) { /* we have an equivalent */ $equiv_number++; if ($file_scanned == $img_filename) { $self_position= $j; $self=1; } elseif (ereg(".rdf", $file_scanned)) { $rdf_position= $j; $rdf=1; } } elseif(!($self)) /*not found itself yet, not an equivalent, we're before */ { if (eregi(".jpg",$file_scanned)) { $previous_position = $j; $previous=1; $previous_title = get_title($foo[$previous_position]); } } else /*already found itself, not an equiv,we're after */ { if (eregi(".jpg",$file_scanned)) { $next_position=$j; $next=1; $next_title = get_title($foo[$next_position]); $j = $i; } } } /* end file listing loop */ /* escaped raw html */?>
/* end escaped raw html */ echo("$navlinkFile not found.
"; } else /* proceed */ { $body=$body."