$ON_SERVER = 1;
if ($ON_SERVER) {
define ("FILE_ROOT", "/home/zbohy/sites/English");
} else {
define ("FILE_ROOT", "f:/ZBOHY-Web");
}
define ("SITE_PATH", FILE_ROOT."/Dharma/zbohy/VisualArts/collaborations/");
function readcsv($fp)
{
// this doesn't work in older php, fgetcsv($fp,1000, ",");
// so this function is the longer way to do it
$fline = fgets($fp, 256);
if ($fline)
{
$arr = split (",",$fline);
$arr_max = count($arr);
for ($i = 0; $i<$arr_max; $i++) {
$arr[$i] = trim ($arr[$i]);
}
return $arr;
}
else
return 0;
}
if (!isset($_page_file)) $_page_file = "dragonfly.html";
$page_file = $_page_file;
//print "root $root page $page_file
";
// 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 "