Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 07-22-2012, 10:01 AM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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 :
Quote:
<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 07-22-2012, 10:15 AM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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:

Code:
<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.
Attached Images
File Type: jpg bannertest.jpg (85.8 KB, 0 views)
File Type: jpg bannertest2.jpg (88.7 KB, 0 views)
Reply With Quote
  #3  
Old 07-22-2012, 12:25 PM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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:

Code:
<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]
Reply With Quote
  #4  
Old 07-22-2012, 12:31 PM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 07-22-2012, 02:44 PM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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

Quote:
$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 07-22-2012, 11:01 PM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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 07-23-2012, 02:13 AM
PAKIDIL PAKIDIL is offline
 
Join Date: Jan 2007
Posts: 264
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
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 07-23-2012, 02:35 AM
ShawneyJ's Avatar
ShawneyJ ShawneyJ is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 1,758
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


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 02:00 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04610 seconds
  • Memory Usage 2,263KB
  • Queries Executed 14 (?)
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
  • (2)bbcode_code
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (8)postbit
  • (2)postbit_attachment
  • (8)postbit_onlinestatus
  • (8)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
  • postbit_attachment
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete