sortfile // (and then edit with vi) // //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // config.php - these settings are the default ones. You can either // change them here or create a file called "config.php" // that contains override settings. The advantage of a // separate file is that you can upgrade the script and // keep all your settings. $title = "Our 1973 Boler"; // Title for the overall web page $marginsize = 150; // Size of the side frame, and thumbnails $marginside = "left"; // Margin frame location: "left" or "right" $thumb = "thumb"; // Sub-directory where thumbnails are stored $imagequality = 70; // Quality of reduced images, range 0 - 100 $fullwindow = false; // Display images to fill browser window? $imageresize = 640; // You can rescale all images to fit within // a boundary square of this size (eg 800). // These rescaled images are cached on disk. // To just use original images, specify 0 $pagecolor = "#FFFFFF"; // Background color of all pages $textcolor = "#000000"; // Text color for all pages $linkcolor = "#000055"; // Link color for all pages $vlinkcolor = "#550055"; // Visited link color for all pages $background = ""; // Background image for all pages $stylesheet = ""; // Full URL to a stylesheet for all pages. // HTML text tags used:

,

,, $lang = "en"; // Language: ba/br/ca/de/dk/ee/en/es/fi/fr/gb/gr/it/nl/no/pl/pt/ru/se/tr $introfile = "intro.html"; // If it exists, will be displayed up front $headerfile = "header.html"; // If it exists, will be included at top $footerfile = "footer.html"; // If it exists, will be included at bottom $sortfile = "sortfile"; // If it exists, contains filenames in order $sortreverse = false; // If true, then the sort order is reversed $datenames = false; // If true, then assumes the filenames have // been named starting with the date YYYYMMDD $password = "blender"; // This password enables admin mode, for // editing captions, deleting guest comments, // uploading new images, deleting images etc // If left blank "" then admin is disabled $moderate = false; // If true, then guest comments will not be // automatically added to the pages. Only // the admin user will be able to see them // and they have a little "approve" link to // release them to the public. This only // works if $password and $guestcomment are on $guestcomment = false; // If true, then guests can leave comments $recentcount = 10; // How many 'recent' comments to show $email = ""; // If you put your email address here then // new guest comments will be mailed to you // ... PHP must already support mail. $timeoffset = 0; // By how many hours do you want to offset the // the server time when displaying messages. // 0 = server time, "8.5" = add 8:30, "-4" = subtract 4:00 $imagemethod = "imagemagick"; // gd1, gd2, imagemagick, manual, none // gd1 - gd 1.* compiled into PHP // gd2 - gd 2.* compiled into PHP 4.0.6 or later // imagemagick - use imagemagick "convert" and "identify" // manual - create your own thumbnails elsewhere // none - don't use thumbnail images $captionmethod = "rdjpgcom"; // rdjpgcom, imagemagick, capfile, filename, none // rdjpgcom - use rdjpgcom program, part of libjpeg // imagemagick - use imagemagick program "identify" // capfile - use thumb/filename.jpg.cap files // filename - just use the filename as the caption // none - don't use any captions on images // Depending on what you chose for $imagemethod and $captionmethod, set these: $convert = "/usr/local/bin/convert"; // Path to Imagemagick "convert" program $identify = "/usr/local/bin/identify"; // Path to Imagemagick "identify" program $rdjpgcom = "/usr/local/bin/rdjpgcom"; // Path to rdjpgcom program, if needed. $wrjpgcom = "/usr/local/bin/wrjpgcom"; // If you are using rdjpgcom, set this too // so admin can update (write) image captions //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// /// Normally, you won't need to change anything below here //////////////////////////////////////////////////////////////////////////////// if (file_exists("config.php")) { // Settings in here will override defaults include("config.php"); } if (isset($HTTP_SERVER_VARS["PATH_TRANSLATED"])) { // Name of this file $scriptname = basename($HTTP_SERVER_VARS["PATH_TRANSLATED"]); } else { $scriptname = "index.php"; } /// Language Strings /// // English - en $ss["en"]["next"] = "Next"; $ss["en"]["prev"] = "Previous"; $ss["en"]["slide"] = "Slideshow"; $ss["en"]["comments"]= "Comments"; $ss["en"]["name"] = "Name"; $ss["en"]["message"] = "Message"; $ss["en"]["add"] = "Add my message to this page"; $ss["en"]["start"] = "Back to the start"; $ss["en"]["selectl"] = "Select images from the left"; $ss["en"]["selectr"] = "Select images from the right"; $ss["en"]["from"] = "From"; $ss["en"]["recent"] = "most recent guest comments"; $ss["en"]["seconds"] = "seconds"; $ss["en"]["original"]= "Click here to see the full-sized version of this image"; // Deutsch - de $ss["de"]["next"] = "Nächstes"; $ss["de"]["prev"] = "Vorheriges"; $ss["de"]["slide"] = "Slideshow"; $ss["de"]["comments"]= "Kommentare"; $ss["de"]["name"] = "Name"; $ss["de"]["message"] = "Kommentar"; $ss["de"]["add"] = "Meinen Kommentar abschicken"; $ss["de"]["start"] = "zum Anfang"; $ss["de"]["selectl"] = "Bitte wählen sie links ein Bild aus"; $ss["de"]["selectr"] = "Bitte wählen sie rechts ein Bild aus"; $ss["de"]["from"] = "Von"; $ss["de"]["recent"] = "neueste Gastanmerkungen"; $ss["de"]["seconds"] = "Sekunden"; $ss["de"]["original"]= "Click here to see the full-sized version of this image"; // Nederlands - nl // Thanks to Rob Heijmen! $ss["nl"]["next"] = "Volgende"; $ss["nl"]["prev"] = "Vorige"; $ss["nl"]["slide"] = "Diashow"; $ss["nl"]["comments"]= "Commentaar"; $ss["nl"]["name"] = "Naam"; $ss["nl"]["message"] = "Melding"; $ss["nl"]["add"] = "Voeg mijn melding toe"; $ss["nl"]["start"] = "Terug naar het begin"; $ss["nl"]["selectl"] = "Selecteer afbeeldingen aan de linker zijde"; $ss["nl"]["selectr"] = "Selecteer afbeeldingen aan de rechter zijde"; $ss["nl"]["from"] = "Van"; $ss["nl"]["recent"] = "meest recente commentaar"; $ss["nl"]["seconds"] = "seconden"; $ss["nl"]["original"]= "Klik hier om de foto in z'n originele formaat te zien"; // Francais - fr // Thanks to Olivier Paul! $ss["fr"]["next"] = "Suivant"; $ss["fr"]["prev"] = "Précédent"; $ss["fr"]["slide"] = "Présentation"; $ss["fr"]["comments"]= "Commentaires"; $ss["fr"]["name"] = "Nom"; $ss["fr"]["message"] = "Message"; $ss["fr"]["add"] = "Ajouter mon message à cette page"; $ss["fr"]["start"] = "Retour au départ"; $ss["fr"]["selectl"] = "Sélectionnez les images à partir de la gauche"; $ss["fr"]["selectr"] = "Sélectionnez les images à partir de la droite"; $ss["fr"]["from"] = "De"; $ss["fr"]["recent"] = "commentaires les plus récents de visiteurs"; $ss["fr"]["seconds"] = "secondes"; $ss["fr"]["original"]= "Click here to see the full-sized version of this image"; // Swedish - se // Thanks to Jörgen Silverplatz! $ss["se"]["next"] = "Nästa"; $ss["se"]["prev"] = "Föregående"; $ss["se"]["slide"] = "Bildvisning"; $ss["se"]["comments"]= "Kommentarer"; $ss["se"]["name"] = "Namn"; $ss["se"]["message"] = "Meddelande"; $ss["se"]["add"] = "Lämna ett meddelande"; $ss["se"]["start"] = "Till början"; $ss["se"]["selectl"] = "Välj bild från vänster"; $ss["se"]["selectr"] = "Välj bild från höger"; $ss["se"]["from"] = "Från"; $ss["se"]["recent"] = "Senaste gäst kommentarerna"; $ss["se"]["seconds"] = "sekunder"; $ss["se"]["original"]= "Click here to see the full-sized version of this image"; // Spanish - es // Thanks to Eddie Galvez! $ss["es"]["next"] = "Próximo"; $ss["es"]["prev"] = "Previo"; $ss["es"]["slide"] = "Slideshow"; $ss["es"]["comments"]= "Comentarios"; $ss["es"]["name"] = "Nombre"; $ss["es"]["message"] = "Mensaje"; $ss["es"]["add"] = "Agrega mi mensaje a esta página"; $ss["es"]["start"] = "Volver al comienzo"; $ss["es"]["selectl"] = "Selecciona imagenes a la izquierda"; $ss["es"]["selectr"] = "Selecciona imagenes a la derecha"; $ss["es"]["from"] = "De"; $ss["es"]["recent"] = "comentarios mas recientes"; $ss["es"]["seconds"] = "segundos"; $ss["es"]["original"]= "Click here to see the full-sized version of this image"; // Russia - ru // Thanks to Shamil! $ss["ru"]["next"] = "÷ÐÅÒÅÄ"; $ss["ru"]["prev"] = "îÁÚÁÄ"; $ss["ru"]["slide"] = "óÌÁÊÄ ÛÏÕ"; $ss["ru"]["comments"]= "ëÏÍÅÎÔÁÒÉÉ"; $ss["ru"]["name"] = "éÍÑ"; $ss["ru"]["message"] = "óÏÏÂÝÅÎÉÅ"; $ss["ru"]["add"] = "äÏÂÁ×ÉÔØ ÓÏÏÂÝÅÎÉÅ ÎÁ ÜÔÏÊ ÓÔÒÁÎÉÃÅ"; $ss["ru"]["start"] = "ë ÎÁÞÁÌÕ"; $ss["ru"]["selectl"] = "÷ÙÂÅÒÉÔÅ ÆÏÔÏÒÇÁÆÉÀ × ÌÅ×ÏÊ ÐÁÎÅÌÉ"; $ss["ru"]["selectr"] = "÷ÙÂÅÒÉÔÅ ÆÏÔÏÒÇÁÆÉÀ × ÐÒÁ×ÏÊ ÐÁÎÅÌÉ"; $ss["ru"]["from"] = "ïÔ"; $ss["ru"]["recent"] = "ÐÏÓÌÅÄÎÉÈ ÓÏÏÂÝÅÎÉÊ"; $ss["ru"]["seconds"] = "óÅËÕÎÄ"; $ss["ru"]["original"]= "Click here to see the full-sized version of this image"; // Italiano - it // Thanks to Sal! $ss["it"]["next"] = "Dopo"; $ss["it"]["prev"] = "Precedente"; $ss["it"]["slide"] = "Proiezione"; $ss["it"]["comments"]= "Commenti"; $ss["it"]["name"] = "Nome"; $ss["it"]["message"] = "Messaggio"; $ss["it"]["add"] = "Aggiungere il mio messaggio a questa pagina"; $ss["it"]["start"] = "Inizio"; $ss["it"]["selectl"] = "Seleziona le immagini a partire da sinistra"; $ss["it"]["selectr"] = "Seleziona le immagini a partire da destra"; $ss["it"]["from"] = "Da"; $ss["it"]["recent"] = "I commenti più recenti"; $ss["it"]["seconds"] = "Secondi"; $ss["it"]["original"]= "Click here to see the full-sized version of this image"; // Polish - pl // Thanks to Wojtek Fraczak! $ss["pl"]["next"] = "Nastepne"; $ss["pl"]["prev"] = "Poprzednie"; $ss["pl"]["slide"] = "Prezentacja"; $ss["pl"]["comments"]= "Komentarze"; $ss["pl"]["name"] = "Imie"; $ss["pl"]["message"] = "Komentarz"; $ss["pl"]["add"] = "Dorzuc komentarz"; $ss["pl"]["start"] = "Wroc na poczatek"; $ss["pl"]["selectl"] = "Wybierz zdjecie z lewej strony"; $ss["pl"]["selectr"] = "Wybierz zdjecie z prawej strony"; $ss["pl"]["from"] = "From"; $ss["pl"]["recent"] = "Ostatnie komentarze"; $ss["pl"]["seconds"] = "sekund"; $ss["pl"]["original"]= "Click here to see the full-sized version of this image"; // Norwegian - no // Thanks to Christian Rambjør! $ss["no"]["next"] = "Neste"; $ss["no"]["prev"] = "Forrige"; $ss["no"]["slide"] = "Bildevisning"; $ss["no"]["comments"]= "Kommentarer"; $ss["no"]["name"] = "Navn"; $ss["no"]["message"] = "Melding"; $ss["no"]["add"] = "Legg igjen en melding"; $ss["no"]["start"] = "Til Begynnelsen"; $ss["no"]["selectl"] = "Velg bilder fra venstre side"; $ss["no"]["selectr"] = "Velg bilder fra høyre side"; $ss["no"]["from"] = "Fra"; $ss["no"]["recent"] = "Siste kommentarene"; $ss["no"]["seconds"] = "Sekunder"; $ss["no"]["original"]= "Click here to see the full-sized version of this image"; // Finnish - fi // Thanks to Ante Mulari! $ss["fi"]["next"] = "Seuraava"; $ss["fi"]["prev"] = "Edellinen"; $ss["fi"]["slide"] = "Kuvaesitys"; $ss["fi"]["comments"]= "Kommentit"; $ss["fi"]["name"] = "Nimi"; $ss["fi"]["message"] = "Viesti"; $ss["fi"]["add"] = "Lisää viestini tälle sivulle"; $ss["fi"]["start"] = "Takaisin alkuun"; $ss["fi"]["selectl"] = "Valitse kuvat vasemmalta"; $ss["fi"]["selectr"] = "Valitse kuvat oikealta"; $ss["fi"]["from"] = "Tullut"; $ss["fi"]["recent"] = "viimeisimmät kommentit kävijöiltä"; $ss["fi"]["seconds"] = "sekunnit"; $ss["fi"]["original"]= "Click here to see the full-sized version of this image"; // Danish - dk // Thanks to Steffen Meyer! $ss["dk"]["next"] = "Næste"; $ss["dk"]["prev"] = "Forrige"; $ss["dk"]["slide"] = "Diasshow"; $ss["dk"]["comments"]= "Kommentarer"; $ss["dk"]["name"] = "Navn"; $ss["dk"]["message"] = "Kommentar"; $ss["dk"]["add"] = "Skriv en kommentar"; $ss["dk"]["start"] = "Til start"; $ss["dk"]["selectl"] = "Vælg billeder fra venstre"; $ss["dk"]["selectr"] = "Væ billeder fra højre"; $ss["dk"]["from"] = "Fra"; $ss["dk"]["recent"] = "Seneste kommentarer"; $ss["dk"]["seconds"] = "Sekunder"; $ss["dk"]["original"]= "Click here to see the full-sized version of this image"; // Estonian - ee // Thanks to Margo Poolak! $ss["ee"]["next"] = "Järgmine"; $ss["ee"]["prev"] = "Eelmine"; $ss["ee"]["slide"] = "Slaidid"; $ss["ee"]["comments"]= "Kommentaarid"; $ss["ee"]["name"] = "Nimi"; $ss["ee"]["message"] = "Teated"; $ss["ee"]["add"] = "Lisa"; $ss["ee"]["start"] = "Tagasi algusesse"; $ss["ee"]["selectl"] = "Vali pildid vasakult"; $ss["ee"]["selectr"] = "Vali pildid paremalt"; $ss["ee"]["from"] = "Tulnud"; $ss["ee"]["recent"] = "Viimased kommentaarid"; $ss["ee"]["seconds"] = "Sekundid"; $ss["ee"]["original"]= "Click here to see the full-sized version of this image"; // Greek - gr // Thanks to Petros Papaioannou! $ss["gr"]["next"] = "Åðüìåíï"; $ss["gr"]["prev"] = "Ðñïçãïýìåíï"; $ss["gr"]["slide"] = "ÐñïâïëÞ äéáöáíåéþí"; $ss["gr"]["comments"]= "Ó÷üëéá"; $ss["gr"]["name"] = "¼íïìá"; $ss["gr"]["message"] = "ÌÞíõìá"; $ss["gr"]["add"] = "Ðñüóèåóå ôï ìÞíõìÜ ìïõ ó'áõôÞí ôç óåëßäá"; $ss["gr"]["start"] = "Ðßóù óôçí áñ÷Þ"; $ss["gr"]["selectl"] = "ÅðÝëåîå ôéò åéêüíåò áðü ôá áñéóôåñÜ"; $ss["gr"]["selectr"] = "ÅðÝëåîå ôéò åéêüíåò áðü ôá äåîéÜ"; $ss["gr"]["from"] = "Áðü"; $ss["gr"]["recent"] = "ðéï ðñüóöáôá ó÷üëéá åðéóêåðôþí"; $ss["gr"]["seconds"] = "äåõôåñüëåðôá"; $ss["gr"]["original"]= "Click here to see the full-sized version of this image"; // Portugese - br // Thanks to Påulo ©avoto! $ss["br"]["next"] = "Próximo"; $ss["br"]["prev"] = "Anterior"; $ss["br"]["slide"] = "Slideshow"; $ss["br"]["comments"]= "Comentários"; $ss["br"]["name"] = "Nome"; $ss["br"]["message"] = "Mensagem"; $ss["br"]["add"] = "Adicionar meu comentário a essa página"; $ss["br"]["start"] = "Voltar ao início"; $ss["br"]["selectl"] = "Selecionar imagens pela esquerda"; $ss["br"]["selectr"] = "Selecionar imagens pela right"; $ss["br"]["from"] = "De"; $ss["br"]["recent"] = "comentários mais recentes"; $ss["br"]["seconds"] = "segundos"; $ss["br"]["original"]= "Clice aqui para ver a imagem no seu tamanho original"; // Portugese - pt // Thanks to Carlos Ribeiro! $ss["pt"]["next"] = "Próximo"; $ss["pt"]["prev"] = "Anterior"; $ss["pt"]["slide"] = "Slideshow"; $ss["pt"]["comments"]= "Comentários"; $ss["pt"]["name"] = "Nome"; $ss["pt"]["message"] = "Mensagem"; $ss["pt"]["add"] = "Adicionar a minha mensagem"; $ss["pt"]["start"] = "Voltar ao início"; $ss["pt"]["selectl"] = "Selecione as imagens da esquerda"; $ss["pt"]["selectr"] = "Selecione as imagens da direita"; $ss["pt"]["from"] = "De"; $ss["pt"]["recent"] = "comentários mais recentes dos visitantes"; $ss["pt"]["seconds"] = "segundos"; $ss["pt"]["original"]= "Clice aqui para ver a imagem no seu tamanho original"; // Chinese (Simplified) gb2312 // Thanks to weijh! $ss["gb"]["next"] = "ÏÂÒ»ÕÅ"; $ss["gb"]["prev"] = "Ç°Ò»ÕÅ"; $ss["gb"]["slide"] = "»ÃµÆƬÏÔʾ"; $ss["gb"]["comments"]= "ÆÀÂÛ"; $ss["gb"]["name"] = "Ãû×Ö"; $ss["gb"]["message"] = "ÄÚÈÝ"; $ss["gb"]["add"] = "¼ÓÈëÎÒ¶ÔͼƬµÄÆÀÂÛ"; $ss["gb"]["start"] = "ÖØÍ·¿ªÊ¼¿´"; $ss["gb"]["selectl"] = "´Ó×ó±ßÑ¡ÔñͼƬ"; $ss["gb"]["selectr"] = "´ÓÓÒ±ßÑ¡ÔñͼƬ"; $ss["gb"]["from"] = "¿´¿Í"; $ss["gb"]["recent"] = "¸ö×îеĿ´¿ÍÁôÑÔ"; $ss["gb"]["seconds"] = "Ãë"; $ss["gb"]["original"]= "Click here to see the full-sized version of this image"; // Bosanski - ba // Thanks to E C! $ss["ba"]["next"] = "Slijedeca"; $ss["ba"]["prev"] = "Prosla"; $ss["ba"]["slide"] = "Automatski pregled"; $ss["ba"]["comments"]= "Komentar"; $ss["ba"]["name"] = "Ime"; $ss["ba"]["message"] = "Poruka"; $ss["ba"]["add"] = "Proslijedi poruku"; $ss["ba"]["start"] = "Nazad na pocetak"; $ss["ba"]["selectl"] = "Selektiraj slike na lijevoj strani"; $ss["ba"]["selectr"] = "Selektiraj slike na desnoj strani"; $ss["ba"]["from"] = "Od"; $ss["ba"]["recent"] = "Resentni komentar"; $ss["ba"]["seconds"] = "sekundi"; $ss["ba"]["original"]= "Click here to see the full-sized version of this image"; // Turkish - tr // Thanks to Önder Cardakli! $ss["tr"]["next"] = "Ileri"; $ss["tr"]["prev"] = "Geri"; $ss["tr"]["slide"] = "Slideshow"; $ss["tr"]["comments"]= "Düsünceleriniz"; $ss["tr"]["name"] = "Adiniz, Soyadiniz"; $ss["tr"]["message"] = "Kommentar"; $ss["tr"]["add"] = "Düsüncelerimi yolla"; $ss["tr"]["start"] = "Anasayfa"; $ss["tr"]["selectl"] = "Lütfen sol tarafdan bir Fotoraf secin"; $ss["tr"]["selectr"] = "Lütfen sag tarafdan bir Fotoraf secin"; $ss["tr"]["from"] = "Yazar"; $ss["tr"]["recent"] = "En son eklenen"; $ss["tr"]["seconds"] = "Saniye"; $ss["tr"]["original"]= "büyültmek icin lütfen buraya tikla"; // Catala - ca // Thanks to Àngel "muzzol" Bosch $ss["ca"]["next"] = "Següent"; $ss["ca"]["prev"] = "Anterior"; $ss["ca"]["slide"] = "Projecció de diapositives"; $ss["ca"]["comments"]= "Comentaris"; $ss["ca"]["name"] = "Nom"; $ss["ca"]["message"] = "Missatge"; $ss["ca"]["add"] = "Afegeix el meu missatge a la pàgina"; $ss["ca"]["start"] = "Tornar al començament"; $ss["ca"]["selectl"] = "Selecciona imatges a l'esquerra"; $ss["ca"]["selectr"] = "Selecciona imatges a la dreta"; $ss["ca"]["from"] = "De"; $ss["ca"]["recent"] = "comentaris mes recents"; $ss["ca"]["seconds"] = "segons"; $ss["ca"]["original"]= "Fes un clic per veure aquesta imatge amb el seu tamany original"; // Please send me more translations! :-) //////////////////////////////////////////////////////////////////////////////// /// Convert any external variables into internal ones /// (avoids warnings on secure installations) $admin = isset($HTTP_GET_VARS["admin"]) ? $HTTP_GET_VARS["admin"] : ""; if (! $admin) { $admin = isset($HTTP_POST_VARS["admin"]) ? $HTTP_POST_VARS["admin"] : ""; } $editcaption = isset($HTTP_GET_VARS["editcaption"]) ? $HTTP_GET_VARS["editcaption"] : ""; if (! $editcaption) { $editcaption = isset($HTTP_POST_VARS["editcaption"]) ? $HTTP_POST_VARS["editcaption"] : ""; } $newcaption = isset($HTTP_POST_VARS["newcaption"]) ? $HTTP_POST_VARS["newcaption"] : ""; $upload = isset($HTTP_POST_VARS["upload"]) ? $HTTP_POST_VARS["upload"] : ""; $imagefile = isset($HTTP_POST_FILES["imagefile"]) ? $HTTP_POST_FILES["imagefile"] : ""; $logout = isset($HTTP_GET_VARS["logout"]) ? $HTTP_GET_VARS["logout"] : ""; $intro = isset($HTTP_GET_VARS["intro"]) ? $HTTP_GET_VARS["intro"] : ""; $recent = isset($HTTP_GET_VARS["recent"]) ? $HTTP_GET_VARS["recent"] : ""; $margin = isset($HTTP_GET_VARS["margin"]) ? $HTTP_GET_VARS["margin"] : ""; $image = isset($HTTP_GET_VARS["image"]) ? $HTTP_GET_VARS["image"] : ""; $deleteimage = isset($HTTP_GET_VARS["deleteimage"]) ? $HTTP_GET_VARS["deleteimage"] : ""; $dcomment = isset($HTTP_GET_VARS["dcomment"]) ? $HTTP_GET_VARS["dcomment"] : ""; $ctype = isset($HTTP_GET_VARS["ctype"]) ? $HTTP_GET_VARS["ctype"] : ""; $acomment = isset($HTTP_GET_VARS["acomment"]) ? $HTTP_GET_VARS["acomment"] : ""; $originalimage = isset($HTTP_GET_VARS["originalimage"]) ? $HTTP_GET_VARS["originalimage"] : ""; $slide = isset($HTTP_GET_VARS["slide"]) ? $HTTP_GET_VARS["slide"] : "0"; $comment = isset($HTTP_POST_VARS["comment"]) ? $HTTP_POST_VARS["comment"] : ""; $name = isset($HTTP_POST_VARS["name"]) ? $HTTP_POST_VARS["name"] : ""; $message = isset($HTTP_POST_VARS["message"]) ? $HTTP_POST_VARS["message"] : ""; /// Check that Image processing is available /// switch ($imagemethod) { case "imagemagick": if (!is_executable("$convert")) { PrintHeader(); PrintError("Sorry, but I couldn't find the Imagemagick program that you specified to convert images ($convert).
Check the configuration of this script and your server."); die; } if (!is_executable("$identify")) { PrintHeader(); PrintError("Sorry, but I couldn't find the Imagemagick program that you specified to identify images ($identify).
Check the configuration of this script and your server."); die; } break; case "gd2": if (!function_exists("ImageCreateTrueColor")) { PrintHeader(); PrintError("Sorry, but I couldn't find the GD 2.* functions that I need to convert images. Check the configuration of this script (imagemethod variable) or your system. Make sure that your copy of PHP has been compiled with GD support and native JPEG support eg
configure --with-gd --with-jpeg ..."); die; } break; case "gd1": if (!function_exists("ImageCreate")) { PrintHeader(); PrintError("Sorry, but I couldn't find the GD 1.* functions that I need to convert images. Check the configuration of this script (imagemethod variable) or your system. Make sure that your copy of PHP has been compiled with GD support and native JPEG support eg
configure --with-gd --with-jpeg ..."); die; } break; } /// Check that support for reading image captions is available switch ($captionmethod) { case "imagemagick": if (!is_executable("$identify")) { PrintHeader(); PrintError("Sorry, but I couldn't find the Imagemagick program that you specified to read image captions ($identify).
Check the configuration of this script and your server.
Maybe you just want to change the captionmethod variable to \"capfile\""); die; } break; case "rdjpgcom": if (!is_executable("$rdjpgcom")) { PrintHeader(); PrintError("Sorry, but I couldn't find the program that you specified to read image captions ($rdjpgcom).
Check the configuration of this script and your server.
Maybe you just want to change the captionmethod variable to \"capfile\""); die; } break; } /// Functions /// function RemoveNewLines (&$item, $key) { $item = chop($item); } function GetFileList( $dirname="." ) { // Finds all the images // First check to see if there's a file called $sortfile // that contains a sorted list of filenames, one per line // otherwise, will default to all files in alphabetical order global $sortfile, $sortreverse; $files = array(); if (file_exists($sortfile)) { $files = file($sortfile); array_walk($files, 'RemoveNewLines'); } else { $dir = opendir( $dirname ); while( $file = readdir( $dir ) ) { if (eregi("\.jpe?g$", $file) || eregi("\.gif$", $file) || eregi("\.png$", $file)) { $files[] = $file; } } if ($sortreverse) { rsort($files); } else { sort($files); } } return $files; } function GetNeighbours($imagelist, $currimage, &$previmage, &$nextimage) { // For a given image, return the next and previous ones $lastimage = count($imagelist) - 1; for ( $i=0; $i<=$lastimage; $i++) { if ($imagelist[$i] == $currimage) { if ($i == 0) { $nextimage = $imagelist[$i+1]; $previmage = NULL; return; } else if ($i == $lastimage) { $previmage = $imagelist[$i-1]; $nextimage = NULL; return; } else { $previmage = $imagelist[$i-1]; $nextimage = $imagelist[$i+1]; return; } } } $previmage = NULL; $nextimage = NULL; return; } function PrintError($message) { echo "

