No announcement yet.

Multiple adsense banners in a thread

  • Filter
  • Time
  • Show
Clear All
new posts

  • Multiple adsense banners in a thread

    Ok, I read Jake's guide here:

    And I do want it after the first post, like the original code does, but I also wanted another ad between the second to last and last posts, which he says I should put this in:

    [COLOR=blue]<if condition="$post['islastshown']">[/COLOR]
    He does offer us to "mix'n'match" some of the statements, and I wanted to have BOTH adsense banners in my posts (Of course, this is all just for guests, though). But I'm clueless on how to program that in.

    I'm not quite sure how I'd combine the two if statements. What is the code I should use to meet those qualifications? (Ads, just for guests, in all threads, both after the first post and between the second and last posts)

    Would I just put the commas in like this?:
    [COLOR=blue]<if condition="$post[postcount] == 1 AND !$bbuserinfo[userid]">[/COLOR][COLOR=blue],<if condition="$post['islastshown']">[/COLOR]
    Engipress - Wordpress Resources and Information

  • #2
    It does same add code to top of template for between second and last.
    <if condition="$post['islastshown'] AND !$bbuserinfo[userid]"/>


    • #3
      Ok, I'm getting errors when I tried entering the code in, I don't think I'm putting it in correctly. What is the exact code I should put in the template?
      Engipress - Wordpress Resources and Information


      • #4
        Don't put a comma between the two if's. You would also be better to use

        [COLOR=blue]<if condition="(($post[postcount] == 1) OR ($post['islastshown'])) AND !$bbuserinfo[userid]">[/COLOR]
        or to use two separate blocks of code.


        • #5
          Alright, I tried entering what you said:
           if condition="(($post[postcount] == 1) OR ($post['islastshown'])) AND !$bbuserinfo[userid]">
            <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
            <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
                        <td class="thead" align="left">Sponsored Links</td>
                        <td class="alt1" align="center">
                                    <script type="text/javascript"><!--
            google_ad_client = "pub-1372766692340749";
            //728x90, Conspiracy Post
            google_ad_slot = "7861857950";
            google_ad_width = 728;
            google_ad_height = 90;
            <script type="text/javascript"
          But then I get this error:
          The following error occurred when attempting to evaluate this template:
          [B]Parse error[/B]:  syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in [B]/home/"Username"/public_html/includes/adminfunctions_template.php(3596) : eval()'d code[/B] on line [B]253[/B]
          This is likely caused by a malformed conditional statement. It is highly recommended that you fix this error before continuing, but you may continue as-is if you wish.
          Engipress - Wordpress Resources and Information


          • #6
            It looks like you are missing the < from before the if statement.


            • #7
              Doh! Thanks Kerry-Anne
              That was my problem

              Just to be sure, these ads disapperar when guests register, right? (just wanted to be sure)
              Last edited by jamestl2; Mon 19 Nov '07, 5:59pm.
              Engipress - Wordpress Resources and Information


              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.