PDA

View Full Version : How NOT to show ads on vbcmps home page?


XYZ500
12-29-2014, 09:30 PM
I have banner ads on the forum which I have put from admincp > advertising.

I also have a vbCMPS homepage. But I don't want these ads to show up on the home page, while I want them to show up on all other pages (like they currently are).

So how to remove these ads just from the vbCMPS homepage?

ozzy47
12-29-2014, 10:42 PM
Perhaps wrap the ad code in a conditional.

<vb:if condition="THIS_SCRIPT != 'vbcms'">
add code here
</vb:if>

Lynne
12-29-2014, 11:19 PM
I think he may be talking about the vbadvanced CMPS in which case I have no idea what THIS_SCRIPT is set to for their page. You will need to look it up on the php file.

ozzy47
12-29-2014, 11:24 PM
If he is talking about vBAdvanced, then it would be this.

<vb:if condition="THIS_SCRIPT != 'adv_index'">
add code here
</vb:if>

XYZ500
12-29-2014, 11:39 PM
If he is talking about vBAdvanced, then it would be this.

<vb:if condition="THIS_SCRIPT != 'adv_index'">
add code here
</vb:if>

Yes, I am talking about vBAdvanced CMPS.

Where should I put this code? In the advertising place where I put the banner code?

What is the meaning of this code? Does your code mean that the ads should not be displayed in adv_index?

ozzy47
12-29-2014, 11:42 PM
Yes, you wrap the code you added in the advertising with that conditional. Yes, it means the ad should not display on the vBAdvanced page.

XYZ500
04-26-2015, 09:00 AM
This successfully worked.

Now what, I want to do is display separate (different) banners on the vBAdvanced CMPS. Is that possible to do?

I put ozzy47's code in the advertising area above all the banner codes and it successfully removed the banners from the home page. Now I want to display banners on this home page which are different from other pages.

Which vBAdvanced CMPS file will I have to edit and put the banner code there for it to be displayed on the top of the home page?

ozzy47
04-26-2015, 09:14 AM
<vb:if condition="THIS_SCRIPT == 'adv_index'">
add code here
</vb:if>

Same place where you put the banner code. Then it should only show on that page.

XYZ500
04-26-2015, 09:20 AM
<vb:if condition="THIS_SCRIPT == 'adv_index'">
add code here
</vb:if>

Same place where you put the banner code. Then it should only show on that page.

Is there a difference between this code and the code you posted in post 4? It looks the same to me.
I am using the code you posted in post 4 and it did what I wanted it to i.e display banners on all pages EXCEPT the home page.

Now I want to put banners on the home page as well but different from the ones that are currently on all other pages.

For example,

When you go to mysite.com, you will see vBAdvanced CMPS home page and banner A there.

Then you go to mysite.com/forum, you will see the forum and banner B, banner C there.

This is what I want to do.

Currently there are banner B and C on mysite.com/forum and there is nothing on the home page (since I put that code of yours). But now I want to display banner A on the home page.

Do you understand what I'm trying to do?

ozzy47
04-26-2015, 09:25 AM
It is slightly different, the first one don't show the ads on the vBAdvanced page THIS_SCRIPT != 'adv_index' the second one shows the ads on the vBAdvanced page THIS_SCRIPT == 'adv_index'

XYZ500
04-26-2015, 01:04 PM
It is slightly different, the first one don't show the ads on the vBAdvanced page THIS_SCRIPT != 'adv_index' the second one shows the ads on the vBAdvanced page THIS_SCRIPT == 'adv_index'

Oh didn't notice that exclamation mark.

Tried it.

This works great.

Thanks a ton!

ozzy47
04-26-2015, 02:20 PM
Awesome stuff. :)