Jump to content

Question about "FileExists" Command


Recommended Posts

I am in need of your assistance. I am working on trying to get the last little bit of the Theme and Layout selector working. Just need it to do some error checking prior to loading.

I need to do a check on about 50+ files (The graphics and such) I need the system to check an make sure the file is there and if not a message pops up and lets the user know what files are missing and then notify them that Theme is switching to "Classic Theme". What is the easiest way to do this as I am not sure?

I need something like this :o

if (!FileExists(wpipath + " Themes\\" + Theme + "\\ allbutton.gif"))
{
alert(“allbutton.gif file does not exist.\n\nSwitching to 'Classic', the default Theme.");
Theme='Classic';

return false;
}

But I would need to do this for every file in the folder. Is there an easier way to do this than have 50+ “FileExists” checks?

I would want it to list out all missing files onscreen once the checks are done, not every check, maybe also have the list sent to a debug file for later use so that can check what files are missing.

Also I would need it to check to see if the current selected theme is “Classic” and if it is and is missing files to report “Classic Theme damaged. Please reinstall!” Then exit program.

Let me know if you have an easy solution.

Thank you,

- Albert

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...