Redleg
Aug 2nd 2004, 11:41 pm
I've tried to experiment a bit with different background colors for the text banners, and switched over to text links now. (just to try that one as well).
But now it just displays text banner ads, in many different colors..
(all of the colors I've experimented with..)
But no text links..
This is how my ad_network.php file looks like:
<?php
$ad_file = 'ad_network_ads.txt';
for ($i = 0; $i <= 11; $i++) {
$p = substr ('../../../../../../../../../../', 0, $i * 3);
if (file_exists ($p . $ad_file)) {
$ad_file = $p . $ad_file;
break;
}
}
if (is_writable ($ad_file)) {
$ads = file_get_contents ($ad_file);
$ads = explode ('<ad_break>', $ads);
if (count ($ads) < 101 || $ads[0] + 3600 < time()) {
$ads[] = file_get_contents ('http://ads.digitalpoint.com/network.php?type=link');
$ads[0] = time();
if (count ($ads) > 101) unset ($ads[1]);
$file = fopen($ad_file, 'w');
fwrite ($file, implode ('<ad_break>', $ads));
fclose ($file);
$ad_network = end ($ads);
} else {
$ad_network = $ads[rand(1,count($ads))];
}
$ad_network .= '<!-- an-hl -->';
} else {
$ad_network = 'You must set the "ad_network_ads.txt" file to be writable.';
}
if (substr ($_SERVER['DOCUMENT_NAME'], -6) == '.shtml') {
ini_set ('zlib.output_compression', 0);
echo $ad_network;
}
?>
This one should display text links only, right?
Is there a cache somewhere I have to delete??
But now it just displays text banner ads, in many different colors..
(all of the colors I've experimented with..)
But no text links..
This is how my ad_network.php file looks like:
<?php
$ad_file = 'ad_network_ads.txt';
for ($i = 0; $i <= 11; $i++) {
$p = substr ('../../../../../../../../../../', 0, $i * 3);
if (file_exists ($p . $ad_file)) {
$ad_file = $p . $ad_file;
break;
}
}
if (is_writable ($ad_file)) {
$ads = file_get_contents ($ad_file);
$ads = explode ('<ad_break>', $ads);
if (count ($ads) < 101 || $ads[0] + 3600 < time()) {
$ads[] = file_get_contents ('http://ads.digitalpoint.com/network.php?type=link');
$ads[0] = time();
if (count ($ads) > 101) unset ($ads[1]);
$file = fopen($ad_file, 'w');
fwrite ($file, implode ('<ad_break>', $ads));
fclose ($file);
$ad_network = end ($ads);
} else {
$ad_network = $ads[rand(1,count($ads))];
}
$ad_network .= '<!-- an-hl -->';
} else {
$ad_network = 'You must set the "ad_network_ads.txt" file to be writable.';
}
if (substr ($_SERVER['DOCUMENT_NAME'], -6) == '.shtml') {
ini_set ('zlib.output_compression', 0);
echo $ad_network;
}
?>
This one should display text links only, right?
Is there a cache somewhere I have to delete??