Can anyone help me set up this coop in exchange for weight?

Discussion in 'Co-op Advertising Network' started by jyoti2005, Jun 23, 2005.

  1. #1
    Hi

    I am not sure if this is the right place to be asking, lol! I remember someone mentioning that this can be done, but unfortunately I forgot to bookmark the page to the people who set up this network on sites in exchange for weight.

    Thanks
     
    jyoti2005, Jun 23, 2005 IP
  2. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Maybe you can just post what problems you are having and we can all help?
     
    chachi, Jun 23, 2005 IP
  3. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    It's an htm based site, and I think I have an apache server

    I'm pretty green for this coop thingy, I think I need someone to set it up for me - LOL!
     
    jyoti2005, Jun 23, 2005 IP
  4. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Do you know how to use Server Side Includes (SSI)? It is really easy to do. The setup instructions in the coop are pretty good, we can walk you through the rest.
     
    chachi, Jun 23, 2005 IP
  5. Homer

    Homer Spirit Walker

    Messages:
    2,396
    Likes Received:
    150
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Agreed...very easy if you know ssi. Just remember to name your include file .php, then call it into your .htm file.
     
    Homer, Jun 23, 2005 IP
  6. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I don't know what SSI is, lol

    I did put 3 files into my /var/www/html folder:
    ad network 265.txt
    .htaccess.txt
    ad network ads 265.php.txt

    Maybe I have these in the wrong folder, I don't know?

    If it's as simple as dropping these 3 files into a folder, I can do that, but I got really confused last time I tried to do this............lol!
     
    jyoti2005, Jun 23, 2005 IP
  7. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #7
    the .htaccess file needs to be named .htaccess with no ".txt" after it

    What do you have inside that file?
     
    chachi, Jun 23, 2005 IP
  8. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Good grief, I just looked at what is in "ad_network_265.php, and it has changed vastly since I dropped it into my site - LOL!!

    I have no idea what it means though, here it is what is in it



    <?php
    // Last update: May 2, 2005 8:45 pm

    function file_get_contents_an ($url) {
    if (substr ($url, 0, 7) == 'http://') {
    $url = parse_url ($url);
    $handle = fsockopen ($url['host'], 80);
    fwrite ($handle, "GET $url[path]?$url[query] HTTP/1.0\r\nHost: $url[host]\r\nConnection: Close\r\n\r\n");
    while (!feof($handle)) {
    $string .= fread($handle, 40960);
    }
    $string = explode ("\n", $string);
    $string = array_pop ($string);
    } else {
    $handle = fopen($url, 'r');
    $string = fread($handle, 4096000);

    }
    fclose($handle);
    return $string;
    }

    if (!function_exists('make_seed')) {
    function make_seed() {
    list($usec, $sec) = explode(' ', microtime());
    return (float) $sec + ((float) $usec * 100000);
    }
    mt_srand (make_seed());
    }

    if (!isset($_SERVER)) $_SERVER = $HTTP_SERVER_VARS;

    $ad_file = 'ad_network_ads_265.txt';
    for ($i = 0; $i <= 11; $i++) {
    $p = substr ('../../../../../../../../../../', 0, $i * 3);
    if (file_exists ($p . $ad_file)) {
    $ad_file = $p . $ad_file;
    break;
    }
    }

    if (is_writable ($ad_file)) {
    $ad_network = array();
    $ads = file_get_contents_an ($ad_file);
    $ads = explode ('<ad_break>', $ads);
    $ads_temp = explode ('|', $ads[0]);

    $file = fopen($ad_file, 'r+');
    if (flock ($file, LOCK_EX|LOCK_NB, $would_block) && !$would_block) {
    if ((count ($ads) < $ads_temp[3] + 1 && $ads_temp[0] + $ads_temp[5] < time()) || $ads_temp[0] + $ads_temp[4] < time()) {
    $new_ad = file_get_contents_an ('http://ads.digitalpoint.com/network.php?c=' . $_SERVER['SERVER_NAME'] . '&type=link');
    if ($new_ad) {
    $ads_param = explode ('<ad_param>' , $new_ad);
    $new_ad = $ads_param[1];
    unset ($ads_param[1]);
    $ads_temp = explode ('|', $ads_temp[0] . '|' . $ads_temp[1] . '|' . $ads_param[0]);
    } else {
    $ads_param = array_slice ($ads_temp, 2, 4);
    }
    $ads[0] = time() . '|' . gethostbyname('validate.digitalpoint.com') . '|' . implode ('|', $ads_param);
    if ($new_ad) {
    $ads[] = $new_ad;
    if (count ($ads) > $ads_temp[3] + 1) $ads = array_merge ((array)$ads[0], (array)array_slice ($ads, -$ads_temp[3]));
    }
    fwrite ($file, implode ('<ad_break>', $ads));
    ftruncate ($file, ftell($file));
    $ad_network[] = $new_ad;
    }
    flock ($file, LOCK_UN);
    fclose ($file);
    }
    while (count ($ad_network) < 5) {
    $ad_network[] = $ads[mt_rand(1,count($ads) - 1)];
    }
    foreach ($ad_network as $key => $ad) {
    $split = explode ('<id>', $ad);
    $ad_ids[] = $split[1];
    $ad = $split[0];
    $output = $ads_temp[1] == $_SERVER['REMOTE_ADDR'] || $_SERVER['SERVER_ADDR'] == $_SERVER['REMOTE_ADDR'];
    if ($output) {
    $ad_network[$key] = str_replace ('" />', '" class="' . $ads_temp[2] . '" />', $ad);
    } else {
    $ad_network[$key] = str_replace ('" />', '">', $ad);
    }
    }
    $ad_network = implode ('<br />', $ad_network);
    if ($ads_temp[6] && ($output || preg_match('#(' . str_replace ('-', '|', $ads_temp[7]) . ')#si', $_SERVER['HTTP_USER_AGENT'])) && !$_SERVER['HTTPS']) $ad_network .= '<img src="http://ads.digitalpoint.com/t-' . implode ('-', $ad_ids) . '.gif" width="1" height="1" />';
    } else {
    $ad_network = 'You must set the ad network .txt file to be writable (or file is not within path).';
    }
    if (substr (@$_SERVER['DOCUMENT_NAME'], -6) == '.shtml') {
    ini_set ('zlib.output_compression', 0);
    echo $ad_network;
    }

    ?>
     
    jyoti2005, Jun 23, 2005 IP
  9. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #9
    heh, how about inside the .htaccess file? :)
     
    chachi, Jun 23, 2005 IP
  10. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Oh sorry, you were asking about .htaccess

    This is what is in it:

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} ^(.*).htm [NC,OR]
    RewriteCond %{REQUEST_FILENAME} ^(.*).html [NC]
    RewriteRule ^(.*) /passthru.php?file=$1
    </IfModule>
     
    jyoti2005, Jun 23, 2005 IP
  11. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    Did I at least drop these into the right folder, lol!

    var/www/html
     
    jyoti2005, Jun 23, 2005 IP
  12. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #12
    ok, is this .htacess file the one with .txt after it? Let's add the following at the top of the .htaccess file:

    AddType application/x-httpd-php .php .htm .html
     
    chachi, Jun 23, 2005 IP
  13. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Ok I renamed the file .htaccess

    and I added in the following:

    AddType application/x-httpd-php .php .htm .html
     
    jyoti2005, Jun 23, 2005 IP
  14. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #14
    And the website still works fine? Not trying to scare you, just want to make sure SSI is not configured elsewhere.
     
    chachi, Jun 23, 2005 IP
  15. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    You mean my site might disappear once I upload this into /var/www/html ?
     
    jyoti2005, Jun 23, 2005 IP
  16. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #16
    I guess I should know before I upload it so's I can get any pics that may not be on my hard drive............lol
     
    jyoti2005, Jun 23, 2005 IP
  17. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #17
    heh, no. It will not disappear at all. If SSI is configured on your web server, placing that line in the .htaccess file will then cause your browser not to recognize the .htm or .html files as html and ask you what to do with it (ie:save it to disk). This is easily fixed by removing the line if this happens. There is only one way to find out...but don't worry. :)
     
    chachi, Jun 23, 2005 IP
  18. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #18
    ok - I have to head out, so I will do this a bit later today - will you be able to help me out again? I really appreciate the help :)
     
    jyoti2005, Jun 23, 2005 IP
  19. chachi

    chachi The other Jason

    Messages:
    1,600
    Likes Received:
    57
    Best Answers:
    0
    Trophy Points:
    0
    #19
    I will probably be around most of the day. If you don't see me on here, shoot me a PM and let me know you posted
     
    chachi, Jun 23, 2005 IP
  20. jyoti2005

    jyoti2005 Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #20
    Ok, thanks so much..............:)
     
    jyoti2005, Jun 23, 2005 IP