1 (edited by Dr.Jeckyl 2007-06-05 08:19)

Topic: how to fix urls after a conversion from vb?

well i guess it's time to fix all the urls that are left over from my conversion from vb to PunBB. it's been a samll annoyance that i should have taken care of right after the conversion but didn't. that said is there a sql query i can run to go through all the bad urls and replace them with good urls? i know it may be a long shot but i think it's still worth a shot. i can be your guinea pig, if you will tongue

the vb urls look like this:

[ url="http://www.website.com"]text[ /url]

which produces a url like this:

http://"http//www.website.com

and as you know the PunBB ones look like this:

[ url=http://www.website.com]text[ /url]

without the quotes. so i'd imagine that the query would have to go through all the urls and remove the quotes ONLY in those kind of urls.

any help would be appreciated.

oh, forgot to post a link to an example.
http://theplatoon.com/viewtopic.php?id=27  first post by me.

~James
FluxBB - Less is more

Re: how to fix urls after a conversion from vb?

I think if you wrote a script that simply got the post contents, ran preparse_bbcode on it, and put the updated contents back in the database you would be OK

Re: how to fix urls after a conversion from vb?

way beyond my capabilities bud. big_smile

~James
FluxBB - Less is more

Re: how to fix urls after a conversion from vb?

why not download the sql and then open the sql and then replace [ url=" for [ url= and "] to ]
should that not be the easiest way?

Re: how to fix urls after a conversion from vb?

find and replace

Re: how to fix urls after a conversion from vb?

kierownik wrote:

why not download the sql and then open the sql and then replace [ url=" for [ url= and "] to ]
should that not be the easiest way?

sql is greek to me but i'll give it a shot. not right now but i'll post here the results... or progress rather.

thanks for the quick replies.

~James
FluxBB - Less is more

Re: how to fix urls after a conversion from vb?

Export the database and open it in a text editor, it's plain text, you don't need to know greek at all. Just find and replace.

8

Re: how to fix urls after a conversion from vb?

If the VB url's are like the top example you posted, the parser strips the ""'s by default.

Re: how to fix urls after a conversion from vb?

MattF wrote:

If the VB url's are like the top example you posted, the parser strips the ""'s by default.

It strips them in preparse, which gets applied to posts before they're put into the database. Hence my suggestion tongue

10

Re: how to fix urls after a conversion from vb?

Oops. big_smile

11 (edited by Dr.Jeckyl 2007-06-06 06:15)

Re: how to fix urls after a conversion from vb?

ok i think i've gotten somewhere... the links in the exported sql file are a tad different. they look like this:

[ url=\"http:

with the extra backslash. i've tried to find and replace with the url structure in my first post but it found 0 instances of the wrong url. i tried with the url structure i just found and it found 1800+ of them. i'm going to try this on a test board either later tonight or tomorrow. i'll post the results.

edit: why does the urls in the sql file have that slash?

~James
FluxBB - Less is more

Re: how to fix urls after a conversion from vb?

edit: i just figured a quicker and painless way of doing this... just resubmit the posts. edit + do nothing + submit = clean urls. big_smile i'll just do this as i come along them.

~James
FluxBB - Less is more

Re: how to fix urls after a conversion from vb?

Dr.Jeckyl wrote:

edit: i just figured a quicker and painless way of doing this... just resubmit the posts. edit + do nothing + submit = clean urls. big_smile i'll just do this as i come along them.

Yup, because preparse gets called on them tongue