Log in

View Full Version : How to show ads in first post at the end of message?


PAKIDIL
07-22-2012, 10:01 AM
Hello,

I am trying to show ads in my first post at the end of the message just above the signature but It's not working .

I am trying this :

http://img441.imageshack.us/img441/431/snap73tz.gif

Code using :<if condition="THIS_SCRIPT != 'register' AND !in_array($GLOBALS['forumid'], array(x,x,x,x))">
<if condition="is_member_of($vbulletin->userinfo, x,x,x)"><script type="text/javascript"><!--
google_ad_client = "xxxx";
/* 728x90 bottom ad */
google_ad_slot = "dxxds";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</if>
</if>

Can anyone suggest me please how to make it work?

ShawneyJ
07-22-2012, 10:15 AM
are you trying to show in certain forums and to certain user-groups? or you want to show for all? members and guests?


EDIT: ahh, sorry, should have looked at your code closer... after messing around with this code, i found that this code works fine for me:

<if condition="(($post[postcount] % $vboptions[maxposts] == 1))">
<if condition="THIS_SCRIPT != 'register' AND !in_array($GLOBALS['forumid'], array(x,x,x))">
<if condition="!is_member_of($vbulletin->userinfo, x,x,x)"><center>

YOUR GOOGLE AD CODE HERE

</center>
</if>
</if>
</if>

i added my code in postbit_legacy under:
$template_hook[postbit_signature_start]
$ad_location[ad_showthread_firstpost_sig]
MY CODE

I tested forum ID 9 and userinfo ID 6 and i could not see the add. So i guess, if you do not want to show the ads to user groups and in certain forums, place the IDs in where you do NOT want the show ads.

P.S. If you dont want the ad Centered, remove the <center></center> tags.
Let me know how you go mate.
cheers.

PAKIDIL
07-22-2012, 12:25 PM
are you trying to show in certain forums and to certain user-groups? or you want to show for all? members and guests?


EDIT: after messing around with this code, i found that this code works fine for me:

<if condition="(($post[postcount] % $vboptions[maxposts] == 1))">
<if condition="THIS_SCRIPT != 'register' AND !in_array($GLOBALS['forumid'], array(x,x,x))">
<if condition="!is_member_of($vbulletin->userinfo, x,x,x)"><center>

YOUR GOOGLE AD CODE HERE

</center>
</if>
</if>
</if>

i added my code in postbit_legacy under:
$template_hook[postbit_signature_start]
$ad_location[ad_showthread_firstpost_sig]
MY CODE

I tested forum ID 9 and userinfo ID 6 and i could not see the add. So i guess, if you do not want to show the ads to user groups and in certain forums, place the IDs in where you do NOT want the show ads.

P.S. If you dont want the ad Centered, remove the <center></center> tags.
Let me know how you go mate.
cheers.


Thank you for the above code. I am going to try but one thing I would like to know. Should I have to add the code in both

$template_hook[postbit_signature_start]
$ad_location[ad_showthread_firstpost_sig]

Or just edit Postbit legacy and add the code under $template_hook[postbit_signature_start]

ShawneyJ
07-22-2012, 12:31 PM
once only...under $ad_location[ad_showthread_firstpost_sig]. if you do not have that then under $template_hook[postbit_signature_start].

Long as your code is directly above: <if condition="$post['signature']">

Postbit legacy Example:
$template_hook[postbit_signature_start]
$ad_location[ad_showthread_firstpost_sig]

YOUR CODE

<if condition="$post['signature']">

PAKIDIL
07-22-2012, 02:44 PM
Hi

I tried in $ad_location[ad_showthread_firstpost_sig]. It didn't show .

I also tried with $template_hook[postbit_signature_start]

It either didn't showed.

For some reason It's not appearing HERE is the code for postbit legacy that I am trying


$template_hook[postbit_signature_start]
<if condition="(($post[postcount] % $vboptions[maxposts] == 1))">
<if condition="THIS_SCRIPT != 'register' AND !in_array($GLOBALS['forumid'], array(12,13,14,))">
<if condition="is_member_of($vbulletin->userinfo, 1, 2, 3, 4, 5, 7)"><script type="text/javascript"><!--
google_ad_client = "ca-pub-xxxxxxxxx";
/* 728x90 bottom ad */
google_ad_slot = "xxxxx";
google_ad_width = 728;
google_ad_height = 90;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</if>
</if>
</if>
<if condition="$post['signature'] AND !in_array($thread['forumid'],array(13,14,15,))">
<!-- sig -->
<div>
__________________<br />
$post[signature]
</div>
<!-- / sig -->
</if>

ShawneyJ
07-22-2012, 11:01 PM
mate pm me, i can take a look for you. maybe the style is different set up than default. not sure why you need this part: <if condition="$post['signature'] AND !in_array($thread['forumid'],array(13,14,15,))">.

PAKIDIL
07-23-2012, 02:13 AM
mate pm me, i can take a look for you. maybe the style is different set up than default. not sure why you need this part: <if condition="$post['signature'] AND !in_array($thread['forumid'],array(13,14,15,))">.

Yes you are right, Style is different then default.

ShawneyJ
07-23-2012, 02:35 AM
hi feel free to pm mate. if not, i would try changing
<if condition="$post['signature'] AND !in_array($thread['forumid'],array(13,14,15,))">
to this.
<if condition="$post['signature']">
i'd still love to have a look, but thats up to you.
cheers.
p.s maybe post in your whole post bit or pm it.