vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   How to show ads in first post at the end of message? (https://vborg.vbsupport.ru/showthread.php?t=285829)

PAKIDIL 07-22-2012 10:01 AM

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 :

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

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?

ShawneyJ 07-22-2012 10:15 AM

1 Attachment(s)
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.

PAKIDIL 07-22-2012 12:25 PM

Quote:

Originally Posted by jaycob (Post 2350390)
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]

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

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>

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

Quote:

Originally Posted by jaycob (Post 2350577)
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.


All times are GMT. The time now is 08:42 AM.

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.01081 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (8)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete