problem with file structure and presentation
Posted on 2003-03-17
I just signed up, I've found this site to be useful not only to ask questions but to also help others.
This time around I do have a question.
I have a website that will incorprate email postcards. Everything works fine but I want to add a ranking system on the most popular postcards sent.
I already feel that I'm not making any sense.
Here is my file structure.
POSTCARDS : here i have the main postcard page and all category pages that displays the picture and the page that collects the user information to send the postcard. I also have a folder called "images" that holds the pictures
IMAGES : here i have subdirectories of every category (5). within those subdirectories are thumbnail and full size pictures marked ####.jpg and ####_tn.jpg respectfully.
CARDSTAT file : this file is where I store the ranks of every picture. one line from this file looks like the following: ####.jpg,100
THE PROBLEM : For every card sent a cgi script runs to rewite the postcard's main page updating the 3 most popular pictures. I do have the picture's file name of those popular pictures but I can't find a way to locate which directory they are in.
IDEAS: code the cgi script to search for file name within all directories and retain the path in a variable when that file is found. or restructure the location of those directories. or instead of having just the picture's file name in the CARDSTAT file write out the path as well.