vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=246)
-   -   Mini Mods - Advertisement Inside First Post In A Thread (https://vborg.vbsupport.ru/showthread.php?t=234851)

indiancinema 02-02-2010 10:00 PM

Advertisement Inside First Post In A Thread
 
1 Attachment(s)
Many People were asking for this Mod, This will add advertisement inside your first post

728 x 90 or 468 x 60 advertisement

Open Postbit or Postbit_legacy Template, which ever you are using

Look for this code

Code:

<vb:if condition="$show['postedited']">
Above it add this code

Code:

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
  <div class="body">
  <div style="width: 100%">

Your Advertisement Code here...

</div>
</div>
</vb:if>


djbaxter 02-03-2010 02:19 AM

This is already a built-in option in 4.x.

Alecsmith 02-03-2010 03:53 AM

Tagged for my next forum :)

trilOByte 02-03-2010 07:44 AM

Quote:

Originally Posted by djbaxter (Post 1973593)
This is already a built-in option in 4.x.

Where?

trilOByte 02-03-2010 07:48 AM

This is useful, thanks. :)

How would I modify the conditional to make this appear only in certain formid's?

civil78 02-03-2010 01:10 PM

Quote:

Originally Posted by trilOByte (Post 1973738)
Where?

ADMINCP --> Advertising --> Add New Ad

and from dropdown Page select Thread

Quote:

Originally Posted by trilOByte (Post 1973741)
This is useful, thanks. :)

How would I modify the conditional to make this appear only in certain formid's?

From VB4 Adv system you can set a lot of rules where and when something appears.

djbaxter 02-03-2010 03:19 PM

Quote:

Originally Posted by djbaxter (Post 1973593)
This is already a built-in option in 4.x.

Quote:

Originally Posted by trilOByte (Post 1973738)
Where?

Quote:

Originally Posted by civil78 (Post 1973930)
ADMINCP --> Advertising --> Add New Ad

and from dropdown Page select Thread

That or using the Ad templates introduced in version 3.8.

indiancinema 02-03-2010 07:17 PM

Quote:

Originally Posted by djbaxter (Post 1974004)
That or using the Ad templates introduced in version 3.8.

I dont see anything where we can add the advertisement inside the first post, All You can add is after the first post.

djbaxter 02-04-2010 12:56 AM

Quote:

Originally Posted by indiancinema (Post 1974134)
I dont see anything where we can add the advertisement inside the first post, All You can add is after the first post.

  1. Admin CP | Advertising | Manage Ads => Thread
    • Choice of inside first post or second post or both.


  2. Admin CP | Styles & Templates | Edit Templates =>
    • ad_showthread_firstpost_start
    • ad_thread_first_post_content
    • ad_showthread_firstpost_sig

KevinGupta 02-06-2010 07:13 AM

Quote:

Originally Posted by djbaxter (Post 1974327)
  1. Admin CP | Advertising | Manage Ads => Thread
    • Choice of inside first post or second post or both.


  2. Admin CP | Styles & Templates | Edit Templates =>
    • test ad_showthread_firstpost_start
    • test ad_thread_first_post_content
    • test ad_showthread_firstpost_sig

but when I ad any code using vB inbuilt option, e.g. Adbrite code it gives me an error at the top of the page:

Quote:

Parse error: syntax error, unexpected '[' in /home/public_html/--/forum/includes/class_core.php(4029) : eval()'d code on line 9

TheSupportForum 02-06-2010 11:00 PM

you are getting message becuase vb4 already has an ad program integrated
you cant parse the same function more than once

your add function does

djbaxter 02-06-2010 11:29 PM

Quote:

Originally Posted by simonhind (Post 1976329)
you are getting message becuase vb4 already has an ad program integrated
you cant parse the same function more than once

your add function does

No that's not it.

But you could try adding <vb:literal>... </vb:literal> tags around the code.

KevinGupta 02-07-2010 01:23 AM

Works great with the tags :)
thanks

djbaxter 02-07-2010 01:33 AM

Glad to hear that. :)

ndut 02-08-2010 10:57 PM

Quote:

Originally Posted by civil78 (Post 1973930)
ADMINCP --> Advertising --> Add New Ad

and from dropdown Page select Thread



From VB4 Adv system you can set a lot of rules where and when something appears.

when i click advertising, why there is DATABASE ERROR??

PjDaBadMan 02-21-2010 12:44 AM

I have installed this to my site.
I have one question though, How come the ads randomly appear?

Let me explain more. I will click on a thread and under the first post there will be an ad. I will backspace after and go to another thread then the ad does not appear under the first post on the new thread.
So basically the ads randomly appear on and off under the first posts.

Any advice?

kingMOB 02-24-2010 11:08 AM

Could this code be adapted to be used in the cms? Like, after the third article print a banner, or insert a widget?

Dr.osamA 03-17-2010 02:09 AM

goood work

installed

5 stars

thanxxxx

Sancipa 04-02-2010 12:17 PM

this mod only works if you have edited the post


you got put it wrong...

try this

Put this script:
Code:

<vb:if condition="(THIS_SCRIPT == showthread) AND ($post[postcount] == '1')">
  <div class="body">
  <div style="width: 100%">

Your Advertisement Code here...

</div>
</div>
</vb:if>


After this:
Code:

{vb:raw template_hook.postbit_end}

Sancipa 04-11-2010 06:31 PM

Not working on 4.0.3 need little help here...

marshal_ramdev 04-21-2010 04:59 AM

thank you ...

dzinerfusion 07-29-2010 03:20 AM

Sorry, again, but does anyone know how to limit to certain threads or boards?

ShawneyJ 08-02-2010 01:06 PM

spot on the same code as i have been using, altho i place my ads at the top of the content. actually i posted this code somewhere on vb.org. not saying you stole it ;) just was going to make my own thread but you beat me to it.

Daman Kirklin 08-04-2010 01:26 AM

Is there any way to set up the ad to show up only by 1 thread or a single announcement?

Drache 09-15-2010 10:22 AM

https://vborg.vbsupport.ru/attachmen...9&d=1265162860
How can I get the ad to show under the text instead of showing at the right side of the post?

I added 2nd ad using <vb:literal>... </vb:literal>

but it's showing under the first ad on the right side that are limited 300 pixels. can't get it to show under the text on left side.

please help. thanks.

Naijasite 09-30-2012 11:35 PM

pleasehow do i make the advert to be at the middle of the first post?

jokergameth 11-08-2016 07:51 AM

Thank you. Works with vb 4.2.1 Patch Level 1


All times are GMT. The time now is 04:55 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.01479 seconds
  • Memory Usage 1,776KB
  • 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
  • (4)bbcode_code_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (27)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