Bitcoin Forum

Other => Meta => Topic started by: piotr_n on November 28, 2011, 08:54:36 PM



Title: Broken links everywhere - is anyone working on this?
Post by: piotr_n on November 28, 2011, 08:54:36 PM
Never mind why, but the entire forum is full of broken links which point to http://bitcointalk.org/index.php?topic=... instead of http://bitcointalk.org/index.php?topic=...

It's not something that an average PHP developer wouldn't be able to handle within an hour.
So please, fix all the old links so they'd still work.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: tysat on November 28, 2011, 09:48:04 PM
Just out of curiosity, you mind pointing to some of the broken links you're running into? (link to the posts they're in)

I don't think I've seen any for while.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: theymos on November 28, 2011, 09:56:00 PM
It's not something that an average PHP developer wouldn't be able to handle within an hour.

Are you volunteering?


Title: Re: Broken links everywhere - is anyone working on this?
Post by: piotr_n on November 28, 2011, 10:08:41 PM
@tysat, not to look far, go to this article:
https://bitcointalk.org/index.php?topic=7269.0
.. and click the first link.

@theymos, no problem, but I'd have to change the source code so it's a matter of trust.
just find the function that writes a post into html and add some str_replace there.
anyone can do it :)


Title: Re: Broken links everywhere - is anyone working on this?
Post by: tysat on November 28, 2011, 10:43:53 PM
Well got that one updated, not sure how many other posts with broken links there are around (that are still relevant posts).


Title: Re: Broken links everywhere - is anyone working on this?
Post by: btc_artist on November 28, 2011, 10:48:12 PM
I'll volunteer to help.  It can actually be done with an SQL query, but a simple < 50 line PHP script could easily handle it.

@piotr_n  The problem is not when users submit new posts, it's old links in old posts.  

theymos, I can throw together a quick run-once PHP script to convert the old links to new ones.  Just let me know if you want it.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: btc_artist on November 28, 2011, 10:50:38 PM
Well got that one updated, not sure how many other posts with broken links there are around (that are still relevant posts).
If you have access to the database, just run the following to see how many posts have broken links in them.

Code:
SELECT * FROM smf_messages WHERE body LIKE '%http://bitcointalk.org/index.php%'


Title: Re: Broken links everywhere - is anyone working on this?
Post by: btc_artist on November 28, 2011, 10:54:00 PM
You could fix the broken links with something like this, but you'd want to test it first before running it on the live database.  It might also change text that wasn't linked.

Code:
UPDATE smf_messages SET body = REPLACE(body, 'http://bitcointalk.org/index.php', 'http://bitcointalk.org/index.php');


Title: Re: Broken links everywhere - is anyone working on this?
Post by: theymos on November 29, 2011, 12:19:50 AM
I don't want to modify the text of any old posts. I'd rather the links be converted during display. Probably best to do it in the same place where linkification happens.

Maybe I'll take a look later if no one else provides the code.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: theymos on November 29, 2011, 12:23:04 AM
Actually, the "censored words" functionality might be sufficient. I set up something (probably broken), and I'll do proper testing in a few hours.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: tysat on November 29, 2011, 12:49:04 AM
Actually, the "censored words" functionality might be sufficient. I set up something (probably broken), and I'll do proper testing in a few hours.

It looks like it is working now... just looked at the links provided above in this post.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: theymos on November 29, 2011, 03:59:46 AM
OK, it seems to be working pretty well.


Title: Re: Broken links everywhere - is anyone working on this?
Post by: btc_artist on November 29, 2011, 05:14:05 AM
Good deal!


Title: Re: Broken links everywhere - is anyone working on this?
Post by: piotr_n on November 29, 2011, 10:12:21 AM
thanks! :)


Title: Re: Broken links everywhere - is anyone working on this?
Post by: deepceleron on November 29, 2011, 03:24:09 PM
Well, now the original post has been "censored" so I can't see what was being talked about. Let's try some stuff:

forum.bitcoin.org

http://forum.bitcoin.org

http://forum.bitcoin.org/index.php?topic=53161.0

Well, I guess those links aren't what was being discussed, as forum.bitcoin.org still redirects here...