MyBB Community Forums

Full Version: Advertisements In-between Posts?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello everyone,

Is there any way to place advertisements in between posts without a plugin, by editing the template files?

I just need an advertisement after the 1st and 9th post, with a tcat column above the ad saying 'Sponsored'.

I try and avoid plugins, as I already have quite a few.

Is it possible to do this by editing the showthread template?
if you do not want to use the plugins then you can have advertisements at the beginning of the thread or at the
end of the thread (both by editing showthread template) or after each & every post (by editing postbit templates)

if you can use a plugin then see replies here.
you can also use template conditionals plugin which should exactly serve your requirement.
Hello,

I've installed MyAdvertisements, but I can't seem to find any way to insert ads 'in between' post 1 & 2, and post 9 & 10.

Is there any way of achieving this with, or without the plugin?

Surely there would be a way, even if it is by editing core files.
Copy the contents of the postbit template (or postbit_classic if you use Classic Postbit).

Create a new template, postbit_first (or postbit_first_classic), paste the contents of postbit/postbit_classic into it, and then add the advertisement code. Smile
(2013-07-25, 09:12 AM)Seabody Wrote: [ -> ]Copy the contents of the postbit template (or postbit_classic if you use Classic Postbit).

Create a new template, postbit_first (or postbit_first_classic), paste the contents of postbit/postbit_classic into it, and then add the advertisement code. Smile

Thank you, and that will help me achieve ads in-between post 1 & 2, and post 9 & 10?
(2013-07-25, 09:17 AM)Greg Winston Wrote: [ -> ]
(2013-07-25, 09:12 AM)Seabody Wrote: [ -> ]Copy the contents of the postbit template (or postbit_classic if you use Classic Postbit).

Create a new template, postbit_first (or postbit_first_classic), paste the contents of postbit/postbit_classic into it, and then add the advertisement code. Smile

Thank you, and that will help me achieve ads in-between post 1 & 2, and post 9 & 10?

You would need a plugin to do it between Posts 9 & 10 unfortunately. But it should do it for Posts 1 & 2.
Yes, which plugin might that be? I've tried MyAdvertisements and I'm not sure if it can do that.
see this reply related to MyAdvertisements plugin

see also post #5 on that topic

I prefer using template conditionals plugin.

at the bottom of postbit & postbit_classic templates, you can add code like
<if $postcounter == 1 then>
first advertisement code here
</if>

<if $postcounter == 9 then>
second advertisement code here
</if>

(above codes are for first page of the topic only)
Hello,

Here is a picture of what I'd like to achieve. It looks like a post, but says 'Sponsor' on the tcat light blue bar. Is this possible?

[Image: 2prs0tx.png]
Pages: 1 2