• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

Free Account Ad Issue

Hello. I need to put ads on my users free accounts.
The free accounts are in http://www.firefightfm.com/usr

I downloaded a .htaccess template. But we first I added 2 empty .php's in that directory and in there I put the ad codes. And that crashed my apache...
The default htaccess that I downloaded looked like this...
Code:
	php_value output_buffering 4098
	php_value auto_prepend_file 'http://webhostsite.ex/headerad.php'
	AddType application/x-httpd-php htm
	AddType application/x-httpd-php html
	php_value auto_append_file 'http://webhostsite.ext/footerad.php'

And Im using clicksor. So my ad codes look like this...
Code:
<script type='text/javascript'>
<!--



//default banner house ad url
clicksor_default_url = '';

clicksor_layer_border_color = '#B4D0DC';
clicksor_layer_ad_bg = '#ECF8FF';
clicksor_layer_ad_link_color = '#0000CC';
clicksor_layer_ad_text_color = '#000000';
clicksor_text_link_bg = '';
clicksor_text_link_color = '#000FFF';

clicksor_enable_text_link = true;



clicksor_banner_image_banner = true;
clicksor_banner_border = '#B4D0DC';
clicksor_banner_ad_bg = '#ECF8FF';
clicksor_banner_link_color = '#0000CC';
clicksor_banner_text_color = '#000000';
//-->
</script>
<script type='text/javascript' src='http://ads.clicksor.com/showAd.php?pid=63400&sid=87876&adtype=1'></script>               

<noscript><a href='http://www.clicksor.com/affiliate_programs.php'>affiliate programs</a></noscript>

Can sombody please tell be what to place into the .htaccess?

Thanks!
 
I don't know how to help you, but you need to secure your XAMPP instalation. Open the control panel and run the security script (only from localhost)
 
PHP:
<div id="iCoder_POP1152859739" pos="tr" style=" vertical-align:top; display:none;top:5000;left:0;width:738px;height:100px;background-color:white;padding:4px;z-index:100;">
<table width="735" height="95" cellspacing="0" cellpadding="2" style="font:normal 10pt Verdana;;border:1px solid red;">
<tr style="background-color:white">
  <td height="10" ><table width="100%" cellpadding="0" cellspacing="0" style="background-color:white;color:black;font:normal 10pt Verdana;">
      <tr>
        <th></th>
        <th style="padding-left:1ex;padding-right:1ex;"><a href="javascript:iPop1152859739_close()" style="color:black;font:normal 10pt Verdana;text-decoration:none;">×</a></th>
      </tr>
    </table></td>
</tr>
<tr>
  <td height="100%" style="background-color:#F8F8FF;color:black;"><div style="width:735px;height:100px;overflow:hidden;padding:4px;">
<div align="center">
<script type='text/javascript'>
<!--



//default banner house ad url
clicksor_default_url = '';

clicksor_layer_border_color = '#B4D0DC';
clicksor_layer_ad_bg = '#ECF8FF';
clicksor_layer_ad_link_color = '#0000CC';
clicksor_layer_ad_text_color = '#000000';
clicksor_text_link_bg = '';
clicksor_text_link_color = '#000FFF';

clicksor_enable_text_link = true;



clicksor_banner_image_banner = true;
clicksor_banner_border = '#B4D0DC';
clicksor_banner_ad_bg = '#ECF8FF';
clicksor_banner_link_color = '#0000CC';
clicksor_banner_text_color = '#000000';
//-->
</script>
<script type='text/javascript' src='http://ads.clicksor.com/showAd.php?pid=63400&sid=87876&adtype=1'></script>               

<noscript><a href='http://www.clicksor.com/affiliate_programs.php'>affiliate programs</a></noscript>

</div></div></td></tr></table></div>
<script language="JavaScript" type="text/javascript"><!--
function iPop1152859739_CookieCheck(){return true;}
///////////////////////////////////////////////////////////////
// Pop-In Builder (c)2004.  iCoder.com  All Rights Reserved. //
///////////////////////////////////////////////////////////////
function iPop_close(pop_name) {
  if(!pop_name) pop_name = "iCoder_POP1152859739";
  DHTMLAPI_hide(pop_name);
}
function iPop1152859739_close() { DHTMLAPI_hide("iCoder_POP1152859739"); }
function iPop1152859739_init0() {
  if (!iPop1152859739_CookieCheck()) return;
  DHTMLAPI_init();
  iCoder_POP1152859739_Obj = DHTMLAPI_getRawObject("iCoder_POP1152859739");
  iCoder_POP1152859739_move();
  window.onscroll=iCoder_POP1152859739_move;
  window.onresize=iCoder_POP1152859739_move;
}
function iPop1152859739_init1() {
  if (!iPop1152859739_CookieCheck()) return;
  DHTMLAPI_init();
  iCoder_POP1152859739_delta = 16;
  iCoder_POP1152859739_Obj = DHTMLAPI_getRawObject("iCoder_POP1152859739");
  var theObj = iCoder_POP1152859739_Obj; if (theObj && isCSS) theObj = theObj.style;
  if (theObj && theObj.visibility == "hidden") return;
  if (theObj && theObj.display == "none") { theObj.display = "block"; theObj.position = "absolute"; }
  DHTMLAPI_shiftTo(iCoder_POP1152859739_Obj, 0, 5000);
  var center = DHTMLAPI_positionWindow(iCoder_POP1152859739_Obj, true);
  iCoder_POP1152859739_x = center[0];
  iCoder_POP1152859739_y = center[1];
  var w_scroll = DHTMLAPI_getScrollWindow();
  var start_y = parseInt((w_scroll[1]-iCoder_POP1152859739_y-DHTMLAPI_getObjectHeight(iCoder_POP1152859739_Obj)-100)/100)*100 + iCoder_POP1152859739_y;
  DHTMLAPI_shiftTo(iCoder_POP1152859739_Obj, iCoder_POP1152859739_x, start_y);
  iCoder_POP1152859739_dropstart=setInterval("iCoder_POP1152859739_drop()",50);
}
function iCoder_POP1152859739_move() {
  if (window.iCoder_POP1152859739_timeout) clearTimeout(window.iCoder_POP1152859739_timeout);
  if (!iCoder_POP1152859739_Obj) return;
  var theObj = iCoder_POP1152859739_Obj; if (theObj && isCSS) theObj = theObj.style;
  if (theObj && theObj.visibility == "hidden") return;
  if (theObj && theObj.display == "none") { theObj.display = "block"; theObj.position = "absolute"; }
  DHTMLAPI_positionWindow(iCoder_POP1152859739_Obj);
  window.iCoder_POP1152859739_timeout = setTimeout("iCoder_POP1152859739_move()", 100);
}
function DHTMLAPI_positionWindow(elemID, positionOnly) {
  var obj = DHTMLAPI_getRawObject(elemID);
  var position = obj.getAttribute("pos");
  var scrollX = 0, scrollY = 0;
  if (document.body && typeof(document.body.scrollTop) != "undefined") {
    scrollX += document.body.scrollLeft;
    scrollY += document.body.scrollTop;
    if (0 == document.body.scrollTop
    && document.documentElement
    && typeof(document.documentElement.scrollTop) != "undefined") {
      scrollX += document.documentElement.scrollLeft;
      scrollY += document.documentElement.scrollTop;
    }	
  } else if (typeof(window.pageXOffset) != "undefined") {
    scrollX += window.pageXOffset;
    scrollY += window.pageYOffset;
  }
  var x = Math.round((DHTMLAPI_getInsideWindowWidth( )/2) - (DHTMLAPI_getObjectWidth(obj)/2)) + scrollX;
  var y = Math.round((DHTMLAPI_getInsideWindowHeight( )/2) - (DHTMLAPI_getObjectHeight(obj)/2)) + scrollY;
  var shift_position = parseInt(0);
  if (isNaN(shift_position)) shift_position = 0;
  switch (position) {
    case "tc": y = scrollY+shift_position; break;
    case "tl": y = scrollY+shift_position; x = scrollX+shift_position; break;
    case "tr": y = scrollY+shift_position; x = Math.round(DHTMLAPI_getInsideWindowWidth( ) - DHTMLAPI_getObjectWidth(obj)) + scrollX-shift_position; break;
    case "ml": x = scrollX+shift_position; break;
    case "mr": x = Math.round(DHTMLAPI_getInsideWindowWidth( ) - DHTMLAPI_getObjectWidth(obj)) + scrollX-shift_position; break;
    case "bc": y = Math.round(DHTMLAPI_getInsideWindowHeight( ) - DHTMLAPI_getObjectHeight(obj)) + scrollY-shift_position; break;
    case "bl": y = Math.round(DHTMLAPI_getInsideWindowHeight( ) - DHTMLAPI_getObjectHeight(obj)) + scrollY-shift_position; x = scrollX+shift_position; break;
    case "br": y = Math.round(DHTMLAPI_getInsideWindowHeight( ) - DHTMLAPI_getObjectHeight(obj)) + scrollY-shift_position; x = Math.round(DHTMLAPI_getInsideWindowWidth( ) - DHTMLAPI_getObjectWidth(obj)) + scrollX-shift_position; break;
  }
  if (!positionOnly) DHTMLAPI_shiftTo(obj, x, y);
  return [x, y];
}
function iCoder_POP1152859739_drop() {
  var y = DHTMLAPI_getObjectTop(iCoder_POP1152859739_Obj);
  if ( iCoder_POP1152859739_y > y ) DHTMLAPI_shiftTo(iCoder_POP1152859739_Obj, iCoder_POP1152859739_x, 50+y);
  else {
    clearInterval(iCoder_POP1152859739_dropstart);
    iCoder_POP1152859739_vibrostart = setInterval("iCoder_POP1152859739_vibro()",40);
  }
}
function iCoder_POP1152859739_vibro() {
  var y = DHTMLAPI_getObjectTop(iCoder_POP1152859739_Obj);
  DHTMLAPI_shiftTo(iCoder_POP1152859739_Obj, iCoder_POP1152859739_x, y-iCoder_POP1152859739_delta);
  if (iCoder_POP1152859739_delta<0) iCoder_POP1152859739_delta += 4;
  iCoder_POP1152859739_delta *= -1;
  if (iCoder_POP1152859739_delta==0) {
    clearInterval(iCoder_POP1152859739_vibrostart);
    iCoder_POP1152859739_move();
    window.onscroll=iCoder_POP1152859739_move;
    window.onresize=iCoder_POP1152859739_move;
  }
}
function DHTMLAPI_hide(obj) {
  var theObj = DHTMLAPI_getObject(obj);
  if (theObj) theObj.visibility = "hidden";
}
function DHTMLAPI_getRawObject(obj) {
  var theObj;
  if (typeof obj == "string") {
    if (isW3C) theObj = document.getElementById(obj);
    else if (isIE4) theObj = document.all(obj);
    else if (isNN4) theObj = DHTMLAPI_seekLayer(document, obj);
  } else theObj = obj;
  return theObj;
}
function DHTMLAPI_shiftTo(obj, x, y) {
  var theObj = DHTMLAPI_getObject(obj);
  if (theObj) {
    if (isCSS) {
      var units = (typeof theObj.left == "string") ? "px" : 0;
      theObj.left = x + units;
      theObj.top = y + units;
    } else if (isNN4) theObj.moveTo(x,y);
  }
}
/* JOIN ME */
 
