Warning: The author of this contribution does not provide support for it anymore.

Advertisement Management

Frequently Asked Questions

Display advertisement only after the first topic post

This set of instructions will allow you to create an advertisement position that will display an advertisement ONLY after the first post in a topic (after the first post on the first page)

First create a new advertisement position using the advertisement management panel in the ACP.

Replace {ADS_X} in the following instructions with the position code assigned to the position you created.

Open viewtopic.php

Find:

Code: Select all

'S_TOPIC_POSTER'   => ($topic_data['topic_poster'] == $poster_id) ? true : false,


After, Add:

Code: Select all

'S_FIRST_POST'      => ($topic_data['topic_first_post_id'] == $row['post_id']) ? true : false,


Open styles/(your style)/template/viewtopic_body.html

Find:

Code: Select all

<!-- IF postrow.S_FIRST_ROW -->{ADS_5}<!-- ELSE -->{ADS_6}<!-- ENDIF -->


Replace with:

Code: Select all

<!-- IF postrow.S_FIRST_POST -->{ADS_X}<!-- ELSEIF postrow.S_FIRST_ROW -->{ADS_5}<!-- ELSE -->{ADS_6}<!-- ENDIF -->


Inspired by this post