Need help with interface to Coop

Discussion in 'Co-op Advertising Network' started by cafemonkey, Dec 13, 2004.

  1. #1
    Hello all,

    I'm making an interface for Mambo users to add a DP Coop Module in their CMS. I'm hoping to make DP easy for dummies. :)

    I have the Module installing, and I options available for horizontal/vertical alignment, etc.

    I'm trying to make the option available to change ad type from inside Mambo. I've gotten this working:

    	// Determine which kind of ad we are using:
    
    $ad_type = $params->get( 'ad_type', 'link' );
    
    switch ( $ad_type ) {
         case 'banner':
    								// Banners and Text
    	$new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?s=' . $_SERVER['SERVER_NAME']);
    	break;
    
                case 'text':
    								// Text Ads
    	$new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?s=' . $_SERVER['SERVER_NAME'] . '&type=text');
    	break;
    
    	case 'link':
    								// Link Only Ads
    	$new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?s=' . $_SERVER['SERVER_NAME'] . '&type=link');
    
    	default:
    								// Link Only Ads
    	$new_ad = file_get_contents ('http://ads.digitalpoint.com/network.php?s=' . $_SERVER['SERVER_NAME'] . '&type=link');
    	break;
    	}
    
    Code (markup):
    So if they select "link", they get link only ads, etc.

    The problem that I am having, is that this only changes the way it is downloaded from the server. It doesn't change the way it is viewed. This could be bad if someone tries using banner ads, and it screws up the template... Then they go back to links, but the banner pops up every once in a while.

    So I guess my question is... What's the best way to "clear" the downloaded ads?

    (ps: I'm not much of a coder, so be gentle!) :D
     
    cafemonkey, Dec 13, 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
    Delete the contents of the ad_network_ads.txt is the simple way to do it.
     
    digitalpoint, Dec 13, 2004 IP
  3. cafemonkey

    cafemonkey Peon

    Messages:
    44
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    OK, that leads me to my next question...

    Can I move the ad_network_ads.txt file out of the root?

    I'd like to put it into the "modules" directory with the other files, but my attempts at this have failed. How can I do this?

    Thanks!

    -Andy
     
    cafemonkey, Dec 13, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    Yes, it can be anywhere since nothing accesses it via HTTP. You would probably need to reference it with it's full file path then.
     
    digitalpoint, Dec 13, 2004 IP
  5. cafemonkey

    cafemonkey Peon

    Messages:
    44
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Great thanks!

    I'll be back for more brain-picking later, but this will get us going!
     
    cafemonkey, Dec 13, 2004 IP