Error: $message

"; } function PrintHeader($pagetitle="", $meta="") { // Special case when meta = "margin" global $headerfile; global $stylesheet; global $lang; global $pagecolor, $textcolor, $linkcolor, $vlinkcolor, $background; echo "\n"; echo "$pagetitle\n"; echo "\n"; if ($meta && $meta != "margin") { echo "$meta\n"; } if ($stylesheet) { echo ""; } echo "\n"; echo "\n"; if ($meta != "margin" && file_exists($headerfile)) { include($headerfile); } } function PrintFooter() { global $footerfile; global $title; if (file_exists($footerfile)) { include($footerfile); } else { echo "

"; echo "$title

\n"; } echo ""; } function PrintRecentComments($recent) { global $thumb, $marginsize, $marginside, $scriptname; global $ss, $lang, $timeoffset; if (! $recent) { return; } $imagelist = GetFileList(); $comments = array(); foreach ($imagelist as $filename) { $commentfile = "$thumb/$filename.txt"; if (file_exists($commentfile)) { $file = file($commentfile); foreach ($file as $line) { $line = chop($line)."###$filename"; $comments[] = $line; } } } rsort($comments); $count = 0; echo "

"; // Just in case; echo "

$recent ".$ss[$lang]["recent"].":

"; foreach ($comments as $comment) { $comm = explode ("###", $comment); $image = $comm[3]; $caption = GetImageCaption($image, $clean=true); $thumbimage = "$thumb/$image"; $image = rawurlencode($image); echo ""; echo ""; if ($marginside != "right") { echo ""; } echo ""; if ($marginside == "right") { echo ""; } echo "

"; echo ""; echo $ss[$lang]["from"].": ".$comm[1].", ".date("l, j F Y, g:i A", $comm[0]+($timeoffset*3600))."
"; echo "
    ".$comm[2]."
"; if (isadmin()) { echo "

delete

"; } echo "
"; echo ""; if (file_exists($thumbimage)) { echo "\"$caption\""; } else { echo "$caption"; } echo ""; echo ""; echo ""; echo $ss[$lang]["from"].": ".$comm[1].", ".date("l, j F Y, g:i A", $comm[0]+($timeoffset*3600))."
"; echo "
    ".$comm[2]."
"; if (isadmin()) { echo "

delete

"; } echo "
\n"; $count++; if ($count >= $recent) { break; } } echo "
\n"; } function PrintComments($imagefile) { // Given an image imagefile, finds, reads and formats the // associated file of guest comments global $thumb, $ss, $lang, $timeoffset, $scriptname, $moderate; $commentfiles["main"] = "$thumb/$imagefile.txt"; if ($moderate) { $commentfiles["unmoderated"] = "$thumb/$imagefile.mod"; } $filename = rawurlencode($imagefile); echo "

\n"; foreach ($commentfiles as $commenttype => $commentfile) { if ($commenttype == "unmoderated" and !isadmin()) { continue; } if (file_exists($commentfile)) { $comments = file($commentfile); foreach ($comments as $comment) { $comm = explode ("###", $comment); echo ""; echo $ss[$lang]["from"].": ".$comm[1].", ".date("l, j F Y, g:i A", $comm[0]+($timeoffset*3600))."
"; echo "
    ".$comm[2]."
\n"; if (isadmin()) { echo "

"; if ($commenttype == "unmoderated") { echo "approve "; echo "delete"; } else { echo "delete"; } echo "

"; } echo "
\n"; } } } echo "

\n"; } function DeleteComment($filename, $dcomment, $ctype="") { // Given an image filename and a comment ID (time) to // delete, it reads the file and rewrites it, leaving // out the specified line. Returns the deleted line. global $thumb, $ss, $lang, $timeoffset, $scriptname; if ($ctype == "mod") { $commentfile = "$thumb/$filename.mod"; } else { $commentfile = "$thumb/$filename.txt"; } $len = strlen($dcomment); if (file_exists($commentfile)) { $comments = file($commentfile); rename($commentfile, $commentfile.".bak"); if ($file = fopen ($commentfile, "a")) { foreach ($comments as $comment) { if (substr($comment, 0, $len) == $dcomment) { $deletedcomment = $comment; } else { fwrite($file, "$comment"); } } unlink($commentfile.".bak"); } else { // some error occurred ... try to undo the mess PrintError("Could not delete comment from file!"); rename($commentfile.".bak", $commentfile); } } else { PrintError("No comments exist for this image! ($filename)"); } return $deletedcomment; } function ApproveComment($filename, $commentid) { // Given an image filename and a comment ID (time) to // approve, it moves the comment from the .mod file // to the .txt file if ($commentline = DeleteComment($filename, $commentid, "mod")) { AddComment($filename, "", "", $commentline); echo "

