adbrite code in PHP

Discussion in 'PHP' started by search$, May 5, 2009.

  1. #1
    I have site using smarty, php and uses templates also...

    In the footer template ( PHP Code), I was not successful in adding adbrite code... could any one help me in sample code ....??
     
    search$, May 5, 2009 IP
  2. jack2006

    jack2006 Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ditto with adsense php code for mobile devices....
     
    jack2006, May 5, 2009 IP
  3. pipes

    pipes Prominent Member

    Messages:
    12,766
    Likes Received:
    958
    Best Answers:
    0
    Trophy Points:
    360
    #3
    Is the adbrite code javascript by any chance?
     
    pipes, May 6, 2009 IP
  4. jack2006

    jack2006 Peon

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If it's js just place it between {literal} code here {/literal} but for mobile devices it's php sice a lot of normal cells don't support js readily.
     
    jack2006, May 6, 2009 IP
  5. search$

    search$ Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    It is java script , but I did not understand {literal} code here {/literal} ?

    you saying

    {literal}

    adbrite
    Code

    {/literal}

    Is it correct or some thing else ?
     
    search$, May 6, 2009 IP
  6. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #6
    I Think this works for smarty template engine..you have to give us some idea how your footer code is
     
    Bohra, May 7, 2009 IP
  7. search$

    search$ Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Here is my footer , I want to include adbrite ads, and then a horizontal line then footer links ( part of this )

    {if $lbm==1 AND $citylist3!=1}{$citylist3}{/if}
    {if $citylist!=1}{$citylist4}{/if}
    <div class="copyrightDiv">

    <a href="p,help.htm">Help</a> | <a href="p,1,help.htm">About</a> | <a href="p,2,help.htm">Privacy Policy</a> | <a href="p,contact.htm">Contact {$mysitename}</a> | Copyright 2008 {$mysitename} <br />

    </div>

    <div id="xiti">{$xiti}</div>


    <div id="cmain">
    </div>
    </BODY>

    </HTML>
     
    search$, May 7, 2009 IP
  8. search$

    search$ Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    no one responding ?
     
    search$, May 8, 2009 IP
  9. pixmania

    pixmania Peon

    Messages:
    229
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9
    What exactly is the problem pasting the code into the footer ? and which file are you editing footer.php or footer.tpl

    <br />
    adbrite code goes here, if you want it centered then add <center> before the code and </center> after it
    <hr />

    if you want it displayed before the copyright and links place the above after {if $citylist!=1}{$citylist4}{/if}
     
    pixmania, May 8, 2009 IP
  10. Steve136

    Steve136 Peon

    Messages:
    240
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    0
    #10
    Hi,

    When using any JavaScript code in a Smarty template, it needs to be enclosed in the {literal} {/literal} tags like jack2006 said or you will get an error from smarty when parsing the template.

    Take your adbrite code and paste the {literal} tag before it and {/literal} after it.

    Regards,

    Steve
     
    Steve136, May 8, 2009 IP
  11. search$

    search$ Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    thank you jack2006, steve136...

    I was using .tpl ( template i guess), using literal works great :),

    with this I increased the presence of ads on all pages , hope some one will click :)
     
    search$, May 13, 2009 IP