diff -r d7a1cf9cf657c7f6f20e3fb60e42fe333be22ed7 -r 7751c2703d6fa3738bf0b8e3ccaf741d13c6263f indefero/src/IDF/Middleware/GoogleAds.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/indefero/src/IDF/Middleware/GoogleAds.php Sun Mar 09 21:23:20 2014 -0500 @@ -0,0 +1,80 @@ +status_code, + array(200, 201, 202, 203, 204, 205, 206, 404, 501))) { + return $response; + } + $ok = false; + $cts = array('text/html', 'text/html', 'application/xhtml+xml'); + foreach ($cts as $ct) { + if (false !== strripos($response->headers['Content-Type'], $ct)) { + $ok = true; + break; + } + } + if ($ok == false) { + return $response; + } + $replacead1 = $this->makead(Pluf::f("google_ads")["AD1"]); + $replacead2 = $this->makead(Pluf::f("google_ads")["AD2"]); + $response->content = str_replace('', $replacead1, $response->content); + $response->content = str_replace('', $replacead2, $response->content); + return $response; + } + + private function makead($ad) + { + $ret = '"; + $ret .= ''; + return $ret; + + } +} diff -r d7a1cf9cf657c7f6f20e3fb60e42fe333be22ed7 -r 7751c2703d6fa3738bf0b8e3ccaf741d13c6263f indefero/src/IDF/templates/idf/base.html --- a/indefero/src/IDF/templates/idf/base.html Fri Sep 27 21:53:51 2013 -0500 +++ b/indefero/src/IDF/templates/idf/base.html Sun Mar 09 21:23:20 2014 -0500 @@ -60,7 +60,7 @@ {if $project.enableads}
{if $project.enableads} - + {/if}
{/block}