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.

What's wrong with it ?

Discussion in 'Placement / Reviews / Examples' started by Nokia999, Dec 11, 2005.

  1. #1
    google_color_border = "<? print $a[$rnd] ; ?>";


    This code is intended to randomly display color of border.

    And i am getting error
    Parse error: parse error, unexpected T_LNUMBER, expecting T_VARIABLE or '$'
    a is array
    rnd = random of numbers
     
    Nokia999, Dec 11, 2005 IP
  2. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #2
    You have PHP inside PHP. You should be using:

    <?php
    echo 'google_color_border = "'. $a[$rnd] .'"';
    ?>

    See how that works out for you.
     
    fsmedia, Dec 11, 2005 IP
  3. Crusader

    Crusader Peon

    Messages:
    1,735
    Likes Received:
    104
    Best Answers:
    0
    Trophy Points:
    0
    #3
    You are aware that this falls under "modifying Adsense code" and is a ToS violation right?

    In any case a much better way to do this would be to use Adsense itself. Create color schemes with borders of your liking, then when you are creating your AdSense code, you can select up to four of them by "Ctrl clicking" in the color palette chooser.

    AdSense will then randomly display ads with the different colors.
     
    Crusader, Dec 11, 2005 IP
  4. fsmedia

    fsmedia Prominent Member

    Messages:
    5,163
    Likes Received:
    262
    Best Answers:
    0
    Trophy Points:
    390
    #4
    But that's not our concern, is it ;)

    Yes, it could fall under modifying the code and something I would not not do either, I would simply use the custom random sorting they have built in.
     
    fsmedia, Dec 11, 2005 IP
  5. phrozen_ra

    phrozen_ra Peon

    Messages:
    147
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    That's not modifying the code.

    The output remains standard, the colors are changed from within PHP
     
    phrozen_ra, Dec 11, 2005 IP
  6. Nokia999

    Nokia999 Guest

    Messages:
    1,488
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I think it's not violation of TOS because i am not modifying it....
     
    Nokia999, Dec 11, 2005 IP
  7. new_life

    new_life Peon

    Messages:
    90
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes you are! how come you say you are not modyfing the code but you add sumthing into Google code.

    In any cases, they (Goolge or your enimies) can claim that you are modifying the code, because the code does not stay intact anymore. Simple as that! but it's up to you! :D
     
    new_life, Dec 11, 2005 IP
  8. Nokia999

    Nokia999 Guest

    Messages:
    1,488
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    0
    #8
    NO
    it's in php file and when its html will be generated it will be quite normal.
    And one more thing i am not indeed changing the code i am just setting the color.And it's on publisher how he changes it..
     
    Nokia999, Dec 11, 2005 IP
  9. Nokia999

    Nokia999 Guest

    Messages:
    1,488
    Likes Received:
    74
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Sorry for additional <? and ?>
    I have edited my first post plz see how it is.
     
    Nokia999, Dec 11, 2005 IP
  10. ikeys

    ikeys Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Tauren is right , if you modify the colors in php you will output a different colored ad every time but the client side javascript will be the same as the original (except a different color)
    the effect is like you go to the ad generator at google and create different colored ads there
     
    ikeys, Dec 11, 2005 IP
    Nokia999 likes this.