Author Topic: script to update the forum  (Read 1524 times)

neko kyouran

  • Guest
script to update the forum
« on: February 03, 2009, 10:55:20 pm »
to all you smf coding junkies:

see if there is a script that the admins can run that will go through every post on the forums and for every instance of hydlaa.com change it to hydlaaplaza.com

if not, i'm just going to have to go through and manually do it.....  already completed some of the stickies... it's just time consuming.

if you find something, please post and we can take a look at it and hopefully use it. 

and then all the old links will work again.  :)

Caarrie

  • Forum Addict
  • *
  • Posts: 3369
  • We want no UNFIXED bugs!!!!!!!!!!!!!
    • View Profile
    • PlaneShift3dMods
Re: script to update the forum
« Reply #1 on: February 03, 2009, 11:34:54 pm »
cant acraig just do a mysql query find and replace it? something like
update [prefix_messages] set [body] = replace([body],'[hydlaa.com]','[hydlaaplaza.com]');

a similar fix for the bug tracker would be nice as well
« Last Edit: February 03, 2009, 11:39:15 pm by Caarrie »

Tuxide

  • Hydlaa Notable
  • *
  • Posts: 715
    • View Profile
    • Banker
Re: script to update the forum
« Reply #2 on: February 03, 2009, 11:58:06 pm »
I can probably write a bot that can spider the entire forums and do this in Java.

Do you want some of the older URLs retrieved as well?  For example, change

http://www.planeshift3d.com/wbboard/thread.php?threadid=6060&boardid=1&styleid=3&sid=58caf7bb67f280e7ff49d6987b965fe4

to

http://www.hydlaaplaza.com/smf/index.php?threadid=6060&boardid=1&styleid=3&sid=58caf7bb67f280e7ff49d6987b965fe4

and change

http://planeshift.oodlz.com/wbboard/thread.php?threadid=20629&boardid=13&styleid=4

to

http://www.hydlaaplaza.com/smf/index.php?threadid=20629&boardid=13&styleid=4

EDIT:  Also I think it should only change the URL if the new one actually goes somewhere meaningful.  For example, some changes will redirect to http://www.hydlaaplaza.com/smf/ instead which is less than ideal.
« Last Edit: February 04, 2009, 12:00:54 am by Tuxide »

neko kyouran

  • Guest
Re: script to update the forum
« Reply #3 on: February 04, 2009, 03:20:37 am »
I'd say use your best judgment and create something.  I'll try my best to pass it along through repeated pokings to have someone take a look at it.....

hopefully, we'll can get something created to update the massive amount of links that are now broken and very non user friendly.

Tuxide

  • Hydlaa Notable
  • *
  • Posts: 715
    • View Profile
    • Banker
Re: script to update the forum
« Reply #4 on: February 06, 2009, 07:00:59 am »
OK I'll see what I can do this weekend.  I've already written a web-based tool for this forum and I'll just expand on it and provide you with a URL.

Tuxide

  • Hydlaa Notable
  • *
  • Posts: 715
    • View Profile
    • Banker
Re: script to update the forum
« Reply #5 on: February 09, 2009, 09:47:27 am »
Bah I completely forgot to do this, it'll have to wait until next weekend.

LigH

  • Forum Legend
  • *
  • Posts: 7096
    • View Profile
Re: script to update the forum
« Reply #6 on: February 09, 2009, 10:52:26 am »
If I had direct access to the MySQL database, I'd prefer an SQL command like Caarrie suggested. That would be most efficient. But I might be risky, so a backup before is recommendable.

Gag Harmond
Knight and Ambassador
The Royal House of Purrty

Tuxide

  • Hydlaa Notable
  • *
  • Posts: 715
    • View Profile
    • Banker
Re: script to update the forum
« Reply #7 on: February 10, 2009, 04:17:00 am »
Well I don't know the schema of the tables and I don't know if this or Flyspray does any caching.  Plus I think it would be more ideal if a moderator can run it instead of having something that acraig will have to execute.  Also it should update the thing on the bottom that says when the post was last edited anyways.

Tuxide

  • Hydlaa Notable
  • *
  • Posts: 715
    • View Profile
    • Banker
Re: script to update the forum
« Reply #8 on: February 16, 2009, 07:16:18 am »
Bah I didn't get to it this weekend either; it will be next weekend.  I think it's a good idea if such a program is ran towards the end of a month and not the beginning or middle of it.