Advertisement:

Author Topic: Quote Source Mod  (Read 8069 times)

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Quote Source Mod
« on: March 11, 2009, 04:31:28 AM »
This Mod is no longer supported.
You can accomplish the same thing with
Code: [Select]
[quote="[url=http://somesite.com]Name[/url]"]Quoted Text[/quote]
If someone wants to borrow code from this mod for theirs feel free.
~Garou

Quote Source Mod v1.4



Introduction:
This Mod adds a new quote attribute, useful when quoting sources from outside your forum.

Features:
When using the quote function you now have the option of the source= attribute similar to quote author= attribute. However this will add a clickable link to a URL of your choosing to the Quote From:Name.

For example previously you could type...
Code: [Select]
[quote author=Authors Name]Quoted text[/quote]to get
Quote from: Authors Name
Quoted text
or
Code: [Select]
[quote author=http://somesiteurl.com]Quoted text[/quote]to get
Quote from: http://somesiteurl.com
Quoted text

This mod now gives the option to use
Code: [Select]
[quote source=Authors Name link=Link to URL]Quoted text[/quote]to get
Quote from: Authors Name
Quoted text

In a quote box, feature not available till mod is installed.

Installation:
To install, simply upload the entire zip file to the package manager (Admin -> Package Manager -> Download New Packages).
This mod should install under all versions of SMF and under all themes as it only changes source code in the ./Sources/Subs.php

Compatibility:
Tested under SMF Versions 1.1.7 - 1.1.10 and 2.0 RC1 - 2.0 RC2

Credits:
Original idea inspired by yutt's World of Warcraft Blizzard Quote BBC

Change log:
Version: 1.4
* Updated to provide better server compatibility, suggested by TAI06GR
+ Updated to install properly on SMF 2.0 RC2

Version: 1.3 August 27, 2009
! Plugged Security loophole allowing scripts in the link. Thanks to the SMF Customization Team for spotting and submitting the fix.
* Changed the Quote from: to the standard variable in SMF rather then it being hard coded in the mod. This allows the mod to support multiple languages.

Version: 1.2 February 10, 2009
* Mod renamed to "Quote Source"
* Usage changed to...
Code: [Select]
[quote source=Authors Name link=Link to URL]Quoted text[/quote]+ Updated to work with 1.1.8 and 2.0 RC1
+ Packaged as an installable mod

Version: 1.1 March 09, 2007
+ Adds clickable link to quote box via Alternate Quote "a-quote" bbc
+ Usage...
Code: [Select]
[a-quote author=Authors Name link=http://Link to URL]Quoted text[/quote]
Legend:
! bug fix
+ added feature
* changed
> Comment
« Last Edit: February 08, 2010, 02:46:26 PM by Garou »

babjusi

  • Guest
Re: Quote Source Mod
« Reply #1 on: March 12, 2009, 10:47:37 AM »
Nice mod. Well done Garou :)

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #2 on: March 14, 2009, 12:04:33 PM »
Thank you  :)

Offline TAI06GR

  • Newbie
  • *
  • Posts: 3
Re: Quote Source Mod
« Reply #3 on: May 06, 2009, 07:40:47 AM »
Du solltest die Sourcezeile abändern, um eine Systemunabhängigkeit sicherzustellen, hatte auf meinen Linux-Server Probleme
nachdem ich die source zeile wie folgt geändert habe gings:
Code: [Select]
'source' => array('match' => '(.{1,192}?)', 'validate' => 'parse_bbc'),

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #4 on: May 08, 2009, 07:19:57 AM »
Übersetzung durch Google

Sie können versuchen, aber es wird sehr wahrscheinlich die Verbindung der mod.


Offline TAI06GR

  • Newbie
  • *
  • Posts: 3
Re: Quote Source Mod
« Reply #5 on: May 08, 2009, 03:00:31 PM »
Übersetzung durch Google

Sie können versuchen, aber es wird sehr wahrscheinlich die Verbindung der mod.


upss sorry, my English is good enough, i'm only forgot  that this is the english part of SMF

Du solltest die Sourcezeile abändern, um eine Systemunabhängigkeit sicherzustellen, hatte auf meinen Linux-Server Probleme
nachdem ich die source zeile wie folgt geändert habe gings:
Code: [Select]
'source' => array('match' => '(.{1,192}?)', 'validate' => 'parse_bbc'),
You should change the line "source" because \w+ is not System independent, on my Linux Server the mod only run after change the line into:
Code: [Select]
'source' => array('match' => '(.{1,192}?)', 'validate' => 'parse_bbc'),

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #6 on: May 08, 2009, 09:40:20 PM »
Thanks, Ill keep that in mind for a future update. Since I borrowed code from one of Yutt's old outdated mods, I assumed the w+ was needed to make the mod work the way I wanted.

Offline marko_andres

  • Full Member
  • ***
  • Posts: 402
  • Gender: Male
  • Chileno con Aguante!
    • Chile Underground
Re: Quote Source Mod
« Reply #7 on: August 26, 2009, 01:34:36 AM »
for 1.1.10 is available  ??
Version SMF: 2.0 RC3
Theme        : Inferno
Portal          : Simple Portal 2.3.2


Por un cambio de conciencia --> http://thezeitgeistmovement.com/

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #8 on: August 26, 2009, 11:50:09 AM »
Should work just fine under any 1.1.x or 2.x versions of SMF but I haven't had the chance to test with the latest versions.

Offline Shannar

  • Semi-Newbie
  • *
  • Posts: 41
  • =*=
    • Homepage
Re: Quote Source Mod
« Reply #9 on: October 08, 2009, 04:53:57 AM »
This mod don't work in my SMF 1.1.10.

Why it possible?
Sorry for terrible English. My native language is C++ Russian.

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #10 on: October 08, 2009, 05:47:49 AM »
TAI06GR pointed out out several posts back that some servers can not handle the code "\w+".

He sugested that...
Code: [Select]
'source' => array('match' => '(\w+)'),be replaced with...
Code: [Select]
'source' => array('match' => '(.{1,192}?)', 'validate' => 'parse_bbc'),
I never tested this myself as I could not find any information supporting his claim, in fact  \w+ is a pretty standard regular expression. I don't know why it wouldn't work unless maybe the host is using an outdated version of php or something.

None the less TAI06GR's suggestion should work, as SMF uses that variation in a few places.




Offline Shannar

  • Semi-Newbie
  • *
  • Posts: 41
  • =*=
    • Homepage
Re: Quote Source Mod
« Reply #11 on: October 08, 2009, 05:58:12 AM »
TAI06GR pointed out out several posts back that some servers can not handle the code "\w+".

When he wrote this, I didn't understood, what he mean. Now fix — and all working! Thnx!
Sorry for terrible English. My native language is C++ Russian.

Offline Shannar

  • Semi-Newbie
  • *
  • Posts: 41
  • =*=
    • Homepage
Re: Quote Source Mod
« Reply #12 on: October 08, 2009, 06:00:40 AM »
How about change 'source' to 'author'? For uniformity?
Sorry for terrible English. My native language is C++ Russian.

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #13 on: October 08, 2009, 09:49:40 AM »
When I originally wrote/borrowed the code from yutt's World of Warcraft Blizzard Quote BBC...

I was helping to moderate a friends site. He wanted the ability to quote and credit other websites and outside sources. After asking for help, I found Yutt's mod and that wasn't what my friend wanted. He said it worked if you wanted to quote Blizzard but he wanted it to be used for any site and to integrate into the forum better.

To then I decided to take apart Yutt's mod and make it do what I wanted. I couldn't make it work using "quote author link" without breaking the other "author" options in the existing quote function. I then set it up so that it used a different BBC tag altogether, [a-quote] instead of the quote tag. That worked well enough for my friend so I left it at that.

Then a couple years later I had an epiphany that "source" made more sense then "a-quote" and I planed on changing the tag to [source] but I decided to try to make it work with the existing quote tag again. Again it failed and just for fun I though what if I changed "author" with "source" and it magically started working. So I went ahead and packaged it up as an official mod.

There are two other things I have thought of changing, to better differentiate the mod from the standard quote function. The first was either changing the BBC tag to [source] as originally planned and or changing the language string where it says "Quote from:" to "Source:"
« Last Edit: October 08, 2009, 11:27:41 AM by Garou »

Offline Garou

  • Sr. Member
  • ****
  • Posts: 759
  • Gender: Male
  • On Hiatus.
    • Balance Games
Re: Quote Source Mod
« Reply #14 on: November 11, 2009, 09:57:02 AM »
Oops! I accidentally uploaded the development version of version 1.4 of the mod.   :-[

The old file may not install or work properly with the public version of SMF 2.0 RC2. There were some changes  between the charter and public versions of the SMF release but the file on the downloads page now should work. :)

Offline PalmBeachPreps

  • Jr. Member
  • **
  • Posts: 169
  • Gender: Male
    • Palm Beach Preps
Re: Quote Source Mod
« Reply #15 on: November 22, 2009, 09:37:43 PM »
Great mod.  Worry-free install on RC2

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Quote Source Mod
« Reply #16 on: September 30, 2019, 11:03:02 AM »
while I see that this mod is no longer supported but thank you for the mod :)

you missed a closing div, so that everything after the quote is still surrounded by the quoteheader ;)

the code to add should be
Code: [Select]
array(
'tag' => 'quote',
'parameters' => array(
'source' => array('match' => '(.{1,192}?)', 'validate' => 'parse_bbc'),
'link' => array('match' => '(((https?|ftps?)+(:\/\/)|www?)+(.+?))'),
),
'before' => '<div class="quoteheader"><div class="topslice_quote">' . $txt['quote_from'] . ': <a href="{link}">{source}</a></div><blockquote>',
'after' => '</blockquote><div class="quotefooter"><div class="botslice_quote"></div></div></div><br />',
'block_level' => true,
),

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,972
    • StoryBB/StoryBB on GitHub
Re: Quote Source Mod
« Reply #17 on: September 30, 2019, 11:49:48 AM »
Why use it when the description makes it clear that you can do it without changes to SMF?
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.

Offline shadav

  • Jr. Member
  • **
  • Posts: 208
  • Gender: Female
Re: Quote Source Mod
« Reply #18 on: September 30, 2019, 12:00:27 PM »
Why use it when the description makes it clear that you can do it without changes to SMF?
maybe something i've added messed it up but I tried with
Code: [Select]
[quote="[url=http://somesite.com]Name[/url]"]Quoted Text[/quote]and it came out all messed up  :laugh:
Code: [Select]
Quote from: "Name[/url" class="bbc_link" target="_blank">"]Quoted Text

Offline Arantor

  • Resident Overthinker
  • SMF Friend
  • SMF Legend
  • *
  • Posts: 71,972
    • StoryBB/StoryBB on GitHub
Re: Quote Source Mod
« Reply #19 on: September 30, 2019, 12:06:44 PM »
Quote from: Name
Quoted Text

Works for me...
Don’t try to tell me that some power can corrupt a person. You haven’t had enough to know what it’s like.

No good deed goes unpunished / No act of charity goes unresented.