New feature: friendly URLs

:persecutioncomplex:

Please report bugs. :stuck_out_tongue:

I tried to greet them but they weren’t friendly at all. Damn “friendly” URLs! … What is a friendly URL?
PS: Your avatar is broken.

My avatar is broken because I killed a random pid that was taking too much CPU on my server.

A friendly URL is an URL that doesn’t pout.

of course this is waaay better, as you can finally see from the url what it is
like most news links

but obviously, now all the old links, especially through the forum, are all wrong and lead to 404, unless you kinda redirect them so that it works D=

ah yes, bug: when you click on thread x page n, it brings you to page 1 always, not page n

http://www.java-gaming.org/posts/tuer-truly-unusual-experience-of-revolution-fps-using-jogl/page-32/view/topicseen.html
last page of TUER, but brings you to page 1

http://www.java-gaming.org/posts/go-on-ask-me-anything/message-210832/view/topicseen.html#new brought me to page 1 instead of page 10 where there were a couple of new messages.

Yep I can also confirm new messages don’t get shown, but instead goes to Page 1.

Only two bugs I can find are the two above.

On the other hand, the url in my signature updated to the new format automatically, neat!

He didn’t rewrite the forum software but added a couple of rewrite rules, the old url’s will still work :wink:

Mike

Can you show me an example?

Only the URLs with ‘topicseen’ seemed to be affected. Navigating through pages of threads obviously was tested, and it didn’t occur to me that ‘topicseen’ (reached from ‘unread posts’) was some kind of special case. Fixed now.

nice new feature.

edit: ok, my attempt to include a - in the post title didn’t test too well, guess would need to test what happens in a new threads title :slight_smile:

What was expected, what was the actual result?

BTW: message titles don’t affect the URL, it’s all about the title of the first post. If the topic title is changed, the friendly URL will not change, for obvious reasons.

Very nice, and adds a new level of polish to the forum.

I’m using a fairly inefficient approach: buffering the output of SMF into a string, unleashing regex and making a bunch of SQL queries, then sending the result to the browser. The mod_rewrite engine sends REQUEST_URI to a ‘prg:/super_secret/mod_rewrite.php’ which looks up the ‘topic-title’ in a new table, mapping topicid<->url_injected_title.

The whole process takes 3ms, which is perfectly acceptable, as SMF itself takes about 200-300ms per page. :expressionless:

Was just curious how you handled - as i noticed that spaces are replaced with - but yeh as you point out posts titles aren’t used, only the thread title, thats why it didn’t test well :slight_smile:

well I just assumed that would be the case, but isn’t
well done and stuff

So, just because you can come up with a potential bug, you don’t even bother to verify it, just saying it is bugged, stating how it goes wrong, wasting my time trying to figure out what’s going on.

yeah that’s right.

Riven,
Not exactly a bug, but the emails I get from JGO have the old links :slight_smile:

Completely rewritten, to remove a SPOF* :cranky:

Please report any (new) bugs.

  • mysql_connect(...) completely breaks after you run service mysqld restart in a long-running PHP process, it tries to reconnect to the old file-descriptor, which is obviously invalid after mysqld comes back up. mod_rewrite -> RewriteMap prg: therefore could stop functioning and the whole forum would be down, forever. I currently store topic-ids and board-ids in the URL, so I can use plain and simple mod_rewrite -> RewriteRule to reconstruct the original SMF URL.