// dspg.php Dead Simple Photo Gallery // copyright 2011 by Larry Heyl // Released under the GPL license // http://www.gnu.org/copyleft/gpl.html // // Rename to index.php if you want this to be your index file. // Upload .jpg, .png, or, .gif pics to the same directory as the program. // Then it just works. The body of the file name will be the caption. // // Optionally: // Sort your pics with 000- to 999- prefixes. These prefixes will not show in the captions. // Upload title.txt with the title of the page on one line. // Upload notes.txt with plain text of the info you want under your title block paragraph style. // Use the 000- prefix on one of your image files to display it with the text auto wrapping around it. // Upload header.txt and footer.txt or point to existing header and footer files in the settings. // Choose width, colors, and starting pic alignment in the settings. // // Include special characters in your captions by typing --nn-, --nnn-, or --nnnn- into your file name. // The nn, nnn, or nnnn required can be found here - http://www.ascii.cl/htmlcodes.htm - under HTML Number. // i.e. the preg_replace call turns --39- into ' and produces an apostrophe or single quote character in the caption. // --33- exclamation point ! // --34- double quotes " // --35 number sign # // --36 dollar sign $ // --38- ampersand & // --39- apostrophe or single quote ' // --40- opening parenthesis ( // --41- closing parenthesis ) // --42- asterisk * // --44- comma , // --46- period . // --64- at symbol @ // --169- copyright sign // // Change the CSS to change font family, size, weight, etc. //
"; if (file_exists('title.txt') && !file_exists('notes.txt')){ echo ""; if (file_exists($footerlink)){include $footerlink;} echo ""; echo ""; ?>
"; include('title.txt'); echo "\n"; } if (file_exists('notes.txt')){ echo "
"; if (file_exists('title.txt')){ echo "\n"; } if (substr(current($filenames),0,4) == "000-"){ $top_pic_flag = 1; $filename = current($filenames); $caption = substr($filename, 4, -4); $caption = preg_replace( "/--([0-9][0-9]|[0-9][0-9][0-9]|[0-9][0-9][0-9][0-9])-/", "$1;", $caption); $caption = str_replace("_"," ",$caption); echo " "; include('title.txt'); echo "
"; echo ""; echo " "; echo "$caption
"; } echo "
"; $notes = file_get_contents('notes.txt'); $notes = str_replace(chr(10),'
',$notes); echo $notes; echo "\n"; } foreach ($filenames as $filename){ if (substr($filename,0,4) <> "000-" || $top_pic_flag <> 1){ $caption = substr($filename, 0, -4); if (substr($caption,3,1) == "-"){$caption = substr($caption,4);} $caption = preg_replace( "/--([0-9][0-9]|[0-9][0-9][0-9]|[0-9][0-9][0-9][0-9])-/", "$1;", $caption); $caption = str_replace("_"," ",$caption); echo "
$caption
\n"; if ($picalign == "left"){$picalign = "right";}else{$picalign = "left";} } } echo "