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.

Helpfull code for HTML people

Discussion in 'Co-op Advertising Network' started by kyle422, Feb 11, 2005.

  1. #1
    I have been trying for a while to get my referral URL for the Ad-network next to my Co-Op ads. Well after messing with the code for a while and a little help from a couple of friendly people on the forum I got it to work. Check it out HERE . It validates in the Co-op and http://validator.w3.org
    You will need to alter the blue code to fit your site/css and make sure to put your referral number in there, unless you want me to get it :rolleyes:
    Here is the code.
    <?php
    
    if (!function_exists('file_get_contents')) {
    function file_get_contents($url) {
    $handle = fopen($url, 'r');
    $string = fread($handle, 4096000);
    fclose($handle);
    return $string;
    }
    }
    
    include ('ad_network.php');
    echo preg_replace ("/<\/body>/i", [COLOR=Red]'<[COLOR=Blue]DIV align="center" class="style30"[/COLOR]>'.'<a href="http://www.digitalpoint.com/tools/ad-network/?s=[COLOR=Blue]1905[/COLOR]" rel="nofollow">Sponsored Ads</a>'.'>>'[/COLOR] . $ad_network[0]. '    ' . $ad_network[1]. '    ' . $ad_network[2] . '    ' . $ad_network[3] . '    ' . $ad_network[4] . '</div></body>', file_get_contents(str_replace ('../', '', $_REQUEST['file'])));
    ?>
    Code (markup):

     
    kyle422, Feb 11, 2005 IP
    david_sakh likes this.
  2. Spyware Remover

    Spyware Remover Peon

    Messages:
    126
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Excellent job!

    Thank you for sharing this,

    AJ
     
    Spyware Remover, Feb 12, 2005 IP
  3. david_sakh

    david_sakh Peon

    Messages:
    1,225
    Likes Received:
    29
    Best Answers:
    0
    Trophy Points:
    0
    #3
    someone with an under 50 post count writing scripts for the community? :eek:

    good job - I'm sure this will be a relief for many. :)
     
    david_sakh, Feb 12, 2005 IP
  4. kyle422

    kyle422 Peon

    Messages:
    290
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Can't take all the credit, I had some help. :)
     
    kyle422, Feb 12, 2005 IP
  5. Foxy

    Foxy Chief Natural Foodie

    Messages:
    1,614
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Hi

    Thanks - I'm being a bit dumb here but .... How do you implement this code? :confused:
     
    Foxy, Feb 13, 2005 IP
  6. fryman

    fryman Kiss my rep

    Messages:
    9,604
    Likes Received:
    777
    Best Answers:
    0
    Trophy Points:
    370
    #6
    He he... I hear you, Foxy... I have no idea either.

    Kyle, using the original coop code


    What would we need to change?? :confused:
     
    fryman, Feb 13, 2005 IP
  7. roberto

    roberto Peon

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Hi
    which would be the html code for showing 5 ads instead of one?
    regards
    Roberto
     
    roberto, Feb 13, 2005 IP
  8. Jim bob 9 pants

    Jim bob 9 pants Peon

    Messages:
    890
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #8
    roberto I have pm you, hope it helps
     
    Jim bob 9 pants, Feb 13, 2005 IP
  9. kyle422

    kyle422 Peon

    Messages:
    290
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #9
    This would be if your running html site, it would be your passthru.php file.
    Your are running PHP so you wouldn't use that code. PHP would look like this:
    [COLOR=Blue]<p><font size="2%">Co-op affilliate links - <span class="style9"[/COLOR]>
    <?php
    ini_set ("include_path", ini_get ("include_path") . ':../:../../:../../../:../../../../');
    include ('ad_network.php');?>
    <?php echo $ad_network[0];?> - <?php echo $ad_network[1];?> - <?php echo $ad_network[2];?> - <?php echo $ad_network[3];?> - <?php echo $ad_network[4];?>
    [COLOR=Blue]</span></font></p>[/COLOR]
    Code (markup):
     
    kyle422, Feb 13, 2005 IP
  10. kyle422

    kyle422 Peon

    Messages:
    290
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The code in the first thread is for 5 ads HTML. :)
     
    kyle422, Feb 13, 2005 IP