Modified Quote
#1
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

   

(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.

   
Reply
#2
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
Reply
#3
Cool stuff.

What happens with a quote that's linked internally?
Reply
#4
Fork - implement - pull request. Smile
Reply
#5
(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
Reply
#6
What's the theme used in your image?
Reply
#7
It's the default theme for MyBB 1.8. Though this code will work on previous versions of MyBB as well.
Reply
#8
(1970-01-01, 12:00 AM)Google Wrote:Quote text here

Really need more? Toungue Nice one though.
Reply
#9
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.
Reply
#10
Whatever. That spoil-on-hover looks quite awesome.
[Image: fSGNVQj.png]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)