We are having the hardest time re-writing this photo-gallery function. It works perfectly on the same server as the images. Now we had to move all images to another server due to costly effects.
The gallery function works great on the same server. When we try a remote server path like: http://www.myotherserver.com -- then that is where it returns NO images ?
We found the "function" that reads / lists the images without an image file, but we can't decode it to use it on a remote server ?
Any help or ideas ? THanks.
Here is the function:
Take note :: we are NOT going to use an .txt file with the image order -- we just want the script to read the directory and list images to use..
/**
* Check for image order file. In case it does not
* exists, read the image directory.
*/
if (is_file($order_file_path . '/' . $order_file_name)) {
$fp = fopen($order_file_path . '/' . $order_file_name, "r");
$row = '';
$use_order_file = 'true';
while ($data = fgetcsv ($fp, 1000, ';')) {
$image_data[] = trim($data[0]);
$image_file_names[trim($data[0])] = trim($data[0]);
$num = count($data);
$row++;
for ($j = 0; $j < $num; $j++) {
$content_data_temp['field_' . $j] = $data[$j];
}
$content_data[] = $content_data_temp;
$content_data_temp = '';
}
fclose ($fp);
} else if (is_dir($image_path)) {
$content_data = '';
$handle = opendir($image_path);
while ($file = readdir($handle)) {
if (preg_match("/^\.{1,2}$/i", $file)) {
continue;
}
if (preg_match("/\.[a-z]{3}$/i", $file)) {
$image_data[] = $file;
$image_file_names[$file] = $file;
}
}
closedir($handle);
} else {
echo 'Image Path not working';
exit;
}
$image_number = count ($image_data);