Register Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools
  #1  
Old 22 Jul 2012, 11:01
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
How to show ads in first post at the end of message?

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 :



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?
Reply With Quote
  #2  
Old 22 Jul 2012, 11:15
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Real name: Shawn
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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.
Attached Images
File Type: jpg bannertest.jpg (85.8 KB, 12 views)
File Type: jpg bannertest2.jpg (88.7 KB, 10 views)

Last edited by ShawneyJ : 22 Jul 2012 at 13:28.
Reply With Quote
  #3  
Old 22 Jul 2012, 13:25
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Originally Posted by jaycob View Post
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:


Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

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]
Reply With Quote
  #4  
Old 22 Jul 2012, 13:31
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Real name: Shawn
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']">
Reply With Quote
  #5  
Old 22 Jul 2012, 15:44
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
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>
Reply With Quote
  #6  
Old 23 Jul 2012, 00:01
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Real name: Shawn
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,))">.
Reply With Quote
  #7  
Old 23 Jul 2012, 03:13
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Originally Posted by jaycob View Post
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.
Reply With Quote
  #8  
Old 23 Jul 2012, 03:35
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Real name: Shawn
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.

Last edited by ShawneyJ : 23 Jul 2012 at 03:43.
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show ads for last post on page only when there are more than X replies tpearl5 vBulletin 4.x Template Modifications 1 14 Jul 2012 23:46
Show Google Adsense / Adbrite Ads After X charaters in First Post Neutral Singh vBulletin 3.8 Add-ons 1 09 Jan 2011 04:22

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Thread Tools

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


New To Site? Need Help?

All times are GMT. The time now is 10:09.

Layout Options | Width: Wide Color: