How do I get five text link ads to appear nicely one after the other with a comma or a "|" between each one? I currently am using: <?php ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); echo $ad_network[0];, echo $ad_network[1];, echo $ad_network[2];, echo $ad_network[3];, echo $ad_network[4];, echo $ad_network[5];, ?> PHP: But this is giving me an error...
Seems to me like you need to alternate each include with the echo. Now you just overrule each include.
Thnx for the speedy response! What I am actually trying to achieve is: LINK1, LINK2, LINK3, LINK4, LINK5 or LINK1 | LINK2 | LINK3 | LINK4 | LINK5 so my question is where would I add the ", " or the " | " to the php? The way its done now gives an error....
What's the error? Your parsing is wrong. echo $something;, The comma violates php coding laws. It should be echo ' Sponsors: '.$ad_network[0].', '.$ad_network[1].' and keep writing here '.$ad_network[2].' end.'; etc. You can't have anything after the ;
Well, not quite right (I don't think)... <?php ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); echo $ad_network[0]; echo $ad_network[1]; echo $ad_network[2]; echo $ad_network[3]; echo $ad_network[4]; ?> Code (markup): There was an extra echo in there... But I couldn't find out where to place the | formatting either, so in the ad_network.php file, I just added a space to this line $ad_network[] = $ad . '<!-- an-hl --> '; Code (markup): The space is next to the --> I couldn't think of another way to do it...
<?php ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); include ('ad_network.php'); echo ''.$ad_network[0].', '.$ad_network[1].', '.$ad_network[0].', '.$ad_network[2].''; ?> PHP: But I don't participate in this network. Your PHP is fundamentally wrong, that's exactly why you get the unexpected parsing error. I do believe, from a logical point of view that the including 5 times the same file like that doesn't make sense. but at least this will fix the error. Check by confirmaing that line 74 is the first echo statement.
Ok so it appears to be solved now Added this: $ad_network[] = $ad . '<!-- an-hl --> | '; PHP: to the actual ad_network.php file as SEbasic suggest gives the LINK1 | LINK2 formatting I wanted! Thank you! And to T0PS3O I did have it like that before but thought it was giving me the error because I also added the " | " there too... Now its all good by putting the formatting in the ad_network file instead! Thanks! Cheers folks!
I would recommend not modifing the ad_network.php file. You will have to modify it every time Shawn releases a new one (Not saying he is going to but it could happen). See this post: http://forums.digitalpoint.com/showpost.php?p=37949&postcount=38, it should help you out. You can replace echo $ad_network . ' '; with echo $ad_network . ' | '; or whatever.