Author Topic: Quotes with arbitrary links in them  (Read 4981 times)

0 Members and 1 Guest are viewing this topic.

Offline Iss Mneur

  • 210
  • TODO:
Quotes with arbitrary links in them
Why doesn't the forum support bb code like this:

Quote from: SMF Documentation link=http://docs.simplemachines.org/index.php?topic=57.0
Code: [Select]
[quote=SMF Documentation link=http://docs.simplemachines.org/index.php?topic=57.0][/quote]

That is, why doesn't the url actually auto-link like when you "quote" someone in the forum?  According to the docs it is supposed to work that way.

EDIT:Fixed typo in title.
« Last Edit: June 04, 2010, 02:07:11 pm by Iss Mneur »
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Quotes with arbitray links in them
This works as a stopgap in the meantime: (but yeah I'd like to be able to do that too)

Quote from: http://docs.simplemachines.org/index.php?topic=57.0

Code: [Select]
[quote author=http://docs.simplemachines.org/index.php?topic=57.0][/quote]

 

Offline Fury

  • The Curmudgeon
  • 213
Re: Quotes with arbitrary links in them
Just do it the way jr2 did.
Quote from: http://docs.simplemachines.org/index.php?topic=57.0
blahblah

If it doesn't work like the SMF docs says, there are few possibilities:
1) The docs have been updated for SMF 2.0
2) The docs have incorrect syntax
3) The feature is broken
4) The feature doesn't exist

In any case, nothing I can do about it unless I add it by hand. Which I do not consider worth it, since you can use above example.

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Quotes with arbitrary links in them
Here's the code from our forum.  It appears to be implemented, but that PHP is too dense for me to parse:

Code: [Select]
array(
'tag' => 'quote',
'parameters' => array(
'author' => array('match' => '([^<>]{1,192}?)'),
'link' => array('match' => '(?:board=\d+;)?((?:topic|threadid)=[\dmsg#\./]{1,40}(?:;start=[\dmsg#\./]{1,40})?|action=profile;u=\d+)'),
'date' => array('match' => '(\d+)', 'validate' => 'timeformat'),
),
'before' => '<div class="quoteheader"><a href="' . $scripturl . '?{link}">' . $txt['smf239'] . ': {author} ' . $txt[176] . ' {date}</a></div><div class="quote">',
'after' => '</div>',
'block_level' => true,
),

This is the only occurrence of "link" in the quote tag.  It's possible that it's only implemented if you quote another person's post.

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Quotes with arbitrary links in them
[snip]

This is the only occurrence of "link" in the quote tag.  It's possible that it's only implemented if you quote another person's post.

Thats exactly what that code says it does (which is also what I have found during experimentation). The only interesting thing about that snippet is that apparently you can use threadid in place of topic in the link parameter.

Oh well, I thought maybe I was doing it wrong, as jr2's workaround will work. But, nevertheless it would nice to be able to name the author in the standard quote header as well as link it to some site as,
Quote from: Some Place
Code: [Select]
[quote author=Some Place][/quote] works, but when you combine them it does not.

Anyway, I guess that solves that.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline Goober5000

  • HLP Loremaster
  • 214
    • Goober5000 Productions
Re: Quotes with arbitrary links in them
Well, not necessarily.  There are no fewer than four separate implementations of the quote tag.  If someone could figure out the PHP to add a user-specified link, we might be able to add it.

In fact I could probably figure it out myself, but I don't have time at the moment.  Somebody bug me later, if code isn't provided before then.
« Last Edit: June 08, 2010, 11:52:07 pm by Goober5000 »

 

Offline Fury

  • The Curmudgeon
  • 213
Re: Quotes with arbitrary links in them
I honestly wouldn't want to bother with yet another customization to be re-added after forum upgrade. If anything, it should be brought up in the actual SMF forums and fixed there.

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Quotes with arbitrary links in them
I honestly wouldn't want to bother with yet another customization to be re-added after forum upgrade. If anything, it should be brought up in the actual SMF forums and fixed there.

Ya, I can understand that, but it seems that there is no need as the forum already supports a version that actually does what we need if not quite as intuitivly as I expected.


But based on Goober5000's comment, I figure we couldn't be the first to try and do this. I  checked the source code of the version 2.0 RC that SMF has on their site and it seems that
Code: [Select]
[quote author=Name link=http://example.com]Test[/quote] is still not supported by SMF even though the bbcode reference on thier site says so.

Because the new 2.0 forum software doesn't support, I started looking at the modifications that SMF has available on their site and I found Quote Source Mode which adds the exact code needed to do what I was looking for with the quote using author and link.  The other interesting thing that I found on the page though is this lovely snippet:
Quote from: [url=http://custom.simplemachines.org/mods/index.php?mod=1631]Quote Source Mod[/url]
Code: [Select]
[quote="[url=http://somesite.com]Name[/url]"]Quoted Text[/quote]
which does exactly what I want, even though it is not the expected answer, it obviously works, even on our current build.

So, I guess we now have a solution and nothing needs to be changed except for the documentation.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Quotes with arbitrary links in them
Is there any way to have the PHP or w/e it is do a word/code replacement?  Sort of how the word alot (alot) gets replaced?

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Quotes with arbitrary links in them
Is there any way to have the PHP or w/e it is do a word/code replacement?  Sort of how the word alot (alot) gets replaced?
What is it you want replaced?

But either way it would require more modification to the forum software.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments

 

Offline jr2

  • The Mail Man
  • 212
  • It's prounounced jayartoo 0x6A7232
    • Steam
Re: Quotes with arbitrary links in them

Code: [Select]
[quote author=Name link=http://somesite.com.com]Name[/quote]
Whenever you have the above, replace it with:

Code: [Select]
[quote="[url=http://somesite.com]Name[/url]"]Quoted Text[/quote]

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Quotes with arbitrary links in them

Code: [Select]
[quote author=Name link=http://somesite.com.com]Name[/quote]
Whenever you have the above, replace it with:

Code: [Select]
[quote="[url=http://somesite.com]Name[/url]"]Quoted Text[/quote]
Oh, I see.

If we are going to do that, we may as well just add the "Source Quote Mod" directly, rather than have the forum software do a convoluted post source text transformation, that has the same result.  As either would require modification to the forum software, on which topic Fury has already stated:
I honestly wouldn't want to bother with yet another customization to be re-added after forum upgrade. If anything, it should be brought up in the actual SMF forums and fixed there.

So I doubt that either would happen.  Having said that, I too would like the that to be able to the the quote tag like the "Source Quote Mod" advertises (as it is far more intuitive).
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments