Forum Moderators: coopster
A little history so far ...
I have a number of sites that get data from 1 db.
The items/products listed in db have their own pics and thumbs.
I have made some code than enables me to upload with ftp an unlimited number of images, and from admin panel to make thumbs out of them, and assign thumbs and images to a specific product. That way each product has unlimited number of images.
I have write a script that scans the corresponding item-folder and lists all thumbs.
The problem ...
The major site that hosts the db operates without any problem at all (also hosts all images).
The many minor sites that depends on major site, cant access the image/thumb folder in order to show thumbs and images.
Further explanation...
In major site, i declare a variable as $my_dir="../images/product_name/thumbs/";
and by the use of is_dir($my_dir), is_file($my_dir) and dir($my_dir) i can access the images, list them and arrange them etc..
These functions dont seem to work in minor sites.
In the later case, i am forced to use $my_dir = "http://www.ddddddd.dd/images/product_name/thumbs/"; and thats the reason the function cant work.
How can i overcome this? I work on php4.3. Any tips are welcome and appreciated
In this case what about having a control file(s) of some kind. since the remote sites can't get dir listings then the master could produce a file they could grab to get the list of existing files. The file could be produced on cron maybe.
You may need more logic changes to the system as a whole as well, not really sure. The key is that the master has to do all of the extra work to maintain the system. The benefit is you can reduce a lot of checking code because the master should be taking care of all this.
Now, If I understand correctly the theory, I can have the master site "generate" a file (a txt for example) with the lists of all images i want to show, save this file in slave site (so i can access it with no probles) and when visitor ask for gallery, all i do is loop through the txt, grab images names and echo them. :)
Well, thats a thought worth trying. Thanks for the idea, never cross my mind hehe!
The reason I thought of it was because you referenced checking if files/dirs existed and possibly getting dir listings. You can't do that remotely but if the master checks all that and just gives you a trusted list you can access then you get the same result.
kinda like distributed computing ;)