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.

 

2 different PHP Request for same Module

2 different PHP Request for same Module

hello Stephen,

hope you can help me with my problem:

i try to add 2 different code in PHP field for the same Module but it does not work. i have add the following:

Code:

if (

$option == 'com_easyblog'
and $view == 'dashboard'
and $Itemid == '156'
and $jinput->get('layout') == 'write'
and $jinput->get('lang') == 'de'
) return;
else return 517;

if (
$option == 'com_easyblog'
and $view == 'entry'
and $Itemid == '156'
and $jinput->get('lang') == 'de'
) return;
else return 517;

testcouch
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: 2 different PHP Request for same Module

Hi testcouch,

can you tell me what you want to happen? Is it that you want to return NOTHING if either the dashboard OR the entry page are shown, but module 517 otherwise?

If so, you could do this:

// test the 1st condition, and bail out if found:
if (
$option == 'com_easyblog'
and $view == 'dashboard'
and $Itemid == '156'
and $jinput->get('layout') == 'write'
and $jinput->get('lang') == 'de'
) return;

// test the 2nd condition, and bail out if found:
if (
$option == 'com_easyblog'
and $view == 'entry'
and $Itemid == '156'
and $jinput->get('lang') == 'de'
) return;

// if it was not one of the previous conditions, then show the module:
return 517;


Hope that helps,
Stephen

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
3329 Posts
User info in posts
Administrator has disabled public posting

Re: 2 different PHP Request for same Module

hi Stephen, many thanks, your code working perfect!

testcouch
Beginner Modder
ranks
useravatar
Offline
13 Posts
Administrator has disabled public posting

Re: 2 different PHP Request for same Module

Wonderful, thanks for your feedback. I'm glad it's working for you.

Best regards,
Stephen

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
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1684
Total Polls:
6
Total Posts:
5940
Posts this week:
1
User Info:
 
Total Users:
5174
Newest User:
frashaomran
Members Online:
0
Guests Online:
157

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