MyBB Community Forums

Full Version: Add div on first post only
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

Do you know if is it possible add a div (html o php code o adsense for example) on a first post of every thread?

Thanks a lot for your support
If you need to use php tag in your template, you need PHP in Templates / Complex Templates plugin:

http://mybbhacks.zingaburga.com/showthread.php?tid=260
(2010-03-14, 06:54 PM)RateU Wrote: [ -> ]If you need to use php tag in your template, you need PHP in Templates / Complex Templates plugin:

http://mybbhacks.zingaburga.com/showthread.php?tid=260

Your plugin give me an error.

Anyway I don't want use PHP on template. I just want add a div on first post of every threads
Get the templates conditionals plugin here: http://community.mybboard.net/thread-31860.html

Use an if conditional, and do something like this in the template:

<if $post['replyto'] == 0 then>ad goes here</if>
(2010-03-15, 03:38 AM)Jammerx2 Wrote: [ -> ]Get the templates conditionals plugin here: http://community.mybboard.net/thread-31860.html

Use an if conditional, and do something like this in the template:

<if $post['replyto'] == 0 then>ad goes here</if>

It works. But there are some problems with merge threads. When I merge two thread will be showed two ads...
Then do <if $post['pid'] == $thread['firstpost'] then>ad goes here</if>

Try that and tell me if it works.
(2010-03-15, 07:27 PM)Jammerx2 Wrote: [ -> ]Then do <if $post['pid'] == $thread['firstpost'] then>ad goes here</if>

Try that and tell me if it works.

It works

Thanks a lot!!
(2010-03-15, 07:39 PM)gokufg Wrote: [ -> ]
(2010-03-15, 07:27 PM)Jammerx2 Wrote: [ -> ]Then do <if $post['pid'] == $thread['firstpost'] then>ad goes here</if>

Try that and tell me if it works.

It works

Thanks a lot!!

just a problem: the ad shows in the pm message also. Can we esclude in that page?

Thanks a lot!!
(2010-03-15, 07:39 PM)gokufg Wrote: [ -> ]just a problem: the ad shows in the pm message also. Can we esclude in that page?

Thanks a lot!!

I'd like show it just for guest user (not member). Is it possible?
I will look into the pm when I get time, kinda busy now.

<if $mybb->user['uid'] == "">ad goes here</if>

Add that in between the other if statement, that would be for guests.
(2010-03-19, 09:24 PM)Jammerx2 Wrote: [ -> ]I will look into the pm when I get time, kinda busy now.

<if $mybb->user['uid'] == "">ad goes here</if>

Add that in between the other if statement, that would be for guests.

Thanks a lot
the correct code is:

<if $mybb->user['uid'] == "" then>ad goes here</if>

Wink
Anyway I would like insert this ads in the first post of every page of a thread. For example if a thread has 3 pages, i wanna insert the ads in every first post shows on pages.

Is it possibile?

Thanks a lot for your support
Isn't there plugins for this?

And I am busy right now, will look into it later if I have a chance.
Pages: 1 2