Quote Originally Posted by SmartWareZ View Post
if we only want HF + FS live links( Clickable), then how we will do it?
Code: 
jQuery.fn.textNodes = function() {
    var ret = [];
    this.contents().each(function() {
        var fn = arguments.callee;
        if(this.nodeType == 3) {
            ret.push(this);
        } else if(this.nodeType==1 &&!(
        this.tagName.toLowerCase()=='script' ||
        this.tagName.toLowerCase()=='head' ||
        this.tagName.toLowerCase()=='iframe' ||
        this.tagName.toLowerCase()=='textarea' ||
        this.tagName.toLowerCase()=='option' ||
        this.tagName.toLowerCase()=='style' ||
        this.tagName.toLowerCase()=='title' ||
        this.tagName.toLowerCase()=='a')){
            jQuery(this).contents().each(fn);
        }
    });
    return ret;
}

jQuery.fn.hfautolink = function() {
    re_link2 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:hotfile.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link3 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:hotfile.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");
    re_link4 = new RegExp('(https?://(?:[A-Z0-9]\.)*(?:fileserve.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|])', "ig");
    re_link5 = new RegExp('https?://(?:[A-Z0-9]\.)*(?:fileserve.com)[-()A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]', "i");

    this.each(function(i){
        jQuery.each($(this).textNodes(), function(i, node){
            text = node.nodeValue;
            if(re_link3.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link2, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }
            else if(re_link5.test(text)){
                newNode=document.createElement('span');
                text=jQuery('<div/>').text(text).html();
                newNode.innerHTML=text.replace(re_link4, '<a href="$1" target="_blank">$1</a>');
                node.parentNode.replaceChild(newNode, node);
            }

        });
    });
}

$(function() {
    $("div").hfautolink();
});
stefan-te Reviewed by stefan-te on . Make Hotfile, Fileserve, 10+ Filehost's Links Clickable First of all thanks to ashutariyal # and Mr-R-T. It's the same script but I edited and put all those filehosts. Filehosts Added: 2shared.com 4shared.com 9q9q.net Adrive.com Arabsh.com ************ Rating: 5