DLE Clickable Links

Status
Not open for further replies.

crys18

Banned
Banned
7
2010
0
0
2zcozfwqbsfphkn6gjm9.png

Clickable Links​

This script is made to transform links inside qoute and code that usually are showing as text to become clickable!

Copy link.js to your www folder(the main folder of your site ex: "public_html")

>Add to main.tpl this code in headers after
Code:
<head>
Code to add:
Code:
<script src=" http://code.jquery.com/jquery-latest.js" type="text/javascript"></script>
>Add to main.tpl this code in body after
Code:
<body>
Code to add:
Code:
<script type="text/javascript" src="http://your-site.com/link.js"></script>
Replace "your-site" with your site domain. Ex: For google.com use google
U can add yourself more filehosts or check back here to see if i updated this posts with more hosts.


This is the content of your "link.js" ( so save this code as link.js )

Code:
$(function() {
    var sickw = /^http:\/\/(hotfile|rapidshare|wupload|megaupload|uploading|ul|letitbit|bitshare|turbobit|depositfiles|uploadstation|filesonic|fileserve|duckload|www.hotfile|www.rapidshare|www.wupload|www.megaupload|www.uploading|www.ul|www.letitbit|www.bitshare|www.turbobit|www.depositfiles|www.depositfiles|www.uploadstation|www.filesonic|www.fileserve|www.duckload)\.[\S]+$/;
    $('body *').contents().filter(function() {
        return this.nodeType == 3 &&
            $(this).text().trim() !== '' &&
            $(this).text().trim().match(sickw);
    }).each(function() {
        $(this).replaceWith('<a href="' + $(this).text().trim() + '"target="_blank" rel="sickw.com">' + $(this).text().trim() + '</a>');
    });
});
This version is tested and working on Opera 11, Firefox 4, Chrome 13

The script its not made by me, credits goes to the original coder that i don't know who it is, i only updated it with more filehosts also i improove it!
 
8 comments
Status
Not open for further replies.
Back
Top