.oO(contender54)
Quote:
I do have php on my server and locally which is where I am making the changes.
I haven't pushed up the files yet.
The big problem is I only know PHP enough to get myself in trouble. But thanks
for the suggestion. Maybe I'll look around the php site's to see if anyone has
already created something similar. Or if you would like to help out that would
be great!. |
OK, I've played around a bit ... the script has become slightly more
complicated because of some error checking and statistics:
<http://www.mfesser.de/temp/rename/rename.php> (plain source code)
<http://www.mfesser.de/temp/rename/rename.phps> (highlighted syntax)
Store it somewhere on your disk where the webserver can reach it.
After that adjust the PATH constant which is defined at the beginning of
the script to point to the directory where your pages are stored. It has
to be the absolute path from the root of the filesystem (on Unix it's
usually something like "/var/www/...", on Windows for example
"c:\apache\htdocs\...").
Then call the script in your browser, e.g.
<http://localhost/rename.php>
It opens the given directory (and all subdirectories if existent) and
checks what files can be renamed. In this first step _no_ renaming is
done, the script only prints out how it _would_ rename the files if
possible. For 30.000 files this could take a while ... At the end it
dumps a simple statistic with the number of found files, errors etc.
If everything looks fine without too many "failed"-messages (ideally the
"loaded" and "skipped" numbers should be the same, while "renamed" and
"failed" should be zero), call the script a second time, this time with
an URL-parameter "rename", e.g.
<http://localhost/rename.php?rename>
It now renames the files.
It would be wise to make a backup of the files before performing this
second step. I've tested it on my system and it works, but of course
that's no guarantee that it works 100% on your system (there could arise
some problems with titles containing some special chars for example).
Additionally I've only tested it on my Linux box, I can't test it on
Windows (but it should also work there).
HTH
Micha