Announcement

Collapse
No announcement yet.

Multiple adsense banners in a thread

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

  • Multiple adsense banners in a thread

    Ok, I read Jake's guide here:
    http://www.vbulletin.com/forum/showthread.php?t=157022

    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:

    Code:
    [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?:
    Code:
    [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]"/>

    Comment


    • #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

      Comment


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

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

        Twitter Blog

        www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

        Comment


        • #5
          Alright, I tried entering what you said:
          Code:
           if condition="(($post[postcount] == 1) OR ($post['islastshown'])) AND !$bbuserinfo[userid]">
             
            $spacer_open
            <div style="padding:0px 0px $stylevar[cellpadding]px 0px">
             
            <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
            <tr>
                        <td class="thead" align="left">Sponsored Links</td>
            </tr>
            <tr>
                        <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>
            <script type="text/javascript"
            src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
            </script>
                        </td>
            </tr>
            </table>
             
            </div>
            $spacer_close
             
            </if>
          But then I get this error:
          Code:
          The following error occurred when attempting to evaluate this template:
          [I]
          [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]
          [/I]
          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

          Comment


          • #6
            It looks like you are missing the < from before the if statement.
            Kerry-Anne :)

            Twitter Blog

            www.peterska2.com www.worldnewszone.com www.popularusenetgroups.com www.superclickers.co.uk www.forumsforchrist.com www.browsergameplanet.com

            Comment


            • #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

              Comment

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