Status
Not open for further replies.

ItsmYarD

Banned
Banned
1,275
2009
100
0
Hello,

I wanted to place ads in my board but only in the first post (below all the content) and only in certain sections?

Anyone know how to get this done?

Would be grateful if someone could help.
 
13 comments
In the admin panel System Settings > System > Ad Code Integration

topic view - Code to display after first post

You will have to edit the template topic view > post to check for forums.

find:
Code:
		<if test="adCodeCheck:|:$post['post']['_adCode']">
			{$post['post']['_adCode']}
		</if>
change to:
Code:
		<if test="adCodeCheck:|:$post['post']['_adCode']&&in_array( $this->request['f'],array(1,12,15) )">">
			{$post['post']['_adCode']}
		</if>

he 1,12,15 are the forum numbers you want ads displayed in.
 
Last edited:
Thanks so much for the help, I just realised my affiliate actually requires me to have a variable.


2. http://***/torrent.php*****YOU_REFF&s=NAME_FILE&f=NAME_FILE - everywhere where these links

a. Replace in HTML code YOU_REFF with the name of your site without www.

b. Replace in HTML code NAME_FILE with a variable which is responsible for a name of file


That's from the email from the affiliate. How do I go about that?
 
In the admin panel System Settings > System > Ad Code Integration

topic view - Code to display after first post

You will have to edit the template topic view > post to check for forums.

find:
Code:
        <if test="adCodeCheck:|:$post['post']['_adCode']">
            {$post['post']['_adCode']}
        </if>
change to:
Code:
        <if test="adCodeCheck:|:$post['post']['_adCode']&&in_array( $this->request['f'],array(1,12,15) )">">
            {$post['post']['_adCode']}
        </if>
he 1,12,15 are the forum numbers you want ads displayed in.


Nice :)

Is there any way to control after what posts to show it instead of just the 1st one? lets say i wanted to show it after the 1st post, 5th post and last post.
 
Nice :)

Is there any way to control after what posts to show it instead of just the 1st one? lets say i wanted to show it after the 1st post, 5th post and last post.
Alittle more complicated but yes.

First you have to edit file admin\applications\forums\modules_public\forums\topics.php

find around line 1795:
Code:
	$adCodeSet = true;
change to:
Code:
//	$adCodeSet = true;

next in the template change to:
Code:
 <if test="adCodeCheck:|:in_array($post['post']['post_count'],array(1,5,count($post))&&in_array( $this->request['f'],array(1,12,15) ) ">
            {$post['post']['_adCode']}
        </if>
 
The one in the ad code to grab the topic title:

TSCPJB.png
 
The code will not work from the ad box in the admin panel but will work from the emplate post.
Code:
 <if test="adCodeCheck:|:in_array($post['post']['post_count'],array(1,5,count($post))&&in_array( $this->request['f'],array(1,12,15) ) ">
             http://***/torrent.php*****YOU_REFF&s={$topic['title']}&f={$topic['title']}
        </if>

Be sure to leave something in the ad box in admin panel.
like this :
Code:
 <!-- where code should have went -->
 
Status
Not open for further replies.
Back
Top