Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

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.

igolfniray
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Multiple Lines of code not working...

And how would I get these two bits of code to work together:

Code:



if ( $core_genius->check("pagetype not = frontpage" ) ) return 100;

if ( $content_genius->check("category_id not = 46") ) return 100;

igolfniray
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

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.

igolfniray
Beginner Modder
ranks
useravatar
Offline
16 Posts
Administrator has disabled public posting

Re: Multiple Lines of code not working...

Thanks Ray smile

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3313 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1679
Total Polls:
6
Total Posts:
5913
Dormant:
User Info:
 
Total Users:
10778
Newest User:
negina4qx
Members Online:
0
Guests Online:
154

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