vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Adsense block in first post for guests only (https://vborg.vbsupport.ru/showthread.php?t=281685)

geckoz 04-17-2012 03:29 PM

Adsense block in first post for guests only
 
Hi there,

I am looking for a simple mod oder addon to put an AdSense block on the left or right side in the first post and have the text / content float left or right the adsense block. Only guests should be able to see this adsense block in the first post.

Can anybody help me?

Thanks so much!

BirdOPrey5 04-17-2012 06:45 PM

You really don't need a mod for this.

vBulletin has a built in "Ad Location" template called ad_showthread_firstpost_start.

Simply go to your style manager, edit templates, and open that template.

Paste in your ad code from google directly into that template.

To make it visible only to guests add this template conditional:

Code:

<vb:if condition="$show['guest']">
all ad code here...
</vb:if>


geckoz 04-18-2012 10:13 AM

Found it, but with this template I can not make the text float around the ad. I think it's because the "first post ad" template is displayed before the content of the first post.

Any suggestions?

BirdOPrey5 04-18-2012 12:04 PM

That's weird, when I used it I remember the ad being off to the side.

Edit- Oh you mean float around the text...

Try putting the ad code inside this:

Code:

<vb:if condition="$show['guest']">
  <div style="width:200px; float:right;">
    all ad code here...
  </div>
</vb:if>

set the width to the actual width of the ad...

If that doesn't work in your posbit/postbit_legacy template move this code:

Code:


                                                <vb:if condition="$post['isfirstshown']">
                                                        {vb:raw ad_location.ad_showthread_firstpost_start}
                                                        {vb:raw ad_location.thread_first_post_content}
                                                </vb:if>

Directly above:
Code:

{vb:raw post.message}
And try it again.

If that doesn't work simply hit the "Revert Template" button to revert the postbit back to normal. (Or if the template was already customized, just undo the changes above. DON'T REVERT in that case.)

g00gl3r 05-27-2012 03:00 PM

Trying to get this to work and nothing seems to happen. Any clues as to why?

BirdOPrey5 05-27-2012 06:57 PM

If "nothing" is working are you sure you're making changes to the right style? Add a line like "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" just to test and make sure your changes are showing up. (Then obviously undo it if it does show.)

g00gl3r 05-27-2012 08:14 PM

Got it. I've done it via editing the postbit_legacy. I don't suppose you know the conditional to show only in the first post? Or maybe even first and second post, but the guests only?

BirdOPrey5 05-27-2012 09:23 PM

Code:

<vb:if condition="$post['isfirstshown'] AND $show['guest']">
xxxx
</vb:if>

first post of every page for guests only.

There is no condition for 2nd post shown... you could use $post['postcount'] == 2 but it would only be the actual second post, not on every page of the thread.


All times are GMT. The time now is 08:16 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.01030 seconds
  • Memory Usage 1,722KB
  • 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
  • (5)bbcode_code_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