MyBB Community Forums

Full Version: [MyCode] Pastebin Embedded
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
About
A short MyCode for pastebin advents

Regular Expression
\[pastebin\]http:\/\/([a-zA-Z]?)+(\.)?pastebin\.com\/(.+?)\[\/pastebin\]
*Update : Gives compatibility to pastebin's subdomain service

Replacement
<script src=\"http://pastebin.com/embed_js.php?i=$3\"></script>
Note : Also available in HTTPS

Cheers!,
-n1tr0b
Nice! Toungue
Thanks, just discovering things
How about this one:

Regular Expression
<a href="http[s]?://pastebin.com/([A-Za-z0-9]+)".*?>.*?</a>

Replacement
<div class="codeblock">
<div class="title">Pastebin:</div>
<div class="body">
<code><object data="http://pastebin.com/raw.php?i=$1" type="text/html">
<a href="http://pastebin.com/$1" target="_blank">http://pastebin.com/$1</a>
</object>
</code></div>
</div>

Example
http://pastebin.com/feqS5PdV
(No need for adding MyCode tags, just paste the URL in post content)

Smile
Good idea, but I don't do automatic URL parsing in my custom script. Lol
Updated mycode
Cool, this MyCode is very helpful! Big Grin

By the way in my forum I have an issue:
[Image: immagineeht.png]

Why the width is so low? It is not like the screenshot querschlaeger has posted.
A URL to a thread with one of those tags might help.
-link-
I'm using Chrome.
Use this in the replacement instead:

<div class="codeblock">
<div class="title">Pastebin:</div>
<div class="body">
<code><object width="100%" data="http://pastebin.com/raw.php?i=$1" type="text/html">
<a href="http://pastebin.com/$1" target="_blank">http://pastebin.com/$1</a>
</object>
</code></div>
</div>
Pages: 1 2 3