MyBB Community Forums

Full Version: Modified Quote
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Compatible with all major browsers and IE7+, works best with Javascript enabled.

After reading this post by brad I decided to give something like it a try.

What you can expect from this MyCode

[attachment=32074]

(External link as well as name of what you're quoting from, both of which are optional)

Regular Expression:
\[quote(?: )?(?:name=(?:"|\"|')?([^"]+)[\"']?(?:"|\"|')?)?(?: )?(?:url=(?:"|\"|')?([^"]+)[\"']?(?:"|\"|')?)?\]((.*?|(?R))*)\[\/quote\](\r\n?|\n?)

Replacement:
<blockquote><cite class="clear"><b id="quote_name">$1 said:</b><a href="$2" target="_blank" style="float: right;"><img src="images/external_link.png" alt="External Quote Link" /></a></cite>$3</blockquote>

<style type="text/css">blockquote a[href=''] { display:none; }</style><script type="text/javascript">var quoteName = document.getElementById('quote_name');if(quoteName.innerHTML == " said:"){quoteName.innerHTML = 'Quote:';}</script>

Usage:
[quote name="Google" url="http://google.com"]Quote text here[/quote]

Lastly you have to upload the attached image to your "forum_root/images/" directory.

[attachment=29315]
Its great. I take it that it uses the same styling as the normal quote?

Well now brad will have a better case with getting this added.
The devs don't need to do any work Wink
Cool stuff.

What happens with a quote that's linked internally?
Fork - implement - pull request. Smile
(2013-05-14, 04:05 PM)brad-t Wrote: [ -> ]Cool stuff.

What happens with a quote that's linked internally?

It'll just default to the original quote MyCode. Smile

(2013-05-14, 06:41 PM)Tomm M Wrote: [ -> ]Fork - implement - pull request. Smile

< Gitnub
What's the theme used in your image?
It's the default theme for MyBB 1.8. Though this code will work on previous versions of MyBB as well.
(1970-01-01, 12:00 AM)Google Wrote:Quote text here

Really need more? Toungue Nice one though.
The code for that solution is really inelegant. In addition, you can get rid of "said" for external links and do lots of other cool things by breaking it out into its own MyCode.
Whatever. That spoil-on-hover looks quite awesome.
Pages: 1 2