+++ /dev/null
-<?php
-$title = "MOBLOG";
-
-// // Based on code taken from Teri Solow - http://terisolow.com/source.php?url=/photoblog.php
-
-// // include('comments.php');
-
-// the code for printing/adding comments is
-// basically straight from my picture script:
-// http://www.terisolow.com/programs.php#PHP-pics
-
-// cookie_setup();
-
-$serverroot = "/www";
-$home = "/Pictures/";
-$path = "";
-
-include $serverroot."/header.shtml";
-// connect to database and get picture information
-// //db_connect();
- $table = 'photoblog';
- $picsperpage = 20;
-
-function show_image($imagename, $imagearray) {
- global $home, $serverroot, $PHP_SELF, $HTTP_POST_VARS, $HTTP_SERVER_VARS, $banned, $table;
- $img_data = $imagearray[$imagename];
- $img_size = getimagesize($serverroot.$home."camblog/".$img_data['file']);
- $width = $img_size[0];
- $height = $img_size[1];
- $width_scale = 600;
- if ($width>$width_scale) {
- $ratio = $width/$width_scale;
- $width = $width_scale;
- $height = round($height/$ratio);
- }
- $images = array_keys($imagearray);
-
-foreach ($images as $image) {
- if (!isset($last)) {
- $first = $image;
- }
- if ($now) {
- $next = $image;
- $now = false;
- }
- if ($image == $imagename) {
- $prev = $last;
- $now = true;
- }
- $last = $image;
- }
-
-if (!isset($prev)){
- $prev = $last;
- }
-if (!isset($next)){
- $next = $first;
- }
-print "<hr align=\"center\" size=\"2\" width=\"95%\" noshade=\"noshade\" />
-<center><table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"90%\"><tr><td align=\"left\" width=\"33%\">
-<a class=\"inflate\" href=\"$HTTP_SERVER_VARS[PHP_SELF]?image=$prev\"><-- previous</a>
-</td>
-<td align=\"center\" width=\"34%\"><a href=\"$HTTP_SERVER_VARS[PHP_SELF]\">back</a></td>
-<td align=\"right\" width=\"33%\">
-<a class=\"inflate\" href=\"$HTTP_SERVER_VARS[PHP_SELF]?image=$next\">next --></a>
-</td></tr></table></center>
-<br />
-<center>
-<img src=\"$home./camblog/".$img_data['file']."\" border=\"0\" width=\"$width\" height=\"$height\" alt=\"".$img_data['file']."\" />
-<br /><em class=\"date\">".$img_data['date']."</em><br />
-<strong>".$img_data['subject']."</strong>
-</center>
-<p style=\"margin: 10px 40px 10px 40px\">\n";
-print $img_data['description'];
-print "</p><br />\n\n";
-
-// $notify = show_comments($img_data['file'], $table);
-// comment_form($img_data['file'], $table, $notify);
-}
-
-function show_all($imagearray, $page) {
-global $HTTP_SERVER_VARS, $home, $serverroot, $table, $picsperpage;
-
-// given page number and number of pics per page, find starting and
-// ending indexes
-$start = 0;
-if ($page == 0) {
-$end = $start+$picsperpage;
-}
-else {
-$start = $page*$picsperpage;
-if ($start > count($imagearray)) {
-$start = 0;
-$end = $start+$picsperpage;
-}
-else {
-$end = $start+$picsperpage;
-}
-}
-// find out how many pages there are
-$numpages = ceil(count($imagearray)/$picsperpage);
-print "<hr align=\"center\" size=\"2\" width=\"95%\" noshade=\"noshade\" />
-
-<div class=\"body\">
-
-<p>These pictures were taken with my mobile phone.</p>
-
-
-</div>\n\n";
-
-print "<div class=\"hr\">
-<p class=\"leftside\">photo tekniklog</p>
-<p class=\"rightside\">".count($imagearray)." images; $picsperpage images/page; page ";
-print $page+1;
-print "/".$numpages."</p>
-<div style=\"clear: both;\"></div></div>\n\n";
-
-print "<div style=\"float: left; align: left;\">";
-if ($page>0) {
-$last = $page-1;
-print "<a href=\"$HTTP_SERVER_VARS[PHP_SELF]?page=$last\"><<</a>";
-}
-print "</div>\n<div style=\"float: right; align: right;\">";
-if ($page<$numpages-1) {
-$next = $page+1;
-print "<a href=\"$HTTP_SERVER_VARS[PHP_SELF]?page=$next\">>></a>";
-}
-print "</div>\n<div style=\"clear: both;\"></div>";
-
-print "<div style=\"text-align: center; margin: 0px 50px 0px 50px;\">
-<br clear=\"all\" />\n\n";
-
-$curr = 0;
-foreach ($imagearray as $image) {
-if (($curr>=$start)&&($curr<$end)) {
-$thumbname = "/Pictures/camblog/tiny".$image['file'];
-
-// $comments = num_comments($image['file'], $table);
-//if ($comments==0) {
-//$nocomments = "No comments";
-//}
-//else if ($comments==1) {
-//$nocomments = "One comment";
-//}
-//else {
-//$nocomments = "$comments comments";
-//}
-
-print "<div class=\"thumbnail\" style=\"height: 140px\">
-<a class=\"art\" href=\"$HTTP_SERVER_VARS[PHP_SELF]?image=".$image['file']."\"><img class=\"art\" src=\"$thumbname\" border=\"0\" width=\"125\" height=\"93\" alt=\"".$image['date']."\" title=\"".$image['date']." - $nocomments\" /></a><br />\n";
-if ($comments>0) {
-print "<span class=\"comment_notify\">$nocomments</span><br />";
-} else {
-print "$nocomments<br />";
-}
-print $image['date']."<br />";
-print $image['subject'];
-print "</div>\n";
-}
-$curr++;
-}
-
-print "</div>\n\n";
-print "<br clear=\"all\" />\n";
-
-if ($numpages>1) {
-print "<div style=\"font-size: x-small; text-align: center; font-family: lucidatypewriter, clean, courier, monospace;\">";
-print "<strong>~ Page ~</strong><br />\n";
-for ($i = 0; $i < $numpages; $i++) {
-if ($page==$i) {
-print " <s>$i</s> ";
-}
-else {
-print " <a href=\"$HTTP_SERVER_VARS[PHP_SELF]?page=$i\">$i</a> ";
-}
-}
-print "</div>\n\n";
-}
-}
-
-function sanitize($input) {
-$output = str_replace("<br />", "[br]", $input);
-$output = htmlspecialchars($output, ENT_QUOTES);
-$output = str_replace("[br]", " <br />\n", $input);
-return $output;
-}
-
-$workincludefile = $serverroot.$home."/camblog/index.txt";
-$worklinearray = file($workincludefile);
-$worklines = array_keys($worklinearray);
-foreach ($worklines as $line) {
-$element = explode("::", $worklinearray[$line]);
-$thisfile = $element[0];
-$thissubject = sanitize($element[1]);
-$thisdesc = sanitize($element[2]);
-$thisdate = date("M j Y H:i", substr($thisfile, 0, -4));
-$images[$thisfile] = array("file"=>$thisfile, "subject"=>$thissubject, "description"=>$thisdesc, "date"=>$thisdate);
-}
-$images = array_reverse($images, TRUE);
-$image = $HTTP_GET_VARS['image'];
-$page = $HTTP_GET_VARS['page'];
-if (empty($page)) { $page = 0; }
-if (array_key_exists($image, $images)) {
-show_image($image, $images);
-} else {
-show_all($images, $page);
-}
-
-include('../footer.php');
-
-?>
-