Jump to content
DevFuse Forums

Display ad codes problem


andhrawatch

Recommended Posts

I am using hooks to show ads on my forum but hooks are only for Board Index.

 

I just want to display vertical ads 160X600 on all pages except board index (as i am using hooks for board index)...please let me know if anybody come across it...

 

also please let me know if you have come across any mods....

 

thanks in advance

Link to comment
Share on other sites

  • Management

I'm not aware of a mod but you can do this with a template edit.

 

Open Admin CP > Look & Feel Tab > select skin > Global Templates > globalTemplate

 

Find:

   		 	{$items['adHeaderCode']}
  			 <if test="mainpageContent:|:$html">{$html}</if>
  			 {$items['adFooterCode']}

 

Replace With:

<div class='ipsLayout ipsLayout_withright ipsLayout_largeright clearfix'>
 	<div class='ipsLayout_content clearfix'>
  			 {$items['adHeaderCode']}
  			 <if test="mainpageContent:|:$html">{$html}</if>
  			 {$items['adFooterCode']}
 	</div>
 	<div class='ipsLayout_right'>
  	{ad code here}
 	</div>
</div>

 

Save. Will add a sidebar to all pages similar to the sidebar for an ad.

Link to comment
Share on other sites

thanks a lot .... its working...

 

 

can you let me know how to display it only on the pages i need.... because on the board index i am using hooks...and i want to display it only on message view page and topics list page...

 

and also how to resize the width of the side bar...

 

thanks a lot for your help... :)

Link to comment
Share on other sites

  • Management

Try this instead. Uses a different style that should be smaller in width.

 

<if test="showOnTopic:|:ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'topics'">
<div class='ipsLayout ipsLayout_withright ipsLayout_smallright clearfix'>
   	<div class='ipsLayout_content clearfix'>
                    	{$items['adHeaderCode']}
                    	<if test="mainpageContent:|:$html">{$html}</if>
                    	{$items['adFooterCode']}
   	</div>
   	<div class='ipsLayout_right'>
   	{ad code here}
   	</div>
</div>
<else />
                    	{$items['adHeaderCode']}
                    	<if test="mainpageContent:|:$html">{$html}</if>
                    	{$items['adFooterCode']}
</if>

Link to comment
Share on other sites

  • Management

Sure, replace the top line with this instead.

 

<if test="showOnTopic:|:( ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'topics' ) OR (  ipsRegistry::$current_application == 'members' AND ipsRegistry::$current_module == 'messaging' AND ipsRegistry::$current_section == 'view' )">

Link to comment
Share on other sites

  • 2 weeks later...
  • Management

<if test="showOnTopic:|:( ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'topics' ) OR (  ipsRegistry::$current_application == 'members' AND ipsRegistry::$current_module == 'messaging' AND ipsRegistry::$current_section == 'view' ) OR (  ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'post' AND ipsRegistry::$current_section == 'post' AND $this->request['do'] == 'reply_post' )">

 

Try this code, replacing the top line as before.

Link to comment
Share on other sites

  • 4 weeks later...
  • Management
<if test="showOnTopic:|:( ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'topics' AND $this->request['f'] == '15' ) OR (  ipsRegistry::$current_application == 'members' AND ipsRegistry::$current_module == 'messaging' AND ipsRegistry::$current_section == 'view' ) OR (  ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'post' AND ipsRegistry::$current_section == 'post' AND $this->request['do'] == 'reply_post' )">

Link to comment
Share on other sites

  • 2 weeks later...
  • Management

Try this.

 

<if test="showOnTopic:|:( ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'forums' AND $this->request['f'] == '15' ) OR ( ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'topics' ) OR (  ipsRegistry::$current_application == 'members' AND ipsRegistry::$current_module == 'messaging' AND ipsRegistry::$current_section == 'view' ) OR (  ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'post' AND ipsRegistry::$current_section == 'post' AND $this->request['do'] == 'reply_post' )">

Link to comment
Share on other sites

  • 2 weeks later...
  • 6 months later...
  • 1 year later...

Hai,

 

I am using IPB Version 3.4.5. After replacing with the Following code, I am getting an Error that the PHP code you are Inserted is not coded properly. Code it correctly and then save..---Something like this,, I am getting an error.

<if test="showOnTopic:|<img src='http://www.devfuse.com/forums/public/style_emoticons/<#EMO_DIR#>/sad.gif' class='bbc_emoticon' alt=':(' /> ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'forums' AND ipsRegistry::$current_section == 'topics' ) OR (  ipsRegistry::$current_application == 'members' AND ipsRegistry::$current_module == 'messaging' AND ipsRegistry::$current_section == 'view' ) OR (  ipsRegistry::$current_application == 'forums' AND ipsRegistry::$current_module == 'post' AND ipsRegistry::$current_section == 'post' AND $this->request['do'] == 'reply_post' )">

Please tell me , How to solve this problem. Thank you.. & Waiting for your reply :)

Link to comment
Share on other sites

  • 2 years later...

I'm not aware of a mod but you can do this with a template edit.

 

Open Admin CP > Look & Feel Tab > select skin > Global Templates > globalTemplate

 

Find:

{$items['adHeaderCode']}
   			 <if test="mainpageContent:|:$html">{$html}</if>
   			 {$items['adFooterCode']}
Replace With:

<div class='ipsLayout ipsLayout_withright ipsLayout_largeright clearfix'>
  	<div class='ipsLayout_content clearfix'>
   			 {$items['adHeaderCode']}
   			 <if test="mainpageContent:|:$html">{$html}</if>
   			 {$items['adFooterCode']}
  	</div>
  	<div class='ipsLayout_right'>
   	{ad code here}
  	</div>
</div>
Save. Will add a sidebar to all pages similar to the sidebar for an ad.

 

Thanks admin :) 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...