That message has been approved

"; } } function PrintCommentForm($filename) { global $scriptname, $textcolor, $pagecolor; global $ss, $lang; ?>
:
:
")); if ($email) { // Try and send the comment via email $urlstart = "http://$SERVER_NAME$REQUEST_URI?image=".rawurlencode($filename); if ($moderate) { $approveurl = "Approve: $urlstart&acomment=$timenow\n\n"; } $deleteurl = "Delete: $urlstart&dcomment=$timenow&ctype=mod\n\n"; mail($email, "Comment added: $title", "From: $name ($REMOTE_HOST)\n\n". "$message\n\n". "http://$SERVER_NAME$REQUEST_URI?image=".rawurlencode($filename)."\n\n". $approveurl . $deleteurl, "From: $email"); } $message = nl2br($message); $message = strtr($message, "\r", " "); $message = strtr($message, "\n", " "); fwrite($file, "$timenow###$name###$message\n"); } fclose($file); } else { PrintError("Could not add comment for $filename"); } } function CleanCaption ($caption) { $caption = strtr($caption, "\r", " "); $caption = strtr($caption, "\n", " "); $caption = htmlentities(strip_tags($caption)); return $caption; } function GetImageCaption($image, $clean=false) { global $thumb, $captionmethod, $rdjpgcom, $identify; switch ($captionmethod) { case "imagemagick": if (file_exists($image)) { Exec("$identify -ping -format \"%c\" \"$image\"", $captionlines); } else { return ""; } break; case "rdjpgcom": if (file_exists($image)) { Exec("$rdjpgcom \"$image\"", $captionlines); } else { return ""; } break; case "capfile": $capfile = "$thumb/$image".".cap"; if (file_exists($capfile)) { $captionlines = file($capfile); } else { return ""; } break; case "filename": return $image; break; default: return ""; break; } foreach ($captionlines as $captionline) { $caption .= "$captionline "; } $caption = stripslashes($caption); if ($clean) { $caption = CleanCaption($caption); } return $caption; } function SetImageCaption($image, $caption) { global $thumb, $captionmethod, $wrjpgcom; $TEMPFILE = "$thumb/ttttmpfile.jpg"; if (file_exists($TEMPFILE)) { unlink($TEMPFILE); } $caption = stripslashes($caption); switch ($captionmethod) { case "rdjpgcom": if (!eregi("\.jpe?g$", $image)) { PrintError("$image is probably not a JPEG file"); return false; } $command = "$wrjpgcom -replace -comment ".EscapeShellArg($caption)." ".EscapeShellArg($image); Exec("$command > $TEMPFILE"); if (file_exists($TEMPFILE) and filesize($TEMPFILE) > 0) { return rename($TEMPFILE, $image); } break; case "capfile": $capfile = "$thumb/$image".".cap"; if (! $file = fopen ($capfile, "w")) { PrintError("Could not open the caption file $capfile"); return false; } if (! fwrite($file, $caption)) { PrintError("Could not write the caption to the caption file $capfile"); return false; } return true; break; } return false; } function ReadImageFromFile($filename, $type) { $imagetypes = ImageTypes(); switch ($type) { case 1 : if ($imagetypes & IMG_GIF) return $im = ImageCreateFromGIF($filename); break; case 2 : if ($imagetypes & IMG_JPEG) return ImageCreateFromJPEG($filename); break; case 3 : if ($imagetypes & IMG_PNG) return ImageCreateFromPNG($filename); break; default: return 0; } } function WriteImageToFile($im, $filename, $type) { global $imagequality; switch ($type) { case 1 : return ImageGIF($im, $filename); case 2 : return ImageJpeg($im, $filename, $imagequality); case 3 : return ImagePNG($im, $filename); default: return false; } } function ResizeImage($image, $newimage, $newwidth, $newheight=0) { // Returns true if new image was created, else false // If newheight is not specified then image is scaled in proportion // to newwidth. If newheight is specified, then newheight and newwidth // represent a bounding box to fit image into global $imagemethod; switch ($imagemethod) { case "imagemagick": return ResizeImageUsingIM($image, $newimage, $newwidth, $newheight); break; case "gd1": case "gd2": return ResizeImageUsingGD($image, $newimage, $newwidth, $newheight); break; case "manual": return true; break; default: return false; break; } } function ResizeImageUsingGD($image, $newimage, $newwidth, $newheight) { global $imagemethod; $size = GetImageSize($image); $width = $size[0]; $height = $size[1]; $type = $size[2]; if ($im = ReadImageFromFile($image, $type)) { if ($newheight && ($width < $height)) { $newwidth = ($newheight / $height) * $width; } else { $newheight = ($newwidth / $width) * $height; } if ($imagemethod == "gd2") { $im2 = ImageCreateTrueColor($newwidth,$newheight); } else { $im2 = ImageCreate($newwidth,$newheight); } if ($imagemethod == "gd2") { ImageCopyResampled($im2,$im,0,0,0,0,$newwidth,$newheight,$width,$height); } else { ImageCopyResized($im2,$im,0,0,0,0,$newwidth,$newheight,$width,$height); } if (WriteImageToFile($im2, $newimage, $type)) { return true; } } return false; } function ResizeImageUsingIM($image, $newimage, $newwidth, $newheight) { global $identify, $convert, $imagequality; if (! $sizeinfo = Exec("$identify -ping -format \"%w %h\" \"$image\"")) { return false; } $size = explode(" ", $sizeinfo); $width = $size[0]; $height = $size[1]; if (!$width) { return false; } if ($newheight && ($width < $height)) { $newwidth = ($newheight / $height) * $width; } else { $newheight = ($newwidth / $width) * $height; } Exec("$convert -geometry \"$newwidth"."x"."$newheight\" -quality \"$imagequality\" \"$image\" \"$newimage\""); return file_exists($newimage); } function PrintSlideshowForm ($nextimage, $slide=0) { global $scriptname; global $ss, $lang; $common = "$scriptname?image=$nextimage&slide="; $options = array (2 => "2 ".$ss[$lang]["seconds"], 5 => "5 ".$ss[$lang]["seconds"], 7 => "7 ".$ss[$lang]["seconds"], 10 => "10 ".$ss[$lang]["seconds"], 20 => "20 ".$ss[$lang]["seconds"], 30 => "30 ".$ss[$lang]["seconds"], 40 => "40 ".$ss[$lang]["seconds"], 50 => "50 ".$ss[$lang]["seconds"], 60 => "60 ".$ss[$lang]["seconds"]); echo "
"; echo "
"; } function isadmin() { global $password, $PFCOOKIE; if ($password and isset($PFCOOKIE)) { if ($PFCOOKIE == md5($password) ) { return true; } } return false; } function clean_filename($string) { $string = eregi_replace("\.\.", "", $string); $string = eregi_replace("[^([:alnum:]|\.)]", "_", $string); return eregi_replace("_+", "_", $string); } /// Individual pages are created here /// if ($admin) { if (isadmin()) { $intro = "true"; } else if ($admin == $password) { $seconds = 60*60*24*354; setCookie ('PFCOOKIE', "", time() - 3600, "/"); setCookie ('PFCOOKIE', md5($admin), time()+$seconds, "/"); $PFCOOKIE = md5($admin); $intro = "true"; } else { PrintHeader("Administrator Login"); echo "
"; echo "

 

