Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.
- Index
- » MetaMod
- » MetaMod General Support
- » Multiple Lines of code not working...
Multiple Lines of code not working...
Multiple Lines of code not working...
Joomla 1.5.23
Metamod 2.8c
Site URL: http://www.belfastliving.com
This is the code I'm trying to get working:
Code:
if ( ! (
$option == 'com_contact'
and $view == 'contact'
and $id == '2'
and JRequest::getVar('lang') == 'en'
) ) return 100;
if ( ! (
$option == 'com_content'
and $view == 'article'
and $id == '74'
and JRequest::getVar('lang') == 'en'
) ) return 100;
if ( ! (
$option == 'com_content'
and $view == 'article'
and $id == '75'
and JRequest::getVar('lang') == 'en'
) ) return 100;
if ( ! (
$option == 'com_content'
and $view == 'article'
and $id == '84'
and JRequest::getVar('lang') == 'en'
) ) return 100;
if ( ! (
$option == 'com_content'
and $view == 'article'
and $id == '66'
and JRequest::getVar('lang') == 'en'
) ) return 100;
if ( ! (
$option == 'com_content'
and $view == 'article'
and $id == '67'
and JRequest::getVar('lang') == 'en'
) ) return 100;
if ( ! (
$option == 'com_content'
and $view == 'article'
and $id == '71'
and JRequest::getVar('lang') == 'en'
) ) return 100;
I got these commands with the advanced debug mode as described in this article: http://www.metamodpro.com/metamod/page-identification
Each individual line of code works great on it's own but when I have the list as it is, none of the code works.
What I'm trying to do is hide my ad modules on my privacy policy, contact us and disclaimer (etc) pages.
I have all those articles in one section so I tried this code:
Code:
if ( $content_genius->check("category_id not = 45") ) return 100;
but it won't work alongside:
Code:
if ( ! (
$option == 'com_contact'
and $view == 'contact'
and $id == '2'
and JRequest::getVar('lang') == 'en'
) ) return 100;
Which is my Contact Us page and therefore not an Article.
How do I get multiple lines of code to work in Metamod?
Thanks al lot for your help in advance!
Ray.
Re: Multiple Lines of code not working...
Sorry!
I got it working! I'm such a dunce!
the 'return XXX' line works like a 'full stop' (or period) for the code. For any other newbies who may be interested in how I got it working: this is the code I used:
Code:
if ( $content_genius->check("category_id not = ZZZ") )
if ( ! (
$option == 'com_contact'
and $view == 'contact'
and $id == 'YYY'
) ) return XXX;
Replace ZZZ with the Category ID, YYY with your Contact form ID the XXX with your banner module ID, and the Ad module won't show on those articles or the contact form.
In doing this I've learned also how to prevent ads from showing in certain areas of Mosets Tree (as I asked in another thread), please see the other thread for more info. Or contact me if you need more advice.
Ray.
- Index
- » MetaMod
- » MetaMod General Support
- » Multiple Lines of code not working...
Board Info
- Board Stats:
- Total Topics:
- 1699
- Total Polls:
- 6
- Total Posts:
- 5967
- Total Posts Today:
- 2
- User Info:
- Total Users:
- 8028
- Newest User:
- musial8334
- Members Online:
- 0
- Guests Online:
- 236
- Online:
- There are no members online
Forum Legend:
Topic
New
Locked
Sticky
Active
New/Active
New/Locked
New Sticky
Locked/Active
Active/Sticky
Sticky/Locked
Sticky/Active/Locked