View Single Post
Old 19th September 2010, 22:35
miooodek miooodek is offline
Junior Member
Join Date: Aug 2010
Posts: 23
Thanks: 2
Thanked 0 Times in 0 Posts
Lightbulb Forced Ads on ISPC 3

Hi, I red some examples of forcing ads with ISPC 2, one of them interested me much but I'm having problem with getting it work with ISPC 3. Maybe some of you have working solutions for that. I'm interested in forcing ads at every site on my server except some my projects, and server primary site

I think this topic can be helpful for many users
Thanks for reply,

I worked on this code some so here i have some good stuff for you

Ok first code i will give you is to not auto add it to every account but FORCE it on every account no matter what before they could just edit out the ad's part of the .htaccess file so.

Go to: /root/ispconfig/isp/conf/
Edit File: vhost.conf.master

Go to the bottom
you will see this
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule .* - [F]
Right Below that add
php_value output_buffering 4098
php_value auto_prepend_file '/var/www/ads/header.php'
AddType application/x-httpd-php htm
AddType application/x-httpd-php html
That is the code for your ad replace header.php with your ad file name
Also if you want your ad on the top or the bottom of the page

Top of page: php_value auto_prepend_file '/var/www/ads/header.php'
Bottom of page: php_value auto_append_file '/var/www/ads/header.php'

This code can not be removed from any site so i made a mod for the ad file you will not need blank.php anymore so you can delete it.

So in your ad file right now you have your ad code thats it, Change your file so its like this.
$adfrees = '/var/www/web1/web'; //Change this to the web you want without ad's
$dir = getcwd();
if ($dir == $adfrees) {
echo '';
} else {
echo '
'; }
It works great!
Reply With Quote
Sponsored Links