The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
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! |
#2
|
||||
|
||||
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> |
Благодарность от: | ||
l0l4s0 |
#3
|
||||
|
||||
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? |
#4
|
||||
|
||||
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> 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> Code:
{vb:raw post.message} 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.) |
#5
|
|||
|
|||
Trying to get this to work and nothing seems to happen. Any clues as to why?
|
#6
|
||||
|
||||
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.)
|
#7
|
|||
|
|||
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?
|
#8
|
||||
|
||||
Code:
<vb:if condition="$post['isfirstshown'] AND $show['guest']"> xxxx </vb:if> 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. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|