* * at the top of your page. This will cause it to load all of the data. * * For example, you may wish to put it at the top of your index.php file. * * * * 2.) The template file contains the layout of the image and navigational buttons. * * If you change the template file, it changes the layout, provided you include * * all important tags (Shown later in configuration). The template file is named: * * QUACT.TMP * * * * 3.) If you want the template file to be your main page (If all of your page design will * * be in your template), follow these steps: * * * Rename this file index.php * * * Set the variable $QUACT_TEMPLATE_IS_INDEX to 1 (it is right below) * * * * 4.) If you ONLY want the template to display your comic page and navigational buttons, * * you will have to insert a line of text anywhere on your index.php file. * * It is as follows: * * * * * * 5.) Finally, if you wish to display a list of all pages quickly (only numbers) put * * the following line somewhere: * * * * It will appear as follows: 9,8,7,6,5,4,3,2,1 * * Each number will link to the correct page. * * * * 6.) Remember to read all of the following configuration notes and do what they say. * * Don't forget to create the images needed, and to name files correctly. * * * ************************************************************************************************/ $QUACT_TEMPLATE_IS_INDEX = 1; /************************************************************************************************ * * * CONFIGURATION * * * ************************************************************************************************/ /************************************************************************************************ * * * Change this path ($QUACT_PAGE_PATH) to the subfolder you will be uploading your comic * * pages to. * * All pages must be in YYYYMMDD format (For example, A .jpg file set for February 1st, * * 2004 would be: 20040201.jpg). * * Optionally, you can set the $QUACT_NOTES_PATH variable to point to where .txt files with* * titled YYYYMMDD can be placed to be shown with an identically dated image. * ************************************************************************************************/ $QUACT_PAGE_PATH = "./comics"; $QUACT_NOTES_PATH = ""; /************************************************************************************************ * * * You may use any images for your navigation buttons, (.jpg, .png, or .gif). * * Just replace the path shown below with the path of your choice. * * * ************************************************************************************************/ $QUACT_LAST_IMAGE = "./images/lastbutton.gif"; $QUACT_NEXT_IMAGE = "./images/nextbutton.gif"; $QUACT_PREV_IMAGE = "./images/prevbutton.gif"; $QUACT_FIRST_IMAGE = "./images/firstbutton.gif"; /************************************************************************************************ * * * Set to 999999 if you do NOT want dummy images. * * Dummy images are used with there is no navigation available (For example, no PREVIOUS * * page when viewing the first page). * * You may use any image, or none at all. It is suggested you use a dummy image to ensure * * the layout of your page appears as you wish. * * * ************************************************************************************************/ $QUACT_DUMMY_IMAGE = "999999"; /************************************************************************************************ * * * The template is what to change if you wish to adjust how your comic page and navigation * * appears. * * If you wish to change the template (For example, if you wish to have the ENTIRE PAGE be * * the template), just edit the file QUACT.TMP * * * * The following tags should be present in the template for proper functionality on the * * page: * * * * This is the tag that determines where the page itself * * (the image) will appear * * This is the navigation button to the FIRST page in the archive * * This is the navigation to the PREVIOUS page in the archive, * * relative to the one being viewed * * This is the navigation to the NEXT page in the archive, relative* * to the one being viewed * * This is the navigation button to the LAST page in the archive * * This is the drop down SELECT box that allows you to quickly * * jump to specific pages * * * * Optional Tags: * * * * Displays the numeric DAY of page. * * Displays the numeric MONTH of page. * * Displays the numeric YEAR of page. * * * * Displays the page number (According to archive) * * * * Displays notes for the day. * ************************************************************************************************/ /************************************************************************************************ * * * END OF CONFIGURATION * * Do NOT alter this file beyond this point! * * * ************************************************************************************************/ $QUACT_TEMPLATE = implode('', file('QUACT.TMP')); if (!eregi("", $QUACT_TEMPLATE)) die ("You are missing a tag in QUACT.TMP. No comic pages can display without it!"); if (empty($viewDate)) { $viewDate = date("Ymd"); } import_request_variables('GPC'); if (@$QUACT_handle = opendir($QUACT_PAGE_PATH)) { while (false !== ($QUACT_file = readdir($QUACT_handle))) { if ($QUACT_file != "." && $QUACT_file != "..") { if (eregi_replace("\..*", "", $QUACT_file) <= date("Ymd")) { if (eregi(".gif", $QUACT_file)) { $QUACT_fileList[] = array("date" => eregi_replace("\.gif", "", $QUACT_file), "ext" => ".gif"); } if (eregi(".jpg", $QUACT_file)) { $QUACT_fileList[] = array("date" => eregi_replace("\.jpg", "", $QUACT_file), "ext" => ".jpg"); } if (eregi(".png", $QUACT_file)) { $QUACT_fileList[] = array("date" => eregi_replace("\.png", "", $QUACT_file), "ext" => ".png"); } } else { if (eregi(".gif", $QUACT_file)) { $QUACT_futureFileList[] = array("date" => eregi_replace("\.gif", "", $QUACT_file), "ext" => ".gif"); } if (eregi(".jpg", $QUACT_file)) { $QUACT_futureFileList[] = array("date" => eregi_replace("\.jpg", "", $QUACT_file), "ext" => ".jpg"); } if (eregi(".png", $QUACT_file)) { $QUACT_futureFileList[] = array("date" => eregi_replace("\.png", "", $QUACT_file), "ext" => ".png"); } } } } closedir($QUACT_handle); } else { die("There was an error in your configuration. Please correct the file path variable. It is currently set to: $QUACT_PAGE_PATH"); } $QUACT_sortedFiles = array_csort($QUACT_fileList, "date", SORT_NUMERIC, SORT_DESC); $QUACT_navLast = 999999; $QUACT_navNext = 999999; $QUACT_navPrev = 999999; $QUACT_navFirst = 999999; $QUACT_curPage = 999999; $QUACT_fileCount = count($QUACT_sortedFiles); $QUACT_navLast = 0; $QUACT_navFirst = $QUACT_fileCount-1; for ($QUACT_i=0; $QUACT_i<$QUACT_fileCount; $QUACT_i++) { if ($QUACT_i > $viewDate) { $QUACT_curPage = $QUACT_i; if ($QUACT_i == $QUACT_navLast) { $QUACT_navLast = 999999; $QUACT_navNext = 999999; } else { $QUACT_navNext = $QUACT_i-1; } if ($QUACT_i == $QUACT_navFirst) { $QUACT_navFirst = 999999; $QUACT_navPrev = 999999; } else { $QUACT_navPrev = $QUACT_i+1; } } if ($viewDate == $QUACT_sortedFiles[$QUACT_i]["date"]) { if ($QUACT_i == $QUACT_navLast) { $QUACT_navLast = 999999; $QUACT_navNext = 999999; } else { $QUACT_navNext = $QUACT_i-1; } if ($QUACT_i == $QUACT_navFirst) { $QUACT_navFirst = 999999; $QUACT_navPrev = 999999; } else { $QUACT_navPrev = $QUACT_i+1; } $QUACT_curPage = $QUACT_i; } } if ($QUACT_curPage == 999999) { $QUACT_curPage = 0; $QUACT_navLast = 999999; $QUACT_navNext = 999999; $QUACT_navPrev = 1; $QUACT_navFirst = $QUACT_fileCount-1; } list($QUACT_DISP_YEAR, $QUACT_DISP_MONTH, $QUACT_DISP_DAY) = sscanf($QUACT_sortedFiles[$QUACT_curPage]["date"], '%4d%2d%2d'); if (count($QUACT_futureFileList) > 0) { // This feature coming later $QUACT_sortedFutureFiles = array_csort($QUACT_futureFileList, "date", SORT_NUMERIC, SORT_DESC); $QUACT_nextUpdate = $QUACT_sortedFutureFiles[0]["date"]; // list($QUACT_NEXT_UPDATE_YEAR, $QUACT_NEXT_UPDATE_MONTH, $QUACT_NEXT_UPDATE_DAY) = sscanf($QUACT_nextUpdate, '%4d%2d%2d'); // getdate()); } $QUACT_COMIC_PAGE = $QUACT_sortedFiles[$QUACT_curPage]["date"] . $QUACT_sortedFiles[$QUACT_curPage]["ext"]; if (file_exists($QUACT_NOTES_PATH . "/" . $QUACT_sortedFiles[$QUACT_curPage]["date"] . ".txt")) { $QUACT_NOTES = implode("", file($QUACT_NOTES_PATH . "/" . $QUACT_sortedFiles[$QUACT_curPage]["date"] . ".txt")); $QUACT_NOTES = nl2br($QUACT_NOTES); } else if (file_exists($QUACT_NOTES_PATH . "/" . $QUACT_sortedFiles[$QUACT_curPage]["date"] . ".TXT")) { $QUACT_NOTES = implode("", file($QUACT_NOTES_PATH . "/" . $QUACT_sortedFiles[$QUACT_curPage]["date"] . ".TXT")); $QUACT_NOTES = nl2br($QUACT_NOTES); } $QUACT_TEMPLATE = str_replace("", "\"Automation", $QUACT_TEMPLATE); if ($QUACT_navFirst != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); else if ($QUACT_DUMMY_IMAGE != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); if ($QUACT_navPrev != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); else if ($QUACT_DUMMY_IMAGE != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); if ($QUACT_navNext != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); else if ($QUACT_DUMMY_IMAGE != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); if ($QUACT_navLast != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); else if ($QUACT_DUMMY_IMAGE != 999999) $QUACT_TEMPLATE = str_replace("", "", $QUACT_TEMPLATE); $QUACT_TEMPLATE = str_replace("", $QUACT_DISP_DAY, $QUACT_TEMPLATE); $QUACT_TEMPLATE = str_replace("", $QUACT_DISP_MONTH, $QUACT_TEMPLATE); $QUACT_TEMPLATE = str_replace("", $QUACT_DISP_YEAR, $QUACT_TEMPLATE); $QUACT_TEMPLATE = str_replace("", (count($QUACT_sortedFiles) - $QUACT_curPage), $QUACT_TEMPLATE); $QUACT_TEMPLATE = str_replace("", dropDown($QUACT_sortedFiles, $viewDate), $QUACT_TEMPLATE); $QUACT_TEMPLATE = str_replace("", $QUACT_NOTES, $QUACT_TEMPLATE); function showComic($QUACT_TEMPLATE) { echo $QUACT_TEMPLATE; } function showPageList($QUACT_sortedFiles) { $QUACT_fileCount = count($QUACT_sortedFiles); for ($QUACT_i=0; $QUACT_i<$QUACT_fileCount; $QUACT_i++) { echo "" . ($QUACT_fileCount-$QUACT_i) . ""; if ($QUACT_i != ($QUACT_filecount-1)) echo ","; } } function dropDown($QUACT_sortedFiles, $viewDate) { $QUACT_fileCount = count($QUACT_sortedFiles); $QUACT_returnString .= ""; $QUACT_returnString .="
"; return $QUACT_returnString; } function array_csort() { $QUACT_args = func_get_args(); $QUACT_marray = array_shift($QUACT_args); $QUACT_msortline = "return(array_multisort("; foreach ($QUACT_args as $QUACT_arg) { $QUACT_i++; if (is_string($QUACT_arg)) { foreach ($QUACT_marray as $QUACT_row) { $QUACT_a = strtoupper($QUACT_row[$QUACT_arg]); $QUACT_sortarr[$QUACT_i][] = $QUACT_a; } } else { $QUACT_sortarr[$QUACT_i] = $QUACT_arg; } $QUACT_msortline .= "\$QUACT_sortarr[".$QUACT_i."],"; } $QUACT_msortline .= "\$QUACT_marray));"; eval($QUACT_msortline); return $QUACT_marray; } if ($QUACT_TEMPLATE_IS_INDEX) echo $QUACT_TEMPLATE; ?>