Converting links in old topics - how many levels should be auto converted?

Started by Rk2910, April 01, 2015, 05:37:27 AM

Previous topic - Next topic

Rk2910

When I converted from phpbb to smf most of our links that a member embeds in a post, to another topic on our site are updated to the equivalent smf topic but some buried 2 topics down are not.  Ex: I post a link to direct a member to go look at another topic for reference.  It works as expected and if it was an old post when I converted, was converted. That old topic has a link that refers to another topic - those are not converted, the link takes them back to our old site which I would like to delete one day.  We typically find these unconverted links in very old posts. Is there a way to rerun something that will convert everything?  It's very painful to do this manually.


margarett

It didn't "convert" links ;)

What happens is that any topic, be it old or new, has a unique ID. While SMF and phpBB have different ways to handle the links to topics/posts, when the software is running, you can always link to any existing topic/post, no matter if it was created before or after the conversion, because all it matters is its ID.
Even the very first topic that your phpBB setup had (eg, "Welcome to phpBB", topic ID = 1), SMF can handle it because it links to its ID and *not* to how it was created.

Topic links in posts, on the other hand, are not converted because they are just that, links.
A link inside the post to http://www.simplemachines.org/community/index.php?topic=535221.0 is not different from a link to http://www.google.pt
So when you convert, well, the posts content isn't changed. That's why your old posts to old links fail, because they are just text inside a post (which, incidentally, SMF parses as a link but, in the database where it matters, they are just text).

The only possibility is to build a custom script that checks all your forum posts, looks for the "old pattern" of phpBB, extracts IDs and replaces all of that with a valid link in SMF format (eg: www.forum.com/index.php?topic=xxxxxxx)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Rk2910

Ahh, so this is where my thread ended up.  I posted it over on 2.0 support and someone moved it without leaving a link.  I couldn't find it.  Sorry I double posted - I knew I posted it but couldn't find it anymore.

Thanks for the reply Bruno - doesn't sound like it is going to be fun.  Have you seen an existing mod that does this?

margarett

There is no mod because it's always a custom "thing". I did something similar for another forum some time ago and it wasn't funny at all :(

I can take a peek at this in the next days. If you can link me a topic where this happens, that would help ;)
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Rk2910

When we run into one again I'll save it and post it here for you.  Thanks Bruno.

Rk2910

It didn't take long to run into one  O:)
The problem is as a regular user and you click on the link, there is a redirect to the new site so you can't get to the old site. Hmmm.  Have to figure this part out.

margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Rk2910


margarett

OK, in this case I think it's really better to create a "fake" viewtopic.php that picks the requested topic ID + message ID and redirects it to the proper SMF post.
It's easier than to "hammer" the complete database (because the links can pretty much vary)

In that case, you would need to remove phpBB's "viewtopic.php" (rename it to something else, maybe) and put that new script in its place.

Regarding the link you pointed out: viewtopic.php?f=8&t=7552
Do you know what's that f=8? t=7552 is the topic number but I don't really understand what's the f=8 ???
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: