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.

 

Sorry, again Parse error: syntax error, unexpected T_STRING...

Sorry, again Parse error: syntax error, unexpected T_STRING...

Hello,
I am very sorry to bother everyone with the error posted hundreds of times, but unfortunately search did not help me.

These are my settings for showing a module to regular Registered group only, and hide it from Author group:
Style for included modules: Horizontal
if ( $user->Registered ) return 55;
And i am getting the typical error:

Code:

Parse error: syntax error, unexpected T_STRING in /home/gppdnet/public_html/modules/mod_metamod/helper.php(539) : eval()'d code on line 1

And one more thing, if i understood it right, in order to have module visible to a certain user group only, and to hide it from all other groups, i have to first disable that module, and then bring it on using MetaMod.
Is that correct?
Thank you.
Regards

Azmandius
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Sorry, again Parse error: syntax error, unexpected T_STRING...

Hi Azmandius,

It's simply because $user->Registered is not a valid PHP variable.

You could do it this way instead:

if ( $user->usertype == "Registered" ) return 55;

or:

if ( MM_USER_REGISTERED ) return 55;

You can read about the different group constants at the bottom of this page: http://www.metamodpro.com/metamod/configuration

Your second question about hiding the module from certain groups: Yes, you need to disable the module first, then bring it on just for certain groups with MetaMod.

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: Sorry, again Parse error: syntax error, unexpected T_STRING...

Thank you.
No parse error anymore.
Yet, i now get Error loading Modules: error.

Here is the debug info:

Code:

MetaMod

Page Identification
The PHP code below may be used to help MetaMod to identify the exact page that you are viewing. For help using this feature, please click here.
if (
$option == 'com_content'
and $view == 'frontpage'
and $Itemid == '1'
and JRequest::getVar('limit') == 9 /*!*/
and JRequest::getVar('layout') == 'default' /*!*/
) return XXX; /* replace XXX with the module ID or position to display */
Note: lines starting with "and" and ending with /*!*/ contain rules that may be optional. You may wish to leave them out.
MetaMod debug info:
Module ID: 53
$option: com_content
$view: frontpage
$id:
$Itemid: 1
$timezone: default
$language: en-gb
$language_code: en
$language_region: gb
Including modules: 55

Here are MetaMod settings:
http://www.principiuldivin.md/portal/media/fisiere/files_tehnic/Global%20Partnerships%20Portal%20For%20Peace%20And%20Development%20-%20Administration_1286786627910.png

And here are settings of the module i am trying to load:
http://www.principiuldivin.md/portal/media/fisiere/files_tehnic/Global%20Partnerships%20Portal%20For%20Peace%20And%20Development%20-%20Administration_1286786683045.png

Still have hope to be able hide that module from Author group users smile

Azmandius
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Sorry, again Parse error: syntax error, unexpected T_STRING...

HI Azmandius,

thanks for including the screenshots. The problem was that in the MetaMod you have set "Auto-enable included modules" to Off. Therefore MetaMod wasn't able to enable the target module (which is unpublished).

All you need to do is set "Auto-enable included modules" to All.

Sorry for the hassle... it really is quite easy, but some of the settings are quite crucial.

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

Re: Sorry, again Parse error: syntax error, unexpected T_STRING...

Thank you very much!
That saved me.
Regards!

Azmandius
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Re: Sorry, again Parse error: syntax error, unexpected T_STRING...

Hello again,
I would need just a bit more help.
There is a module that i want to show only to: Not Registered/Not Logged In and Registered/Logged In, but hide it from other higher level groups.
Now i know how to properly setup a rule for one group, but how do i setup a rule for 2 or more groups type?
Thank you.

Edit: Found the recipes section! Its all there! Solved!
Regards.

Edited By: Azmandius
12-Oct-10 14:10:33

Azmandius
Beginner Modder
ranks
useravatar
Offline
4 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1698
Total Polls:
6
Total Posts:
5944
Posts this week:
4
User Info:
 
Total Users:
5543
Newest User:
aj88
Members Online:
0
Guests Online:
112

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