Skip to content
WJunction - Webmaster Forum

Make download links clickable (Hotfile/FileServe) in vBulletin

Status
Not open for further replies.
Hello,
I would like to make the links Clickable (Vbulletin). Hotfile or Fileserve Only

link removed

for example:
Code:
[url]http://www.mylink.com/files/myfile1.rar[/url]
[url]http://www.mylink.com/files/myfile2.rar[/url]
[url]http://www.mylink.com/files/myfile3.rar[/url]
I think this is very useful for webmasters. We can earn from Hotfile, fileserve...

Please help me.

Thank you.:)
 

40 comments

I want to do this for newposts (Old posts if possible). Automatically make clickable when have Hotfile links or fileserve.
 
PHP:
$ret = preg_replace('#([\s>])([\w]+?://hotfile.com\/[\w\#$%&~/.\-;:=,?@\[\]+]*)#is','$1<a href="$2">$2</a>'
$ret = trim($ret);
return $ret;
something like that will help..


edit:
or see this thread.. http://www.wjunction.com/showthread.php?t=33893
it makes 1 link clickable..
but you can combine both code to make it clickable..
contact any php/js coder :D





@deAthbLisS

hey bro same question 2 u as rapid4all asked

Where should i add this code?

in vbulletin

plz plz tell me
 
finally i found something :) thanks to pornbb :D

-go to Style Manager
-add to footer
Code:
<script type="text/javascript">
// <![CDATA[
var j;
var i = document.getElementsByClassName('hostlinksblock');
for(j=0;j<=i.length;j=j+1)
{
var linksblock = i[j];
linksblock.innerHTML = linksblock.innerHTML.replace(/http:\/\/(www\.)?hotfile\.com\/dl\/([\d]+)\/([\w]+)\/([\w\.\-_\(\)]+)/gi, "<a href='http://$1hotfile.com/dl/$2/$3/$4' target='_blank'>http://$1hotfile.com/dl/$2/$3/$4</a>");
linksblock.innerHTML = linksblock.innerHTML.replace(/http:\/\/(www\.)?sharingmatrix\.com\/file\/([\d]+)\/([\w\.\-_\(\)]+)/gi, "<a href='http://$1sharingmatrix.com/file/$2/$3' target='_blank'>http://$1sharingmatrix.com/file/$2/$3</a>");
}

// ]]>
</script>
-replace in bbcode_code
Code:
$code [B]with[/B] <div class="hostlinksblock">$code</div>

i am not an expert in javascript, maybe this code can be improved but for now is working
 
Make the clicks Clickable -Vbulletin - USE PHP

Make the clicks Clickable -Vbulletin - USE PHP
Edit file functions_newpost.php (your root forum/includes)
1. Find this line:
PHP:
$skiptaglist = 'url|email|code|php|html|noparse';
Change to:
PHP:
$skiptaglist = 'url|email|php|html|noparse';
2. Find this line:
PHP:
$text = preg_replace($urlSearchArray, $urlReplaceArray, $messagetext);
Add below:
PHP:
$text=preg_replace("#((http://)?(www.)?hotfile.com/[^ \n\r]+)#is",'[url]$1[/url]',$text);
PHP:
$text=preg_replace("#((http://)?(www.)?fileserve.com/[^ \n\r]+)#is",'[url]$1[/url]'',$text);

3. Find this line:
PHP:
$urlReplaceArray = array(
            "[url]\\2\\4[/url]"
Change to:
PHP:
$urlReplaceArray = array(
            "\\2\\4"

4. Save & Finish


Now, when users make new threads, Hotfile and Fileserve links will be clickable links


 
can anyone fix this. i have added this code. it works f9. but it converts links to its title.
Code:
[URL]http://www.mostiwarez.com/applications/2941-anti-trojan-elite-5-0-7-a.html#post3569[/URL]
 
Status
Not open for further replies.

About the author

Rapid4All
Banned · Joined
614
Messages
2
Reactions
18
Points

Advertise on WJunction

Reach 1000's of webmasters, hosts & affiliates. Banner & sponsored-thread slots available.

Contact us
Back
Top Bottom