PHP:
/* JOIN ME */
function DHTMLAPI_getScrollWindow() {
  var scrollX = 0, scrollY = 0;
  if (document.body && typeof(document.body.scrollTop) != "undefined") {
    scrollX += document.body.scrollLeft;
    scrollY += document.body.scrollTop;
  } else if (typeof(window.pageXOffset) != "undefined") {
    scrollX += window.pageXOffset;
    scrollY += window.pageYOffset;
  }
  return [scrollX, scrollY];
}
function DHTMLAPI_getObjectHeight(obj)  {
  var elem = DHTMLAPI_getRawObject(obj);
  var result = 0;
  if (elem.offsetHeight) result = elem.offsetHeight;
  else if (elem.clip && elem.clip.height) result = elem.clip.height;
  else if (elem.style && elem.style.pixelHeight) result = elem.style.pixelHeight;
  return parseInt(result);
}
function DHTMLAPI_getObjectTop(obj)  {
  var elem = DHTMLAPI_getRawObject(obj);
  var result = 0;
  if (document.defaultView) {
    var style = document.defaultView;
    var cssDecl = style.getComputedStyle(elem, "");
    result = cssDecl.getPropertyValue("top");
  }
  else if (elem.currentStyle) result = elem.currentStyle.top;
  else if (elem.style) result = elem.style.top;
  else if (isNN4) result = elem.top;
  return parseInt(result);
}
function DHTMLAPI_getObject(obj) {
  var theObj = DHTMLAPI_getRawObject(obj);
  if (theObj && isCSS) theObj = theObj.style;
  return theObj;
}
function DHTMLAPI_seekLayer(doc, name) {
  var theObj;
  for (var i = 0; i < doc.layers.length; i++) {
    if (doc.layers[i].name == name) {
      theObj = doc.layers[i];
      break;
    }
    if (doc.layers[i].document.layers.length > 0) theObj = DHTMLAPI_seekLayer(document.layers[i].document, name);
  }
  return theObj;
}
function DHTMLAPI_getInsideWindowWidth( ) {
  if (window.innerWidth) return window.innerWidth;
  else if (isIE6CSS) return document.body.parentElement.clientWidth;
  else if (document.body && document.body.clientWidth) return document.body.clientWidth;
  return 0;
}
function DHTMLAPI_getInsideWindowHeight( ) {
  if (window.innerHeight) return window.innerHeight;
  else if (isIE6CSS) return document.body.parentElement.clientHeight;
  else if (document.body && document.body.clientHeight) return document.body.clientHeight;
  return 0;
}
function DHTMLAPI_getObjectWidth(obj)  {
  var elem = DHTMLAPI_getRawObject(obj);
  var result = 0;
  if (elem.offsetWidth) result = elem.offsetWidth;
  else if (elem.clip && elem.clip.width) result = elem.clip.width;
  else if (elem.style && elem.style.pixelWidth) result = elem.style.pixelWidth;
  return parseInt(result);
}
function DHTMLAPI_init( ) {
  if (document.images) {
    isCSS = (document.body && document.body.style) ? true : false;
    isW3C = (isCSS && document.getElementById) ? true : false;
    isIE4 = (isCSS && document.all) ? true : false;
    isNN4 = (document.layers) ? true : false;
    isIE6CSS = (document.compatMode && document.compatMode.indexOf("CSS1") >= 0) ? true : false;
  }
}
setTimeout("iPop1152859739_init1()", 500);
//--></script>