"; echo "
"; echo "Admin Password: "; echo ""; echo "
"; } } if ($logout) { if (isadmin()) { $seconds = 60*60*24*354; setCookie ('PFCOOKIE', "", time() - 3600, "/"); $PFCOOKIE = NULL; } $intro = "true"; } if ($editcaption) { PrintHeader("Editing a caption"); $image = urldecode($editcaption); if (!isadmin()) { PrintError("This is an admin-only function"); die; } if (ereg( "\\.\\.", $image)) { // using ".." in the filename PrintError("That filename ($image) was not secure."); die; } if ($captionmethod == "rdjpgcom" or $captionmethod == "capfile") { if ($newcaption) { if (! SetImageCaption($image, $newcaption)) { PrintError("Could not save the new caption, sorry"); } echo "
"; echo "

 

"; echo "

Caption saved.

"; echo "

Continue

"; } else { $caption = stripslashes(GetImageCaption($image)); echo "
"; echo "

 

"; echo "

Caption for \"$image\"

"; echo "
"; echo "
"; echo ""; echo ""; echo "
"; } } else { PrintError("You can't edit captions unless $captionmethod is rdjpgcom or capfile"); } die; } if ($deleteimage) { PrintHeader("Deleting an image"); if (!isadmin()) { PrintError("This is an admin-only function"); die; } if (ereg( "\\.\\.", $deleteimage)) { // using ".." in the filename PrintError("That filename ($deleteimage) was not secure."); die; } if (! unlink($deleteimage) ) { PrintError("An error occurred while deleting the image - try doing it manually."); } else { echo "

