Changelog
-------------------------
+* 0.3 -> 0.4
+# DONE: Removed some default values in config, allowing empty options
+# DONE: Added latest.php, a hybrid between index.php and rss.php ..
+# DONE: Gathered all user-related data in php-files as variables on top.
+# BUGFIX: Added missing alt-tags to img-tags generated
+# BUGFIX: Shipped templates and config now give validating HTML
+# BUGFIX: Prepped up index.php to validate aswell
+# REMOVED: Will not use perlmagick et. al, removed TODO.
+
* 0.2 -> 0.3
# DONE: Config option for size of view/thumbnail
# DONE: Config option to disable arrow-up navigation
Todo-list
-------------------------
# TODO: Stripping of image suffix for HTML file w/config option?
+# TODO: Clear old generated files and meta on regen
+# TODO: Image title from EXIF for a title-template-tag.
+# TODO: Possibility for hide/show EXIF
# TODO: Templating of EXIF
# TODO: Priority/sorting of EXIF tags
-# TODO: Possibility for hide/show EXIF
-# TODO: Clear old generated files and meta on regen
-# TODO: Use perlmagick et. al instead of convert/jhead..
# BUG: The naive handling of filenames breaks on special characters
-
Lisencing
-------------------------
Copyright (c) 2010, Jon Langseth
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>%{title}</title>
%{main_meta}
%{navigation_script}
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-9" />
+
</head>
-<body bgcolor=white>
-<center>
+<body>
<h2>%{title}</h2>
%{navscript}
-</center>
</body>
</html>
-<html>
-<head><title>plsgen-generated photoalbum.</title>
-
-<link rel='stylesheet' href='indexstyle.css' type='text/css' />
-
-</head>
-<body>
-<div id="wrapper">
-<div id="head">
-<h1>Photo albums!</h1>
-<a style="display: block; float: right;" href="rss.php"><img src="images/rss_icon.png" alt="RSS" border="0" /></a>
-<div id="head-link"><a href="http://example.com">Update index.php!</a>
-</div>
-</div>
-<div id="content">
-
<?php
+$pagetitle = "Example photoalbum.";
+$css_file = 'indexstyle.css';
+$parent_url = "http://example.com";
+$parent_linktext = "UPDATE index.php";
+$contact_address = "someone@example.com";
//define the path as relative
$path = "./";
closedir($dir_handle);
krsort($album);
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title><?=$pagetitle?></title>
+
+<link rel='stylesheet' href='<?=$css_file?>' type='text/css' />
+<meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
+
+</head>
+<body>
+<div id="wrapper">
+<div id="head">
+<h1><?=$pagetitle?></h1>
+<a style="display: block; float: right;" href="rss.php"><img src="images/rss_icon.png" alt="RSS" border="0" /></a>
+
+<div id="head-link"><a href="<?=$parent_url?>"><?=$parent_linktext?></a>
+<br/>
+<a href="latest.php">Latest updates</a>
+</div>
+</div>
+<div id="content">
+
+<?php
foreach ( $album as $key => $value ) {
echo "<div class='album'>";
echo "<div class='idxthumb'>";
- echo "<a target=_blank href='" . $key . "'>";
+ echo "<a target='_blank' href='" . $key . "'>";
echo $idximage[$key];
echo "</a>";
echo "</div>";
echo "<div class='idxlink'>";
- echo "<a target=_blank href='" . $key . "'>" . $key . "</a>\n";
+ echo "<a target='_blank' href='" . $key . "'>" . $key . "</a>\n";
echo "</div>";
echo "<div class='title'>$value</div>";
echo "</div>";
</div>
</div>
<div style="font-family: sans; font-size: 7pt; color: #444; margin-top: 20px;">
-Photo gallery index by Jon Langseth, generated using <a href="index.phps">index.php</a>
+<a href="http://wiki.defcon.no/projects/plsgen">plsgen : Perl Simple Gallery Generator</a>
</div>
</body>
</html>
-<html>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>%{title}</title>
%{main_meta}
%{navigation_script}
+ <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
</head>
<body>
use threads::shared;
use strict;
-# DONE: Config option for size of view/thumbnail
-# DONE: Config option to disable arrow-up navigation
-# DONE: Config option to disable image rescaling ?
-# DONE: Consider multithreading
+# DONE: Removed some default values in config, allowing empty options
# TODO: Stripping of image suffix for HTML file w/config option?
# TODO: Templating of EXIF
# TODO: Priority/sorting of EXIF tags
else { $indexfile = "index" . $indexcount . ".html"; }
my $navscript = gen_navscript( $previous, $next, $indexfile );
my $position = $i . " of " . $imagecount;
- my $prev_text = "<a href='" . $previous . ".html'><img src='thumb/" . $previous . "' /></a>";
- my $next_text = "<a href='" . $next . ".html'><img src='thumb/" . $next . "' /></a>";
+ my $prev_text = "<a href='" . $previous . ".html'><img src='thumb/" . $previous . "' alt='Previous image' /></a>";
+ my $next_text = "<a href='" . $next . ".html'><img src='thumb/" . $next . "' alt='Next image' /></a>";
my $cur_index_text = "<a href='". $indexfile ."'>" . $idx_ret_text . "</a>";
my $current_display = $current;
$current_display = "view/" . $current unless $disable_rescale;
close HTML;
# - - Append image thumbnail code to current index content
- $thumbs .= $thumb_pre . "<a href='" . $current . ".html'><img src='thumb/" . $current . "' /></a>" . $thumb_post;
+ $thumbs .= $thumb_pre . "<a href='" . $current . ".html'><img src='thumb/" . $current . "' alt='View " . $current . "' /></a>" . $thumb_post;
if ( $i % ($rows*$columns) == 0 )
{
$thumbs .= "</div>";
CASE => 1,
ERROR => \&cfg_error,
GLOBAL => {
- DEFAULT => "<unset>",
+ DEFAULT => "<undef>",
ARGCOUNT => AppConfig::ARGCOUNT_ONE
},
}
$cfg->disable_rescale(0);
$cfg->define('thumb_pre');
- $cfg->thumb_pre("<div class='thumb'>");
$cfg->define('thumb_post');
- $cfg->thumb_post("</div>");
$cfg->define('comment_pre');
- $cfg->comment_pre("<div id='comment'>");
$cfg->define('comment_post');
- $cfg->thumb_post("</div>");
$cfg->define('idx_prev_text');
- $cfg->idx_prev_text("← Back");
$cfg->define('idx_next_text');
- $cfg->idx_next_text("Next →");
$cfg->define('idx_ret_text');
- $cfg->idx_ret_text("To index");
$cfg->define('footer_tag');
$cfg->footer_tag('plsgen : Perl Simple Gallery Generator ' . $version);
# HTML code to wrap each thumbnail with. The default allows simple
# styling. If you wish to span this over multiple lines, use the
# end-of-line continuation mark \
+# To get empty content, comment out, or simply don't include these
thumb_pre = <div class='thumb'>
thumb_post = </div>
# HTML code to wrap comments with, for both index and image
# display. The default allows simple styling. If you wish to span
# this over multiple lines, use the end-of-line continuation mark \
+# To get empty content, comment out, or simply don't include these
comment_pre = <div id='comment'>
comment_post = </div>
# Text-strings that can easily be replaced with more complex HTML.
+# To get empty content, comment out, or simply don't include these
idx_prev_text = ← Back
idx_next_text = Next →
idx_ret_text = To index
# The Album generator tag can be overridden. This is commented
# out in the sample, but included as an example.
+# This cannot be empty, but it can be set to a ;)
#footer_tag = plsgen : Perl Simple Gallery Generator
<?php
-$site_url = "http://photos.defcon.no";
-$stream_title = "photos.defcon.no gallerystream";
-$stream_description = "The latest entries in the photo galleries at defcon.no";
-$contact_address = "jon.langseth@lilug.no";
+$site_url = "http://site.example.com";
+$stream_title = "example.com photogallerystream";
+$stream_description = "The latest entries in a photo";
+$contact_address = "someone@example.com";
$maxcount = 50;
text-align: center;
}
a, a:visited {
- color: wheat;
+ color: #F5DEB3;
text-decoration: none;
border: 0px;
}
#display {
display: block;
- float: center;
}
div.thumbnails {
clear: both;
display: block;
}
+
.thumb {
width: 170px;
height: 135px;
padding: 0px;
display: -moz-inline-stack;
display: inline-block;
- /* zoom: 1;*/
+ zoom: 1;
*display: inline;
_height: 135px;
background-color: #2c2c29;
vertical-align: top;
}
+
.thumb img
{
background-color: #2c2c29;
}
.thumb a:hover img
{
- border:1px solid #black;
+ border:1px solid black;
}
#exifdata {
width: 450px;
font-size: 8pt;
font-family: sans;
+ margin-left: auto;
+ margin-right: auto;
}
tr.exifhead { background: #2c2c29; }
tr.exiflight { background: #5c5c59; }
tr.exifdark { background: #3c3c30;}
td {
-margin: 0px;
-padding: 2px 0 2px 10px;
+ margin: 0px;
+ padding: 2px 0 2px 10px;
}
#timestamp {