The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Change URL to board in posts...
I just moved my board to a different directory on the server. I moved it to the root www level. Is there a way to search through all the posts for all instances of forums.jjr512.com and replace each with www.jjr512.com?
|
#2
|
||||
|
||||
Use MySQL's REPLACE() function on pagetext in the post table.
|
#3
|
||||
|
||||
I looked that up and didn't really understand it.
I figured a little script like this would do the trick. While it produces no errors, it also doesn't actually do anything. Can you tell me why? PHP Code:
|
#4
|
||||
|
||||
It wont work because you are assuming that postids are consecutive in db while they are not. For example you might have deleted the postid 3 in your db, however your code still tries to replace its pagetext..
If you want to stick with your code, your best bet is to get all pagetexts first with select (in 1 query) and then parse them (If your db is big this might be a problem though) However what Firefly suggested is the best and easiest method to handle what you are trying to do, so if I were you I wouldnt bother with writing my own code.. My 2 cents.. |
#5
|
||||
|
||||
OK, well, can someone explain how to use that replace() funtion, exactly?
|
#6
|
||||
|
||||
Code:
UPDATE post SET pagetext = REPLACE(pagetext, "find", "replace"); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|