Only 4 text ads showing. I've asked for 5

Discussion in 'Co-op Advertising Network' started by yonnermark, Jan 8, 2005.

  1. #1
    On this website:
    http://www.smart-pianos.com/

    See the footer section immediately after where it says "useful sites" those are my network ads. The piano related text ads are not from the network, ignore those.

    1. I've used the script to get 5 ads but only 4 are showing. How can I get 5 showing so that I can get the extra weight?

    2 Furthermore it keeps showing duplicate ads on the same page. At time of writing I see 2 identical links on my page. This happens on most page views.

    3. I'm trying to format the ads but putting a verical "|" in between ads but I can't figure out where to put the "|" without causing a PHP error when parsing.

    Thanks.
     
    yonnermark, Jan 8, 2005 IP
  2. wrkalot

    wrkalot Well-Known Member

    Messages:
    285
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    108
    #2
    I see 5 on every refresh
     
    wrkalot, Jan 8, 2005 IP
  3. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #3
    Mine looks like this:

    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[0];
    ?> | <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[1];
    ?> | <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[2];
    ?> |
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[3];
    ?> <br>
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');
    echo $ad_network[4];
    ?>


    Make sure you have the correct number ie [0] - starting from 0; and upload an empty text file.
     
    flawebworks, Jan 8, 2005 IP
  4. yonnermark

    yonnermark Peon

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Is it necessary to keep opening and closing all your PHP tags? And to have to use the "include" evertime?

    The setup instructions imply you can just use:

    $ad_network[0] | $ad_network[1] | $ad_network[2] | $ad_network[3]

    But that causes php errors

    that's probably it!
    thanks
    mark
     
    yonnermark, Jan 8, 2005 IP
  5. flawebworks

    flawebworks Tech Services

    Messages:
    991
    Likes Received:
    36
    Best Answers:
    1
    Trophy Points:
    78
    #5
    I'm no php guru; so I can't comment there; I just copied the code and duplicated. As well; the code has been updated; so if you haven't checked it; check it.
     
    flawebworks, Jan 8, 2005 IP
  6. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #6
    You only need to include once.
     
    digitalpoint, Jan 8, 2005 IP
  7. yonnermark

    yonnermark Peon

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #7
    So how do we make it parse as:

    text ad 1 | text ad 2 | text ad 3 | etc.

    I mean how can we put those "|" symbols in without getting a php error?
    thanks
    mark
     
    yonnermark, Jan 8, 2005 IP
  8. digitalpoint

    digitalpoint Overlord of no one Staff

    Messages:
    38,334
    Likes Received:
    2,613
    Best Answers:
    462
    Trophy Points:
    710
    Digital Goods:
    29
    #8
    echo implode (' | ', $ad_network);
    PHP:
     
    digitalpoint, Jan 8, 2005 IP
  9. yonnermark

    yonnermark Peon

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #9
    thanks a lot!
     
    yonnermark, Jan 8, 2005 IP
  10. yfs1

    yfs1 User Title Not Found

    Messages:
    13,798
    Likes Received:
    922
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Just for variety, this works too:

    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    	include ('ad_network.php');
    	echo '<center>'.$ad_network[0].'&nbsp;&nbsp;&nbsp;&nbsp'.$ad_network[1].'&nbsp;&nbsp;&nbsp;&nbsp'.$ad_network[2].'&nbsp;&nbsp;&nbsp;&nbsp'.$ad_network[3].'&nbsp;&nbsp;&nbsp;&nbsp'.$ad_network[4].'</center>';
    Code (markup):
     
    yfs1, Jan 8, 2005 IP
  11. yonnermark

    yonnermark Peon

    Messages:
    137
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #11
    This works great. It actually parses all 5 ads just like that without adding numbers or pasting multiple copies of this script. Is that how it should work? How does that work? I'm intrigued!!

    Thanks
    mark
     
    yonnermark, Jan 8, 2005 IP