Image deleted

"; } if (file_exists("$thumb/$deleteimage")) { if (! unlink("$thumb/$deleteimage")) { PrintError("An error occurred while deleting the thumbnail ($thumb/$deleteimage)"); } else { echo "

Thumbnail image deleted

"; } } if (file_exists("$thumb/$imageresize$deleteimage")) { if (! unlink("$thumb/$imageresize$deleteimage")) { PrintError("An error occurred while deleting the reduced image ($thumb/$imageresize$deleteimage)"); } else { echo "

Reduced size image deleted

"; } } if (file_exists("$thumb/$deleteimage.txt")) { if (! unlink("$thumb/$deleteimage.txt")) { PrintError("An error occurred while deleting the comments ($thumb/$deleteimage.txt)"); } else { echo "

Guest comments deleted

"; } } if (file_exists("$thumb/$deleteimage.cap")) { if (! unlink("$thumb/$deleteimage.cap")) { PrintError("An error occurred while deleting the caption ($thumb/$deleteimage.cap)"); } else { echo "

Caption file deleted

"; } } echo "

Continue

"; die; } if ($upload) { if (!isadmin()) { PrintError("This is an admin-only function"); die; } if (!is_uploaded_file($imagefile["tmp_name"]) or $imagefile["size"] == 0) { PrintError("That was not a valid file."); } else { $imagefile_name = clean_filename($imagefile["name"]); if ($imagefile_name) { if (! move_uploaded_file($imagefile["tmp_name"], $imagefile_name)) { PrintError("Could not store file in this directory"); } else { echo "

Uploaded $imagefile_name [".$imagefile["type"]."]

"; echo "

Continue

"; die; } } else { PrintError("This file had a wierd filename"); } } $intro = "true"; } if ($intro) { // Print initial info in main frame PrintHeader($title); if (file_exists($introfile)) { include($introfile); } else { echo "

$title

"; if ($marginside == "right") { echo "

". $ss[$lang]["selectr"] ."

"; } else { echo "

". $ss[$lang]["selectl"] ."

"; } } if ($guestcomment && $recentcount) { echo "
"; echo "

"; echo "$recentcount ". $ss[$lang]["recent"]; echo "

"; } if (isadmin()) { echo "
"; echo "

You are logged in as administrator

"; echo "
"; echo " "; echo " "; echo " "; echo " "; echo "
"; echo "

Log out

"; echo "
"; echo "
"; } die; } if ($recent) { if ($guestcomment) { PrintHeader("$title: Recent Comments"); PrintRecentComments($recent); } echo "

".$ss[$lang]["start"]."

"; die; } if ($margin) { // Create a list of thumbnails if (!file_exists($thumb)) { if ( ! mkdir($thumb, 0755)) { PrintError("Could not create thumb dir - check write permissions"); die; } } PrintHeader("$title: Thumbnails", "margin"); $imagelist = GetFileList(); echo "

\n"; foreach ($imagelist as $image) { $thumbimage = $thumb."/".$image; $thumb_exists = file_exists($thumbimage); if (!$thumb_exists) { // Try to create the thumbnail set_time_limit(30); $thumbwidth = $margin - 20; $thumb_exists = ResizeImage($image, $thumbimage, $thumbwidth); } $caption = GetImageCaption($image, $clean=true); $image = rawurlencode($image); $thumbimage = $thumb."/".$image; if ($datenames) { // Add date to comments $imageyear = substr($image, 0, 4); $imagemonth = substr($image, 4, 2); $imageday = substr($image, 6, 2); $caption = date("j-M-y ", mktime (0, 0, 0, $imagemonth, $imageday, $imageyear)) . $caption; } // The d=d.html was added to help dumb caches echo ""; if ($thumb_exists) { echo "\"$caption\""; } else { echo "$caption"; } echo "

\n"; } echo "

\n"; echo "

".$ss[$lang]["start"]."

\n"; if ($password) { echo "


"; if (!isadmin()) { echo "Admin"; } else { echo "Logout"; } echo "

\n"; } echo "


Made with
"; echo "Photo Frame $version

\n"; die; } if ($comment) { AddComment($comment, $name, $message); if ($moderate) { echo "

Your comment was stored and is awaiting moderation

"; } $image = $comment; } if ($image) { if (ereg( "\\.\\.", $image)) { // using ".." in the filename PrintError("That filename ($image) was not secure."); die; } $cleanimage = $image; $image = urldecode($image); if (!file_exists($image)) { PrintError("Strangely, that picture doesn't exist"); die; } $imagelist = GetFileList(); GetNeighbours($imagelist, $image, $previmage, $nextimage); $caption = GetImageCaption($image); if ($slide && $nextimage) { $meta=""; } else { $meta = ""; $slide = "0"; } PrintHeader(CleanCaption($caption), $meta); echo ""; if ($previmage) { echo ""; } if ($nextimage) { echo ""; echo ""; } echo "
"; PrintSlideshowForm($nextimage, $slide); echo "
\n"; echo "

".stripslashes($caption); if (isadmin() and ($captionmethod == "rdjpgcom" or $captionmethod == "capfile") ) { echo "(edit caption)"; } echo "

"; if ($fullwindow) { $imagewidth = "WIDTH=100%"; } else { $imagewidth = ""; } echo "

\n"; if ($imageresize && ! $originalimage) { $rimage = "$thumb/$imageresize$image"; $cleanrimage = "$thumb/$imageresize".rawurlencode("$image"); if (! file_exists("$rimage")) { $imageresize = ResizeImage($image, $rimage, $imageresize, $imageresize); } if ($imageresize) { $filesize = (integer) (filesize($image) / 1024); echo ""; echo ""; echo "\n"; } else { echo "\n"; } } else { echo "\n"; } if ($datenames) { $imageyear = substr($image, 0, 4); $imagemonth = substr($image, 4, 2); $imageday = substr($image, 6, 2); echo "
"; echo date("j F, Y", mktime (0, 0, 0, $imagemonth, $imageday, $imageyear)); echo "
\n"; } if (isadmin()) { echo "
Delete this image and all comments"; } echo "

"; if ($dcomment) { DeleteComment($image, $dcomment, $ctype); } if ($acomment) { ApproveComment($image, $acomment); } if ($guestcomment) { echo "



".$ss[$lang]["comments"]."

"; PrintComments($image); PrintCommentForm($image); } PrintFooter(); die; } ?> <? echo $title ?> This site works best with frames, which your browser doesn't support. You can still browse this photo album, though, by starting <A HREF="?margin=">here</A>