"; // set up global $files = array(); $file_row = 0; // default to 0, not found $row=1; // row counter start at 1 $fp = fopen("files.txt","r"); while ($data = readcsv($fp,1000, ",")) { // read comma separated file $files[$row] = $data; // data is an array if ($files[$row][0]==$page_file) $file_row = $row;// check if html file match $row++; } fclose($fp); $maxrow = $row-1; $has_prev = 0; $has_next = 0; if ($file_row) {// greater than 0, we found it $filetitle = $files[$file_row][1]; // can't substitute 2d array in string $pict_type = $files[$file_row][2]; $pict_author = $files[$file_row][3]; $word_type = $files[$file_row][4]; $word_author = $files[$file_row][5]; print "$filetitle"; if ($file_row > 1) { $has_prev = 1; $prev_file = "collaboration.phtml?_page_file=".$files[$file_row - 1][0]; $prev_title = $files[$file_row - 1][1]; //print "has_prev $prev_file
"; } if ($file_row < $maxrow) { $has_next = 1; $next_file = "collaboration.phtml?_page_file=".$files[$file_row + 1][0]; $next_title = $files[$file_row + 1][1]; //print "has_next $next_title
"; } } else { print "File Not Found in files.txt"; } $contentfile = substr($page_file, 0, strrpos($page_file, ".html")); include SITE_PATH."contentheader.inc"; include SITE_PATH.$contentfile.'.shtml'; // . is string concatenation '' bracket allows no substition include SITE_PATH."links.inc"; $src_file = SITE_PATH.$contentfile.'.shtml'; include SITE_PATH."contentfooter.inc"; ?>