News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Link Format

Started by SMiFFER, June 21, 2018, 02:13:26 AM

Previous topic - Next topic

SMiFFER

The standard format of links is in my 2.0.15:
../forum/index.php?topic=ttttt.msgmmmmm#msgmmmmm

where ttttt is the topic id
and mmmmm the message id

I find that unpractical, hence I moved to ONLY link to the message, no longer the topic

../forum/index.php?msg=mmmmm

How can I configure SMF to only produce these shorter links?
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Kindred

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

GigaWatt

I think there is no way to do it in 2.0.x... although I think this issue was addressed in 2.1, since, in some cases, when a thread/topic has been split, the links to topic=ttttt no longer apply for messages/posts in the new split topic... and I think this was addressed somehow... it's kind of a blur, I think shawnb61 explained it... in the new system, posts will get only message IDs and there will be no topic IDs in the links, so that even if topics are split and there is a link to a message that was in the new split thread, this won't mess up the link to the post ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

Biology Forums

SMF comes with a feature that shortens URL's already:

https://yoururl.com/index.php/topic.3535 (something like that)

Otherwise you could try pretty URL mod.

Illori

that is still based on topic id, the user wants it based on message id. this way if the message moves you still end up at the right message.

Arantor

And while SMF recognises the msg= links even in 2.0 the entire platform doesn't issue them. So literally everywhere that has a link to a topic needs to be changed. It's a massive amount of work.

SMiFFER

Quote from: GigaWatt on June 21, 2018, 12:03:54 PM
I think there is no way to do it in 2.0.x... although I think this issue was addressed in 2.1, since, in some cases, when a thread/topic has been split, the links to topic=ttttt no longer apply for messages/posts in the new split topic... and I think this was addressed somehow... it's kind of a blur, I think shawnb61 explained it... in the new system, posts will get only message IDs and there will be no topic IDs in the links, so that even if topics are split and there is a link to a message that was in the new split thread, this won't mess up the link to the post ;).

This is EXACTLY what I have in mind!
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

shawnb61

There are different aspects of the behavior...

In 2.0, message links are in the "?topic=33.msg60#msg60" format.
In 2.1, message links are in the "?msg=140656" format.

When quoting, the above is used.  The latter (2.1) format is clearly preferred, because messages are sometimes moved and the topic/msg reference gets broken. 

The msg=999999 format actually works for both 2.0 & 2.1 if you type it in the url.  But the links aren't built or supported that way when messages are quoted in 2.0. 

In both environments, the url gets rewritten into the 2.0 format when the page is displayed. 

Without several changes in the quote & bbcode logic, 2.0 won't honor the neater 2.1 quote format.  I suspect it is not a priority fix. 

I wrote Q&D utilities to identify & repair the links that were broken, but given that NOBODY on my forum has ever reported this as an issue, I haven't run the repair utility on my prod forum (although I've tested it & it works... it's surprisingly simple...).  High risk, little benefit.

To find the broken quote links, you can run this:
https://github.com/sbulen/sjrbTools/blob/master/SMF_Topic_Link_Diag.php

Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

GigaWatt

Quote from: shawnb61 on June 24, 2018, 01:30:50 PM
The msg=999999 format actually works for both 2.0 & 2.1 if you type it in the url.  But the links aren't built or supported that way when messages are quoted in 2.0.

Or if you pasted a link to a post in another post... or anywhere :) :D. For example, your post has the following URL.

https://www.simplemachines.org/community/index.php?topic=560866.msg3977227#msg3977227

Quote from: shawnb61 on June 24, 2018, 01:30:50 PM
To find the broken quote links, you can run this:
https://github.com/sbulen/sjrbTools/blob/master/SMF_Topic_Link_Diag.php

Great tool ;)... along with some other ones, definitely check shawnb61's GitHub page ;).
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

SMiFFER

Quote from: shawnb61 on June 24, 2018, 01:30:50 PM
There are different aspects of the behavior...

In 2.0, message links are in the "?topic=33.msg60#msg60" format.
In 2.1, message links are in the "?msg=140656" format.

When quoting, the above is used.  The latter (2.1) format is clearly preferred, because messages are sometimes moved and the topic/msg reference gets broken. 

Then most obviously I must wait for 2.1 - once again. But I am waiting for years already. Waiting really gets too long and the list of things that I am waiting for gets too long, too.

Pity. But thanks for pointing me to 2.1.
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Steve

Marking solved then. If you have any other questions regarding this topic, by all means, mark this unsolved and let us know.
DO NOT pm me for support!

SMiFFER

Thanks, Steve, though I cannot quite call it "solved" - rather postponed/procrastinated until indefinite time, when 2.1. Gold FINALLY comes.
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Arantor

Every time someone complains how long a project run by volunteers in their spare time takes, they add another week to the release date.

(None of the SMF devs are paid. Therefore they have real lives, jobs, families, etc. which shockingly take precedence over what is essentially a hobby project.)

SMiFFER

We have heard that already.
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

Kindred

and yet you don't seem to comprehend it...
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Arantor

No, he comprehends it, he's just too selfish about his wants to give a damn about anyone else.

GigaWatt

@SMiFFER: You don't seem to get that people usually pay for stuff to be coded for them. Every single one of us should be grateful for anything that is released as free or open source software, not wining about every little thing that they think is not as it supposed to be.

That being said, since the forum software is free, why not pay someone to code that for you, see how much it costs... might change your view on things.
"This is really a generic concept about human thinking - when faced with large tasks we're naturally inclined to try to break them down into a bunch of smaller tasks that together make up the whole."

"A 500 error loosely translates to the webserver saying, "WTF?"..."

mattizzy

You'll regret it in a long run. that's a lot of work to do you know.

if topics are msg=1234, what will the actual msg be? still msg=1234?.

I don't think you are seeing this the right way. besides topic=1.0 is pretty short.

topic=1.0.blahblah can be long cause we don't send it to Google. besides that's okay.

SMF sorts topics and their message. if they consider only message, then I don't think messages will have a topic.
I am only an SMF Addict. I think I took overdose.

aegersz

The configuration of my Linux VPS (SMF 2.0 with 160+ mods & some assorted manual tweaks) can be found here and notes on my mods can be found here (warning: those links will take you to a drug related forum). My (House) music DJ dedication page is here

shawnb61

Please stay on topic folks. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Advertisement: