Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions

Reply
 
Thread Tools Display Modes
  #1  
Old 03-04-2011, 05:18 PM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default how can i place google adsense within postbit

Hello,
how can i place google ads in postbit using forum conditions like i don't want it to be appear in forum id 3,4,10,3 and also with user group id like 3,4,5 can view the ads the rest can not

google ads will be look like this :


waiting for reply
thanks
Reply With Quote
  #2  
Old 03-05-2011, 03:21 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Edit the template and add the ad into there. There is a list of conditonals in the articles forum - have you looked in there? You'll proababy want to use the variable $thread[forumid] for the forumid and $bbuserinfo for the viewer. If you still have problems, please post your *exact* code that you tried and make sure to put code tags around it.
Reply With Quote
  #3  
Old 03-05-2011, 07:05 PM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i used this code to show the ads as specific .
In Postbit Template
Code:
Find:

    <!-- / message -->

Add below:

    <if condition="(($post[postcount]==1) or ($post[islastshown] and !$GLOBALS['vbulletin']->GPC['ajax']))">
    <center>
    <script type="text/javascript"><!--
    google_ad_client = "youradsensecode";
    google_alternate_ad_url = "http://www.yourwebsite.com/collapsible_ad.html";
    google_ad_width = 468;
    google_ad_height = 60;
    google_ad_format = "468x60_as";
    google_ad_type = "text_image";
    google_ad_channel ="yourchannelcode";
    google_color_border = "F5F5FF";
    google_color_bg = "F5F5FF";
    google_color_link = "FF0000";
    google_color_url = "000000";
    google_color_text = "22229C";
    //--></script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
    </script>
    </center>
    </if>
how to add forum id in it i tried to replace the codes with this

Code:
<if condition="(($post[postcount]==1) or ($post[islastshown] and !in_array($GLOBALS['forumid'], array(46,51,58,69,75,95,97,100,103))">
<center>
google ad
</center>
</if>

but getting error malfunction conditional statement error .
Reply With Quote
  #4  
Old 03-05-2011, 11:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Your parenthesis don't 'add' up is why you are getting the error. Count the number of ( and ) parenthesis in your condition and you should have an equal number. (Hint: you are missing two )) at the end.)
Reply With Quote
  #5  
Old 03-06-2011, 08:41 AM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please check this . the add is showing but its showing in all of the forum even i put conditional in forums .
this is what i am placing in postbit

Code:
<if condition="(($post[postcount]==1) or ($post[islastshown] AND !in_array($GLOBALS['forumid'], array(46,51,58,69,75,95,97,100,103))))">
google ads
</if>
any help please
Reply With Quote
  #6  
Old 03-06-2011, 11:12 AM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could try $thread[forumid] rather than $GLOBALS[forumid] so:

Code:
<if condition="(($post[postcount]==1) or ($post[islastshown] AND !in_array($thread[forumid], array(46,51,58,69,75,95,97,100,103))))">
google ads
</if>
Also when do you want to show the ad, as your condition is written it will:

ALWAYS show in the first ad in the first post in every forum
and show in the Last Post if not in the forums you specify.

That's how its written, is that what you want to do?
Reply With Quote
  #7  
Old 03-06-2011, 12:11 PM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i want to show in all of the forum except forum id 46,51,58,69,75,95,97,100,103.

and in first post and every after 7 post .

location is in post content.

i am going to try with for $thread[forumid] code
Reply With Quote
  #8  
Old 03-06-2011, 12:27 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
i want to show in all of the forum except forum id 46,51,58,69,75,95,97,100,103.
Does that include the first ad too? Because if so you need to re-do the logic in your conditional...

Also you had nothing for the 7th post... Try this, if I understand what you want:
Code:
<if condition="(($post[postcount]==1) OR ($post[postcount] % 7 == 0) AND !in_array($thread[forumid], array(46,51,58,69,75,95,97,100,103)))">
Will display the ad in the first post and every 7th post so long as not in the forums listed.

$post[postcount] % 7 == 0 means if the post count divided by 7 had a remainder of zero, show the ad.
Reply With Quote
  #9  
Old 03-06-2011, 12:55 PM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

i tried with the above code . its work for the first part
Code:
<if condition="(($post[postcount]==1) or ($post[islastshown]

but not working for the conditional part. because its showing in all forum.

any help please
Reply With Quote
  #10  
Old 03-06-2011, 12:58 PM
BirdOPrey5's Avatar
BirdOPrey5 BirdOPrey5 is offline
Senior Member
 
Join Date: Jun 2008
Location: New York
Posts: 10,610
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by PAKIDIL View Post
i tried with the above code . its work for the first part
Code:
<if condition="(($post[postcount]==1) or ($post[islastshown]

but not working for the conditional part.
any help please
$post[islastshown] doesn't appear anywhere in the code I posted above... you said you wanted it every 7th post, not every last post.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 11:33 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04769 seconds
  • Memory Usage 2,256KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (7)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete