1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

More "problems"... :)

Discussion in 'Co-op Advertising Network' started by Redleg, Aug 2, 2004.

  1. #1
    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;
    	}
    
    ?>
    PHP:
    This one should display text links only, right?

    Is there a cache somewhere I have to delete??
    SEMrush
     
    Redleg, Aug 2, 2004 IP
    SEMrush
  2. Redleg

    Redleg Raider

    Messages:
    360
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Never mind, found the problem now..

    You have to empty the ad_network_ads.txt file every time you change the colors or ad type...
    Works fine now.

    Maybe you should include that in the setup instructions??
     
    Redleg, Aug 3, 2004 IP