News:

Want to get involved in developing SMF? Why not lend a hand on our GitHub!

Main Menu

[SMF 2.0 RC1] redundant message ID in anchor URL

Started by Kolya, March 16, 2009, 01:18:15 PM

Previous topic - Next topic

Kolya

With pretty links option:
http://www.test.com/index.php/topic,25.msg6449.html#msg6449

Without pretty links option:
http://www.test.com/index.php?topic=25.msg6449#msg6449

This is probably not a bug as it works. It just looks redundantly long. I don't remember the message ID being doubled like that, but I'm not sure.

karlbenson

This is not a bug.

Its an anchor that the browser uses to go to move you to the correct post.
(so if its 4th post, it will tell the browser to scroll down.

Kolya

I understand the part about the anchor. I take it that SMF uses the first message ID to find the page to render and the second message ID is used by the browser to scroll down. Both functions could probably be unified, but yeah, since it's not a bug, it's not too important. Thanks for your answer!

karlbenson

They cannot be unified, because the #anchor is never sent to the server. It is only browser side.
Plus we need to use the msg id to point you to the correct place in the topic for that message.

Kolya

I see. Just had a quick check and noticed vBB does the same. Although they do manage without a topicID (eg http://www.test.com/showthread.php?p=123#post123), presumably by continously counting posts.
SMF also counts posts continously and hence finds a post when it has been moved to another topic. So since we're on the topic, what's the topicID for?

karlbenson

well topic ids are important.

Message ids are only used in topic linkswhen you going to particular post.
Most of the time it uses pagination instead
eg
?topic=10.20

The difference being, you want those links in search engines and that you don't want individual messages in google.

SMF 2.0 also has ?msg=243141, however that only takes you to a single message, and is currently only used for warnings.

Kolya

Thanks for taking the time to explain, I appreciate it.

!wooha

Quote from: Kolya on March 17, 2009, 01:56:23 PM
Thanks for taking the time to explain, I appreciate it.

Thanks from me too! (even though I didnt ask the original question :D)

good job, RegEx!

Advertisement: