2013-08-14, 04:33 PM
I'm looking for a plugin that converts all links on a mybb forums into coinurl urls
I don't want it to convert the actual sites urls just the external links that the members post
this is the code that they use
you can find more information on www.coinurl.com
I don't want it to convert the actual sites urls just the external links that the members post
this is the code that they use
<script type="text/javascript" src="http://coinurl.com/script/jquery-latest.min.js"></script>
<script type="text/javascript">
$(function() {
var include = Array();
//Leave empty to convert all links on the page or specify keywords
//which URL must contain to be processed
var exclude = Array();
//Specify keywords which URL must not contain to be processed
var id = "19da25a5b332b067aa1c4360b75e5c8c";
var redirect = "http://coinurl.com/redirect.php?id=" + id + "&url=";
var links = $("a[href^='http']");
for(var i = 0; i < links.length; i++) {
var url = $(links[i]).attr("href");
var deny = false;
for(var j = 0; j < exclude.length; j++) {
if(url.indexOf(exclude[j]) != -1) {
deny = true;
break;
}
}
if(deny) {
continue;
}
if(include.length > 0) {
var allow = false;
for(var j = 0; j < include.length; j++) {
if(url.indexOf(include[j]) != -1) {
allow = true;
break;
}
}
if(!allow) {
continue;
}
}
$(links[i]).attr("href", redirect + encodeURIComponent(url));
}
});
</script>
you can find more information on www.coinurl.com