The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
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 |
#2
|
||||
|
||||
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.
|
#3
|
|||
|
|||
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> 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 . |
#4
|
||||
|
||||
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.)
|
#5
|
|||
|
|||
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> |
#6
|
||||
|
||||
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> 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? |
#7
|
|||
|
|||
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 |
#8
|
||||
|
||||
Quote:
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)))"> $post[postcount] % 7 == 0 means if the post count divided by 7 had a remainder of zero, show the ad. |
#9
|
|||
|
|||
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 |
#10
|
||||
|
||||
$post[islastshown] doesn't appear anywhere in the code I posted above... you said you wanted it every 7th post, not every last post.
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|