Does your host allow you to use cronjobs?
If so, set one up for a weekly run. If not, we'll have to use a pseudo-cron
The script you want to run will be fairly simple and will do a small number of things:
- Look for the highest rated image file, depending on how the site works (do people vote for files, do you record how frequently files are downloaded?).
The file should not be flagged as having already been picture of the week.
If there are two or more with the highest rating, choose one at random.
- In your database, add a flag to that file saying that it's already been 'picture of the week'.
- Set another database key to the location or ID of that file. Use this key in the future to find out what the current picture of the week is.
Does all that make sense to you?
In order for us to actually create the script, we'll need to know the particulars of how your site works... such as the workings of your database, the way files are rated and so on.