no ads and no validation

Discussion in 'Co-op Advertising Network' started by kaptain, Sep 3, 2004.

  1. #1
    i have two accounts working great!

    i just added my third site to the network and for some reason it won't show ads and it wont validate.

    *this is the first site i have in the network that utilizes "SSI"

    but my pages are htm and html

    my .htaccess file looks like:
    AddType text/html .shtml
    AddHandler server-parsed .html .htm
    Options Indexes FollowSymLinks Includes
    Code (markup):
    this allows my .htm and .html pages to be parsed like .shtml

    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:
    and the properties are set at rw-rw-r--


    i am using the
    <!--#include virtual="/ad_network.php" -->
    Code (markup):
    in my .htm pages

    i do have ads writing to my ad_network_ads.txt file but nothing shows on site pages

    i have four ads set up in this account so far...all pending review and enabled


    Any help would be appreciated!:)
     
    kaptain, Sep 3, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Change this line:

    if (substr ($_SERVER['DOCUMENT_NAME'], -6) == '.shtml') {
    PHP:
    in your ad_network.php file to:

    if (substr ($_SERVER['DOCUMENT_NAME'], -6) == '.shtml' || strpos ($_SERVER['DOCUMENT_NAME'], '.htm')) {
    PHP:
     
    digitalpoint, Sep 3, 2004 IP
  3. kaptain

    kaptain Peon

    Messages:
    194
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You Are The MAN :D

    i hope when i grow up i can be just like Shawn ;)

    worked great thanks :)

    PS: this SSI stuff is great!
     
    kaptain, Sep 3, 2004 IP