0) $title= mysql_result($return,0); $album= "album/"; if($title == ""){ $album= ""; $title= mysql_result(dbdata("select g_pathComponent from g2_FileSystemEntity where g_id = '".$match[1]."'"),0); $title= preg_replace("/\.(?:jpg|png|gif)/i","",$title); } $title= str_replace(" ","_",$title); $url .= "gallery/".$album.$id."-".$title; break; case "galleryrewrite": preg_match("@gallery/(?:album/|)(\d*)-.*$@",$_SERVER['REQUEST_URI'],$match); if (!mysql_select_db("gallery2", $verbindung)) die("moepE"); $result= dbdata("select *,g_pathComponent from g2_ChildEntity,g2_FileSystemEntity where g2_ChildEntity.g_id=g2_FileSystemEntity.g_id and g2_ChildEntity.g_id=".$match[1]); while ( mysql_num_rows($result) > 0 ) { $row= mysql_fetch_assoc($result); $pfad= $row['g_pathComponent']."/".$pfad; $result= dbdata("select *,g_pathComponent from g2_ChildEntity,g2_FileSystemEntity where g2_FileSystemEntity.g_id=g2_ChildEntity.g_id and g2_ChildEntity.g_id=".$row['g_parentId']); } $url.= "v".$pfad; $result= mysql_fetch_assoc(dbdata("select * from g2_Entity where g_id = ".$match[1])); if( $result['g_entityType'] == "GalleryPhotoItem" ) { $url= substr($url,0,strlen($url)-1); $url.= ".html"; } break; } echo $redir; header($redir); header("Location: $url"); ?>