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.

Multiple ads on IPB page

Discussion in 'Co-op Advertising Network' started by blueuniverse, Dec 2, 2004.

  1. #1
    Ok, the ads have to be included on the page through use of a phpinclude. I've included the file in my board wrapper, and the file named include.php just has this code in it.

    <?php
     	ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
     	include ('ad_network.php');
     	echo $ad_network[0];
     ?>
    Code (markup):
    Anywho, I want to try and run multiple ads on the page, but I've come across a bit of a problem. If I add, $ad_network[1]; etc. after that, the same ad just shows up loads of times. If I duplicate the include line in that for every different number, I still get the same effect.

    I also tried having different include files for each ad, but it didn't particularly like this probably due to the repitition of the include line.

    Anyway, any suggestions so I can get multiple ads?
     
    blueuniverse, Dec 2, 2004 IP
  2. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #2
    Update your ad_network.php file with the latest one from the setup.
     
    digitalpoint, Dec 2, 2004 IP
  3. blueuniverse

    blueuniverse Guest

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I did lol :S unless its been uploaded again in the last hour
     
    blueuniverse, Dec 2, 2004 IP
  4. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #4
    No, was a couple days ago it was updated to always queue up 5 ads. If you have the following line in your ad_network.php file, then you have the right file:

    while (count ($ad_network) < 5) {
    PHP:
     
    digitalpoint, Dec 2, 2004 IP
  5. blueuniverse

    blueuniverse Guest

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Yeah, I've got the right file alright. Any other ideas as to what it might be. At the moment, I've changed it back to just showing one ad, but I can change it so it shows all 5 so you can have a look if you want?
     
    blueuniverse, Dec 2, 2004 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    Instead of echo $ad_network[0];, try this:

    print_r ($ad_network);
    PHP:
    That will output the whole array to see what's up with it.
     
    digitalpoint, Dec 2, 2004 IP
  7. blueuniverse

    blueuniverse Guest

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    hmmm, it says

    that would appear to be right? Ok, update I re-uploaded all the files and cleared the text file, and all appears to be working. One final thing, how would I implement code such as | between the ads from the php file?

    Thanks
     
    blueuniverse, Dec 2, 2004 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,333
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    Easiest way (assuming you wanted all 5 to show) would be:

    echo implode (' | ', $ad_network);
    PHP:
     
    digitalpoint, Dec 2, 2004 IP
  9. blueuniverse

    blueuniverse Guest

    Messages:
    217
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thanks! It workes excellently
     
    blueuniverse, Dec 2, 2004 IP