We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
Short URL BBCode
Topic Started: Jan 24 2012, 02:05 PM (7,981 Views)
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
Code Name: miZim Short URL BBCode

What the code does: Offers a BBCode button to automatically create short URLS from the miz.im domain

How to use the code: When making a topic, editing a post, making a reply, sending a PM, modifying a signature - a miZim Short URL button is available. Just click the button, enter the long URL you want to shorten, and the short URL will automatically be inserted for you.

How to install the code: Copy/Paste Below The Board

Extra notes: Check it out and I'd appreciate feedback!

Code:
 
<script type="text/javascript">
//<![CDATA[
////////////////////////////////////
// Add miZim Short URL Service button to post bbcodes
// copyright http://miZ.im
////////////////////////////////////
if((window.location.href.match(/\/(?:topic|post|msg|site|profile|single|search|blog(?:\/3)?)\//) || window.location.href.match(/\?c=32/)) && !window.location.href.match('&poll=') ){
function mizimHelp(){
$('input[name=helpbox]').val('Insert Short URL');
}
$("#c_bbcode button[name='URL']").after(" <button type='button' id='miZim' onmouseover='mizimHelp()' onclick='mizim()'>miZim URL</button> ")
function mizim() {
var url = prompt("URL to Shorten?");
if (url != null){
$.getScript("http://www.miz.im/zeta.php?url="+url+"",
function(){
ZetaInsert("[url]"+cream+"[/url]");
}
);
};
}
}
//]]>
</script>


EDIT: here is an example site using the above code http://miz.im/mizim or http://w11.zetaboards.com/miZim_Short_URL/index/
Edited by Skyon Archer, Jan 24 2012, 04:42 PM.
Offline Profile Quote Post Goto Top
 
Syndication
Member
[ *  * ]
Just out of curiosity, is there a way to customize it? Like use your own domain?
Offline Profile Quote Post Goto Top
 
Mr.Tom
Member
[ *  *  * ]
Hmmm, nice idea! Just would you be able to make it so that it's available to use in the shout box?
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
I'll look at this again. As I remember, the last time I tried I was unable to get it to post the shortened URL to the shoutbox itself.
Offline Profile Quote Post Goto Top
 
Skyon Archer
Member Avatar
Member
[ *  *  *  * ]
UPDATE (sorry it's two years later :D ):

To add the miZim Short URL function to your shoutbox, add this code:

Code:
 
<script type="text/javascript">
//<![CDATA[
////////////////////////////////////
// Add miZim Short URL Service button to shoutbox
// copyright http://miZ.im
////////////////////////////////////
$("form#shoutpost button").after(" <button type='button' id='miZim' onclick='mizim2()'>miZim URL</button> ");
function mizim2() {
var url2 = prompt("URL to Shorten?");
if (url2 != null){
$.getScript("http://www.miz.im/zeta.php?url="+url+"",
function(){
shoutPost("[url]"+cream+"[/url]");
}
);
};
}
//]]>
</script>


EDIT: forgot to mention that I added this to the example site at http://miz.im/mizim or http://w11.zetaboards.com/miZim_Short_URL/index/
Edited by Skyon Archer, Jul 7 2016, 05:46 AM.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Codes & Modifications · Next Topic »
Add Reply