/photos/rss.php |
---|
0,0 → 1,76 |
<?php |
require '../_taios.php'; |
header("Content-type: application/rss+xml"); |
$page = new Taios_Page('Photos RSS Feed', '../'); |
$dirName = $_GET['dir']; |
if (empty($dirName)) |
{ |
$dirName = "Lassitor"; |
} |
write('<?xml version="1.0" encoding="UTF-8" ?>'); |
write('<rss version="2.0">'); |
write('<channel>'); |
write('<title>Tim32 Photo RSS ' . $dirName . '</title>'); |
write('<description>This is the RSS feed for the Tim32 Photos.</description>'); |
write('<link>http://tim32.org/photos/album.php?dir=' . $dirName . '</link>'); |
$directory = "albums/" . $dirName . "/"; |
$sortOrder = "newestFirst"; |
$results = array(); |
$handler = opendir($directory); |
while ($file = readdir($handler)) |
{ |
if ($file != '.' && $file != '..' && $file != "robots.txt" && $file != ".htaccess" && getimagesize($directory . $file)) |
{ |
$currentModified = filectime($directory . $file); |
$file_names[] = $file; |
$file_dates[] = $currentModified; |
} |
} |
closedir($handler); |
if ($sortOrder == "newestFirst") |
{ |
arsort($file_dates); |
} |
else |
{ |
asort($file_dates); |
} |
$file_names_Array = array_keys($file_dates); |
foreach ($file_names_Array as $idx => $name) $name=$file_names[$name]; |
$file_dates = array_merge($file_dates); |
$indexInArray = 0; |
foreach ($file_dates as $date) |
{ |
$j = $file_names_Array[$indexInArray]; |
$file = $file_names[$j]; |
$filename = $directory . $file; |
write('<item>'); |
write('<title>' . $file . '</title>'); |
write('<link>http://tim32.org/photos/' . $filename . '</link>'); |
write('<guid>' . $indexInArray . '</guid>'); |
write('<pubDate>' . date('D, d M Y H:i:s O', $date). '</pubDate>'); |
write('<description><img src="' . $filename . '" /></description>'); |
write('</item>'); |
$indexInArray++; |
} |
write('</channel>'); |
write('</rss>'); |
?> |
/photos/album.php |
---|
0,0 → 1,112 |
<?php |
require '../_taios.php'; |
function getImageSizes($sourceImageFilePath, $maxResizeWidth, $maxResizeHeight) { |
$size = getimagesize($sourceImageFilePath); |
$origWidth = $size[0]; |
$origHeight = $size[1]; |
$resizedWidth = $origWidth; |
$resizedHeight = $origHeight; |
if ($resizedWidth > $maxResizeWidth) |
{ |
$aspectRatio = $maxResizeWidth / $resizedWidth; |
$resizedWidth = round($aspectRatio * $resizedWidth); |
$resizedHeight = round($aspectRatio * $resizedHeight); |
} |
if ($resizedHeight > $maxResizeHeight) |
{ |
$aspectRatio = $maxResizeHeight / $resizedHeight; |
$resizedWidth = round($aspectRatio * $resizedWidth); |
$resizedHeight = round($aspectRatio * $resizedHeight); |
} |
return array($resizedWidth, $resizedHeight); |
} |
$page = new Taios_Page('Photo Albums', '../'); |
$page->drawHeader(); |
$page->drawMiddle(); |
$dirName = $_GET['dir']; |
if (empty($dirName)) |
{ |
$page->redirect('index.php'); |
} |
write('<p class="bold"><a href="index.php">Back to Photos</a></p><br />'); |
if (file_exists("albums/" . $dirName . "/description.txt")) |
{ |
write('<p>' . $page->replaceBBCode(file_get_contents("albums/" . $dirName . "/description.txt")) . '</p><br />'); |
} |
write('<table>'); |
write('<tr>'); |
$directory = "albums/" . $dirName . "/"; |
$sortOrder = "newestFirst"; |
$results = array(); |
$handler = opendir($directory); |
while ($file = readdir($handler)) |
{ |
if ($file != '.' && $file != '..' && $file != "robots.txt" && $file != ".htaccess" && getimagesize($directory . $file)) |
{ |
$currentModified = filectime($directory . $file); |
$file_names[] = $file; |
$file_dates[] = $currentModified; |
} |
} |
closedir($handler); |
if ($sortOrder == "newestFirst") |
{ |
arsort($file_dates); |
} |
else |
{ |
asort($file_dates); |
} |
$file_names_Array = array_keys($file_dates); |
foreach ($file_names_Array as $idx => $name) $name=$file_names[$name]; |
$file_dates = array_merge($file_dates); |
$i = 0; |
$indexInArray = 0; |
$i = 0; |
foreach ($file_dates as $$file_dates) |
{ |
$j = $file_names_Array[$indexInArray]; |
$file = $file_names[$j]; |
if ($i >= 3) |
{ |
write('</tr><tr>'); |
$i = 0; |
} |
$filename = $directory . $file; |
$size = getImageSizes($filename, 280, 260); |
write('<td><a href="' . str_replace(" ", "%20", $filename) . '"><img width="' . $size[0] . '" height="' . $size[1] . '" src="' . str_replace(" ", "%20", $filename) . '" /></a></td>'); |
$i++; |
$indexInArray++; |
} |
write('</tr>'); |
write('</table>'); |
$page->drawFooter(); |
?> |
/photos/index.php |
---|
1,14 → 1,31 |
<?php |
require '../_taios.php'; |
$page = new Taios_Page('Photos', '../'); |
$page->drawHeader(); |
$page->drawMiddle(); |
write('<br /><p class="bold">This page is currently under construction.</p>'); |
$page->drawFooter(); |
?> |
<?php |
require '../_taios.php'; |
$page = new Taios_Page('Photo Albums', '../'); |
$page->drawHeader(); |
$page->drawMiddle(); |
write('<p>Here we have all sorts of photos from Tim32.</p><br />'); |
$dirs = array(); |
$dir = dir('albums/'); |
while (($file = $dir->read()) !== false) |
{ |
array_push($dirs, $file); |
} |
asort($dirs); |
foreach ($dirs as $file) |
{ |
if ($file[0] != '.') |
{ |
write('<p><a href="album.php?dir=' . $file . '">' . $file . '</a></p>'); |
} |
} |
$page->drawFooter(); |
?> |
/photos/albums/Lassitor/Lassitor.png |
---|
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
/photos/albums/Lassitor/Lassitor.png |
---|
Property changes: |
Added: svn:mime-type |
## -0,0 +1 ## |
+application/octet-stream |
\ No newline at end of property |
Index: photos/albums/Lassitor/Lassitor-3d.png |
=================================================================== |
Cannot display: file marked as a binary type. |
svn:mime-type = application/octet-stream |
Index: photos/albums/Lassitor/Lassitor-3d.png |
=================================================================== |
--- photos/albums/Lassitor/Lassitor-3d.png (nonexistent) |
+++ photos/albums/Lassitor/Lassitor-3d.png (revision 439) |
/photos/albums/Lassitor/Lassitor-3d.png |
---|
Property changes: |
Added: svn:mime-type |
## -0,0 +1 ## |
+application/octet-stream |
\ No newline at end of property |
Index: _taios.php |
=================================================================== |
--- _taios.php (revision 145) |
+++ _taios.php (revision 439) |
@@ -88,6 +88,7 @@ |
{ |
if (!$this->drawnFooter) |
{ |
+ write(' © 2011 Tim32 · HTML5 Valid '); |
write(''); |
write(' |
');