Random Image Link Script

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Random Image Link Script

    Hey guys, here's one of my new php scripts i just coded and wanted to share with you, it shows random image link up to 5 random images but if you want more random image links you can contact me i will increase the number, the php code is :
    PHP Code:
    <?php    

    echo    '<style type="text/css">    
            .ads                
            {
            background-color:#eaeaae;
            }
            img
            {
            width:120px;
            height:30px;
            border:-1px;
            }
            a
            {
            color:red;
            font-weight:bold;
            text-decoration:none;
            }
            </style>'
    ;
    echo    
    '<div class=\'ads\'>';
            
    $num    =    5#Put the number of random links you want here, maximum is 5
            
    $ads    =    rand(1,$num);
    #Please change links and banner addresses to suit your needs
            
    $ad1    =    '<a href=\'http://libra.wen.ru\'>
                    <img src=\'banner1.gif\' alt=\'libra\'/></a>'
    ;
            
    $ad2    =    '<a href=\'http://s3nzo.wen.ru\'>
                    <img src=\'banner2.gif\' alt=\'s3nzo.wen.ru\'/></a>'
    ;
            
    $ad3    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>
                    <img src=\'banner3.gif\' alt=\'m-phone\'/></a>'
    ;
            
    $ad4    =    '<a href=\'http://wap.konvict.mobi/?id=konvictmobi\'>
                    <img src=\'banner4.gif\' alt=\'konvict.mobi\'/></a>'
    ;
            
    $ad5    =    '<a href=\'http://bluechild.co.cc\'>
                    <img src=\'banner5.gif\' alt=\'BlueChild\'/></a>'
    ;
            
    $s3nzo    =    '<a href=\'http://konvict.mobi\'>KONVICT.mobi</a>';
            
    $ad    =    'Powered by';
    switch(
    $ads)
        {
            case 
    : print $ad1.'<br>';
            break;
            case 
    : print $ad2.'<br>';
            break;
            case 
    : print $ad3.'<br>';
            break;
            case 
    : print $ad4.'<br>';
            break;
            case 
    : print $ad5.'<br>';
            break;
            default : print 
    $s3nzo.'<br>';
        }

    echo 
    $ad.' '.$s3nzo.'</div>';

    ?>
    The demo of the script can be found HERE
    and the full script with default banners is attached
    Attached Files
    libra.wen.ru

    #2
    I just created another version of this script! In this new version you can choose to show image ads, text ads or both types! hope you enjoy this new version, please open the file "randomized.php" and replace the code with this one
    PHP Code:
    <?php    
    echo    '<style type="text/css">    
            .ads                
            {
            background-color:#eaeaae;
            }
            img
            {
            width:120px;
            height:30px;
            border:-1px;
            }
            a
            {
            color:red;
            font-weight:bold;
            text-decoration:none;
            }
            </style>'
    ;
    echo    
    '<div class=\'ads\'>';
    #If you want to show image ads set $type = 0, if you want text ads set $type = 1, for both types set $type =  2
            
    $type    =    2;
    #Put the number of random links you want here, maximum is 5 
            
    $num    =    5;
            
    $ads    =    rand(1,$num);
    #Please change the urls to suit your needs
            
    $ad1    =    '<a href=\'http://libra.wen.ru\'>
                    <img src=\'banner1.gif\' alt=\'libra\'/></a>'
    ;
            
    $ad2    =    '<a href=\'http://s3nzo.wen.ru\'>
                    <img src=\'banner2.gif\' alt=\'s3nzo.wen.ru\'/></a>'
    ;
            
    $ad3    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>
                    <img src=\'banner3.gif\' alt=\'m-phone\'/></a>'
    ;
            
    $ad4    =    '<a href=\'http://wap.konvict.mobi/?id=konvictmobi\'>
                    <img src=\'banner4.gif\' alt=\'konvict.mobi\'/></a>'
    ;
            
    $ad5    =    '<a href=\'http://bluechild.co.cc\'>
                    <img src=\'banner5.gif\' alt=\'BlueChild\'/></a>'
    ;
            
    $s3nzo    =    '<a href=\'http://konvict.mobi\'>KONVICT.mobi</a>';
            
    $ad    =    'Powered by';
            
    $txt    =    rand(1,$num);
            
    $txt1    =    '<a href=\'http://libra.wen.ru\'>LIBRA.wen.ru</a>';
            
    $txt2    =    '<a href=\'http://s3nzo.wen.ru\'>s3nzo.wen.ru</a>';
            
    $txt3    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>Free Hot Videos</a>';
            
    $txt4    =    '<a href=\'http://wap.konvict.mobi/?id=konvictmobi\'>Add Your site</a>';
            
    $txt5    =    '<a href=\'http://bluechild.co.cc\'>BlueChild</a>';
            
    $n    =    rand(1,10);
            
    $ads1    =    '<a href=\'http://libra.wen.ru\'>
                    <img src=\'banner1.gif\' alt=\'libra\'/></a>'
    ;
            
    $ads2    =    '<a href=\'http://libra.wen.ru\'>LIBRA.wen.ru</a>';
            
    $ads3    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>
                    <img src=\'banner3.gif\' alt=\'m-phone\'/></a>'
    ;
            
    $ads4    =    '<a href=\'http://s3nzo.wen.ru\'>s3nzo.wen.ru</a>';
            
    $ads5    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>
                    <img src=\'banner3.gif\' alt=\'m-phone\'/></a>'
    ;
            
    $ads6    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>Free Hot Videos</a>';
            
    $ads7    =    '<a href=\'http://wap.konvict.mobi/?id=konvictmobi\'>
                    <img src=\'banner4.gif\' alt=\'konvict.mobi\'/></a>'
    ;
            
    $ads8    =    '<a href=\'http://wap.konvict.mobi/?id=konvictmobi\'>Add Your site</a>';
            
    $ads9    =    '<a href=\'http://bluechild.co.cc\'>
                    <img src=\'banner5.gif\' alt=\'BlueChild\'/></a>'
    ;
            
    $ads10    =    '<a href=\'http://bluechild.co.cc\'>BlueChild</a>';
    if(
    $type==0)
    {
    switch(
    $ads)
        {
            case 
    : print $ad1.'<br>';
            break;
            case 
    : print $ad2.'<br>';
            break;
            case 
    : print $ad3.'<br>';
            break;
            case 
    : print $ad4.'<br>';
            break;
            case 
    : print $ad5.'<br>';
            break;
            default : print 
    $s3nzo.'<br>';
        }

    }
    else if(
    $type==1)
    {
    switch(
    $txt)
        {
            case 
    : print $txt1.'<br>';
            break;
            case 
    : print $txt2.'<br>';
            break;
            case 
    : print $txt3.'<br>';
            break;
            case 
    : print $txt4.'<br>';
            break;
            case 
    : print $txt5.'<br>';
            break;
            default : print 
    $s3nzo.'<br>';
        }

    }
    else
    {
    switch(
    $n)
        {
            case 
    : print $ads1.'<br>';
            break;
            case 
    : print $ads2.'<br>';
            break;
            case 
    : print $ads3.'<br>';
            break;
            case 
    : print $ads4.'<br>';
            break;
            case 
    : print $ads5.'<br>';
            break;
            case 
    : print $ads6.'<br>';
            break;
            case 
    : print $ads7.'<br>';
            break;
            case 
    : print $ads8.'<br>';
            break;
            case 
    : print $ads9.'<br>';
            break;
            case 
    10 : print $ads10.'<br>';
            break;
            default : print 
    $s3nzo.'<br>';
        }

    }

    echo 
    $ad.' '.$s3nzo.'</div>';

    ?>
    libra.wen.ru

    Comment


      #3
      its easier to use arrays like:
      PHP Code:
              $ad[]    =    '<a href=\'http://libra.wen.ru\'>
                      <img src=\'banner1.gif\' alt=\'libra\'/></a>'
      ;
              
      $ad[]    =    '<a href=\'http://s3nzo.wen.ru\'>
                      <img src=\'banner2.gif\' alt=\'s3nzo.wen.ru\'/></a>'
      ;
              
      $ad[]    =    '<a href=\'http://m-phone.info/?id=konvictmobi\'>
                      <img src=\'banner3.gif\' alt=\'m-phone\'/></a>'
      ;
              
      $ad[]    =    '<a href=\'http://wap.konvict.mobi/?id=konvictmobi\'>
                      <img src=\'banner4.gif\' alt=\'konvict.mobi\'/></a>'
      ;
              
      $ad[]    =    '<a href=\'http://bluechild.co.cc\'>
                      <img src=\'banner5.gif\' alt=\'BlueChild\'/></a>'
      ;
             echo 
      $ad[rand(0,count($ad)-1)].'<br/>'
      Advertise your mobile site for FREE with AdTwirl

      Comment


        #4
        Thank you bro, i have learnt something new and useful today
        libra.wen.ru

        Comment

        Working...
        X