Hello pros,
I have an image gallery script that I created here. It basically pulls some info from my MySQL database telling where the gallery is located and what it's attached to.
Now, what I'd like to do is host this script on my MAIN SITE, then the images from the gallery on ANOTHER SITE.
My goal is to have multiple galleries in different locations on the REMOTE SERVER. But I want this main script to be located at my MAIN SERVER.
Can anyone help me get this running? maybe I could store a helper script, like index.php, inside each gallery directory on the REMOTE SERVER. This script could list the info for the pics in the directory.
Then the actual gallery script on the MAIN SERVER could read that index.php file and display the images within the directory???
Please help! Any coding examples are deeply appreciated!
<?PHP
//----------------------------------------------------------------------//
$mydirectory= "/$arr[location]";
$counter= 0;
$nbfiles = 0;
$currfile = '';
$photo[0] = '';
$handle = opendir($mydirectory);
if ($mode == '')
{
echo "<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td>
<table border='0' cellspacing='0' cellpadding='3' align='center'><tr>
<td align='center'><span class='main4'>$gallery</span><img src='/media/build/use/1pix_black.gif' width='100%' height='1' vspace='2'></td>
</tr></table></td></tr><tr><td align='center'><span class='small'>Created: <font color='#990000'>$arr[thedate]</font> | Last Updated: <font color='#990000'>$arr[updated]</font> <br>( Click to enlarge a photo. )</span></td></tr></table>
";
echo "<table width='100%' cellpadding='7' align='center'>";
}
while ($currfile = readdir($handle))
{$extension= strtolower(substr( strrchr( $currfile, "."),1));
if ($extension== "jpg" || $extension== "jpeg")
{$nbfiles++;
$currfile = trim($currfile);
$photo[$nbfiles] = $currfile;
if ($mode == '')
{$currthumbfile = "$arr[location]/$thumb_dir/$currfile";
echo "<td align='center' valign='middle' width='$column_width'><a href='/movies/gallery.php?film=$film&id=$id&mode=1&name=$currfile&nr=$nbfiles' class='images'><img src='$currthumbfile' border='1'></a></td>";
$counter++;
if ($counter == $columns)
{
$counter= 0;
echo"</tr>\n";
echo"<tr>\n";}}}}
if ($mode == '')
{
echo"</tr>\n\n";
echo "</table>";
}
closedir($handle);
?>