Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: !RFAN on April 27, 2011, 02:19:57 PM

Title: adf.ly code?
Post by: !RFAN on April 27, 2011, 02:19:57 PM
adf.ly says:


""If you have a website with 100's or 1000's of links you want to change over to adf.ly then please use the script below.

Simply copy-and-paste the code below on to your webpage or blog and the links will be updated automatically - simple!

You can add or remove any domains for the code that you use or your website.""

<script>
var adfly_id = 426019;
var adfly_advert = 'int';
var domains = ['depositfiles.com', 'rapidshare.com', 'vip-file.com', 'smsfiles.ru', '4files.net', 'turbobit.ru', 'uploading.com', 'letitbit.net', 'depositfiles.ru', 'sms4file.com', 'ifolder.ru', 'hotfile.com', 'anyfiles.net', 'sharingmatrix.com', 'megashare.com', 'megaupload.com', 'rapidshare.de', 'rapidshare.ru', 'uploadbox.com', 'filefactory.com', 'filefactory.ru', 'filepost.ru', 'onefile.net', 'freefolder.net', 'getthebit.com', 'turbobit.net',];
</script>
<script src="http://adf.ly/js/link-converter.js"></script>


my question is.. where i can put this code for smf forum?

Thanks
Title: Re: adf.ly code?
Post by: Suki on April 27, 2011, 02:36:59 PM
should be in your theme's index.template.php  inside the <head> </head>  tags, be careful with simple commas for php it must be scape with a  \  like this:


<script>
var adfly_id = 426019;
var adfly_advert = \'int\';
var domains = [\'depositfiles.com\', \'rapidshare.com\', \'vip-file.com\', \'smsfiles.ru\', \'4files.net\', \'turbobit.ru\', \'uploading.com\', \'letitbit.net\', \'depositfiles.ru\', \'sms4file.com\', \'ifolder.ru\', \'hotfile.com\', \'anyfiles.net\', \'sharingmatrix.com\', \'megashare.com\', \'megaupload.com\', \'rapidshare.de\', \'rapidshare.ru\', \'uploadbox.com\', \'filefactory.com\', \'filefactory.ru\', \'filepost.ru\', \'onefile.net\', \'freefolder.net\', \'getthebit.com\', \'turbobit.net\',];
</script>
<script src="http://adf.ly/js/link-converter.js"></script>

Title: Re: adf.ly code?
Post by: texasman1979 on April 27, 2011, 04:29:25 PM
Or change them to " :)
Title: Re: adf.ly code?
Post by: !RFAN on April 28, 2011, 02:51:55 AM
Thank you very much :)

Title: Re: adf.ly code?
Post by: texasman1979 on April 28, 2011, 04:18:16 PM
i would put that into a onload function.

this will cause it to run after the entire page is loaded, but definitely before it is humanly possible to click something else.

and to be honest, i would see about downloading the js file and having available to your own server instead of pinging someone else server with it.

could potentially cause your site to lag.
Title: Re: adf.ly code?
Post by: Jeet Chowdhury on May 22, 2011, 11:35:48 AM
i also want to do this on my forum what i need to do?
Title: Re: adf.ly code?
Post by: Suki on May 22, 2011, 06:15:08 PM
Quote from: Jeet Chowdhury on May 22, 2011, 11:35:48 AM
i also want to do this on my forum what i need to do?


get your code from adf.ly, then do as explained here,  change all the '  to \'  or "  and add that code in your Index.template.php between the   <head>  and </head> tags
Title: Re: adf.ly code?
Post by: gohanjaja on February 16, 2017, 12:12:23 PM
hello this no workss in the day!! Thanks..!!!
Title: Re: adf.ly code?
Post by: Steve on February 17, 2017, 05:24:40 PM
What? And why the response to a 5 year old thread?  ???
Title: Re: adf.ly code?
Post by: gohanjaja on February 19, 2017, 11:38:50 AM
Quote from: Steve on February 17, 2017, 05:24:40 PM
What? And why the response to a 5 year old thread?  ???

I did not see a current one :)
Title: Re: adf.ly code?
Post by: Steve on February 19, 2017, 12:40:13 PM
Then go ahead and start a new one. And explain the problem a little more. :)