• User Attivo

    Script rotazione link adsense style

    Conoscete uno script per creare una rotazione di link simile ad adsense?

    Ciaoooo :ciauz:


  • User Attivo

    Mi rispondo da solo 😄 l'ho trovato, ma non funziona e non capisco perche' http://www.rss-wiki.com/scripts.php

    Consiste in 3 files:
    1count (che conta le visualizzazioni ed ha permesso chmod777)
    2link (che contiene i link)
    4ad.php (che sceglie e mostra i link)

    Questo e' il file 4ad.php
    [PHP]<?php

    $ad = file('2link');            //get the ads
    $count = file_get_contents('1count');    //get the current ad to display
    
    //just put them in their own vars for simplicity
    //two ads for 468x60 banner - $a to $d for ad1 and $f to $i for ad2
    $a = $ad[$count+0];    //title
    $b = $ad[$count+1];    //description line 1
    $c = $ad[$count+2];    //description line 2
    $d = $ad[$count+3];    //URL
    
    $f = $ad[$count+5];    //title of ad2...
    $g = $ad[$count+6];
    $h = $ad[$count+7];
    $i = $ad[$count+8];
    
    $k = $ad[$count+10];    //title
    $l = $ad[$count+11];    //description line 1
    $m = $ad[$count+12];    //description line 2
    $n = $ad[$count+13];    //URL
    
    $p = $ad[$count+15];    //title of ad2...
    $q = $ad[$count+16];
    $r = $ad[$count+17];
    $s = $ad[$count+18];
    

    ?>

    <style type="text/css">
    
    a.foot {
        color: #000;
        text-decoration: none;
    }
    b {
    
        font-size: 13px;
        font-family: arial,geneva,helvetica,sans-serif;
        text-decoration: none;
    }
    table {
        background: #fff;
        font-family: arial,geneva,helvetica,sans-serif;
        font-size: 12px;
        width: 728px;
        height: 90px;
        border: 0px solid color:#fff;
    }
    td {
        vertical-align: top;
        border: 0px solid color:;
    }
    
    td.foot {
        background:;
        font-size: 10px;
        font-weight : bolder;
        color:;
        height: 1px;
        text-decoration : none;
        text-indent : 0px;
        line-height : 10px;
    }
    </style>
    

    <?

    //display the banner
    echo "<table><tr><td width=\"25%\">";
        echo '<a href="'.$d.'" target="_blank"><b>'.$a.'</b></a><br />';
        echo $b.' ';
        echo $c;
    echo "</td><td width=\"25%\">";
        echo '<a href="'.$i.'" target="_blank"><b>'.$f.'</b></a><br />';
        echo $g.' ';
        echo $h;
    echo "</td><td width=\"25%\">";
        echo '<a href="'.$n.'" target="_blank"><b>'.$k.'</b></a><br />';
        echo $l.' ';
        echo $m;
    echo "</td><td width=\"25%\">";
        echo '<a href="'.$s.'" target="_blank"><b>'.$p.'</b></a><br />';
        echo $q.' ';
        echo $r;
    echo "</td></tr><tr><td colspan=\"2\" class=\"foot\">
            <a class=\"foot\" href=\"javascript:location.reload(true)\">Refresh Links</a></td>
        <td colspan=\"2\" class=\"foot\" align=\"right\">
            <a class=\"foot\" href=\"pubblicita.php\">Pubblicità</a>&nbsp;</td>
        </tr></table>";
    
    //update the count file so we get new ads each time the page loads
    if (count($ad) <= $count+20)
        file_put_contents('1count', 0); //end of list reset back to start, not randon sequence
    else
        file_put_contents('1count', $count+20);
    
    /* Note the file format of 2link is paramount or data will not be in sync
      really did not want to have to create a database to show a few links */
    

    ?>[/PHP]

    A non funzionare e' il file 1count che rimane comunque sepre fermo a 0, voi vedete un'errore nel file 4ad.php ?

    Ciaooooo :ciauz: