DAYS:\n"; print_r($arDays); print "";*/ //Set the images for each section of our web site. $pageHeader = ""; $backLink = ""; $backImage = ""; if ($mode == "index") { $pageHeader = $tripDesc; $backLink = "default.php"; $backImage = "backtopictures.gif"; } elseif ($mode == "day") { $pageHeader = "$tripDesc
Day $day - " . $arDays["day$day"]["desc"]; $backLink = "pics.php?f=$file"; $backImage = "backtodays.gif"; } elseif ($mode == "pic") { $pageHeader = "$tripDesc
Day $day - " . $arDays["day$day"]["desc"]; $backLink = "pics.php?f=$file&d=$day"; $backImage = "backtopictures.gif"; } ?> Trip Pictures -
1) $enablePrev = true; if ($day < count($arDays)) $enableNext = true; ?>
  choose a day and start browsing  
= 4) { print ' '; } print ''; } $thumb = $arDays[$dayKey]["thumb"]; $dayIndex = substr($dayKey, 3); print ' '; //print "DAY $day
"; $count++; if ($count % 4 != 0) { print ''; } } ?>

Day ' . $dayIndex . '
' . $arDays[$dayKey]["desc"] . '
 
click a picture to view a larger version
= count($arDays) && $picture == count($arDays["day$day"]["pics"])) $nextPic = false; //See if we need to set the previous picture button to the last picture in the previous day. if ($prevPic && $picture == 1) { $newDay1--; $newPic1 = count($arDays["day$newDay1"]["pics"]); } //See if we need tp set the next picture button to the first picture on the next day. if ($nextPic && $picture >= count($arDays["day$day"]["pics"]) ) { $newDay2++; $newPic2 = 1; } ?>
= 5) { print ' ' . $part2 . ' '; } print ""; $part2 = ""; } print ' '; $pDesc = isset($arDay[1]) ? (strlen($arDay[1]) > 30 ? substr($arDay[1], 0, 30) . "..." : $arDay[1]) : $arDay[0]; $part2 .= '\n"; $count++; } ?>
' . $pDesc . "
"; $fullFile = ""; if ($file != "") { $fullFile = "./" . $file . "/pics.ini"; } if (!is_file($fullFile)) die("Could not find ini file: " . $fullFile); //Open the INI file containing the list of pictures and descriptions. $params = file($fullFile) or die('Could not read ini file!'); } function parseFile() { global $params, $arDays, $tripDesc; $dayIndex = 0; $picIndex = 0; $first = 1; foreach ($params as $line) { $line = rtrim($line, "\n\r"); //print "|$line|
"; //Skip empty lines. if ($line == "") { continue; } //If this is the top line containing the trip description... if ($first == 1) { //print "FIRST LINE
"; $tripDesc = $line; $first = 0; } //Else if this is the start of a new day, get the day's information... elseif (strtolower(substr($line, 0, 3)) == "day") { $dayIndex++; $picIndex = 0; $arLine = split("\t", $line); if (count($arLine) < 3) { $arDays["day$dayIndex"]["thumb"] = ""; $arDays["day$dayIndex"]["desc"] = "Invalid day format! Please check your pics.ini file."; } else { $arDays["day$dayIndex"]["thumb"] = $arLine[1]; $arDays["day$dayIndex"]["desc"] = $arLine[2]; } //print "DAY LINE: $dayIndex
"; } //Else this is a picture line... else { $picIndex++; $arDays["day$dayIndex"]["pics"]["$picIndex"] = split("\t", $line); //print "IMAGE LINE: $dayIndex - $line
"; } } } ?>