Hi, I'm new to this forum and would like to apologize in advance for the "general" nature of this question. I am a new moderator for another Forum type website. The website has for years had no image upload feature and had users place in their posts external links to free photo hosting sites.
Recently, the website added a feature to upload images directly onto their server, allowing them to be locally archived rather than remotely linked to the other photo hosting website.
Now, 99.9 % of the Forum users have never purchased prints from the photo hosting site, including myself. Though the host site has never sent me any notification on my account, the older picture links on my posts have ceased to work, displaying only red X's instead. This is now beginning to happen all over the Forums, creating a slow errosion of images from the older posts.
It would be ideal to create some type of program or utility to "saveas", then convert all of the older images to the new local hosting, thus eliminating the problem. This would solve the problem for the newer externally linked images - unfortunately the older ones are probably lost.
+++++++++++++++++++++++++++++++++++++++++++
This seems like the logical way to go about it:
1) Mod temporarily locks topic for "maintenance" and copies thread to "backroom" area of the Forum.
2) Mod then runs a utility that:
a) Searches the thread for URL bbcode to indicate external image hotlinks,
-and-
b) Performs "saveas" of
http://[freephotohostingsite].com/[FILENAME] to
http://[forumwebsite].com/[SAME FILENAME] (Archiving the external image link to the local server)
-then-
c) Does a find/replace search through the thread's body text to replace all occurances of the phrase "http://[freephotohostingsite].com" with the phrase "http://[forumwebsite].com".
3) The mod does a quick Q.C. check the next day and if everything looks good, overwrites the old thread with the new corresponding "image converted" thread, and unlocks the topic.
+++++++++++++++++++++++++++++++++++++++++
Does anyone have any sample code or good ideas on implementing the items 2a, 2b, and 2c above?
Any help would be much appreciated!
A&N