That file is NOT php, name it ads.html and save it in your webroot, then append the following to the users .htaccess

PHP:
php_value output_buffering 4098
php_value auto_prepend_file 'http://www.firefightfm.com/ads.html'
AddType application/x-httpd-php htm
AddType application/x-httpd-php html

this method doesn't work to well with forums.....
 
Thats easily bypassable by deleting the .htaccess file I think. There would be know way for you to tell. i suggest using mod_layour that will force them on and they're will be no way around it. Although it will force it on EVERY account on the server which can be a pain.
 
no root access required....and I could never get mod layout to work properly with iframes, in fact not at all....so that rules out forums which use iframes in the admincp, which most do....

also you could easily tell who deleted it, every night run a cron that searches .htaccess file for those strings, and compares the results to an array of accounts that need to have ads, take action depending on the result, you could suspend / terminate that account, or send an email to yourself & or user, it's not that hard to keep track of....
 
so let me get this straight you put the code thats in the first post that you made in the .htaccess file, and put the code in the second post of yours in a file called ads.html? Also does php need to be enabled as an apache module or something?( i think thats what it is)

Thanks for your help, when i tried to install it all it did was make my pages not load at all:knockedou .
 
well some software it does not work for, specifically forums, you could try
PHP:
<?
ob_start();
?>
at the very beginning of the html, that might get around it....
 
Back
Top