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.

 

parse error using a recipe and metamod 2.6

parse error using a recipe and metamod 2.6

hi i am getting this error:
Parse error: syntax error, unexpected ',', expecting ')' in /home/dnbsa0/public_html/markethall/modules/mod_metamod/helper.php(539) : eval()'d code on line 7

when using this code:

Code:


$mappings = array(
  167=>161
);


$all_modules = array();
foreach ($mappings as $iid, $mid) {
  if ( $menu_genius->check( "parent_item_ids = $iid" ) ) $all_modules[] = $mid;
}

return $all_modules;

this is directly from this site. just changed the ids in the array. Joomla 1.5.22
metamod 2.6

minniemouse
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: parse error using a recipe and metamod 2.6

Oops, looks like I had a typo in the example, sorry!

The problem is this line:

foreach ($mappings as $iid, $mid) {

It should be:

foreach ($mappings as $iid => $mid) {

I need to change this in the example too...

Thanks again,
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
3312 Posts
User info in posts
Administrator has disabled public posting

Re: parse error using a recipe and metamod 2.6

hi, Thanks for the quick response!!
i fixed it and now i get no error message, but its behaving like the second recipe example and not showing me the module on the main link, but is showing it on all the sublinks.
any ideas ??
thanks again for this wonderful module, when i get it working i am going to upgrade to the PRO version :-)

minniemouse
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Re: parse error using a recipe and metamod 2.6

Hmmm, yes, looks like another problem in the example. Can you please try the following, and if it works I'll update the example code. I'm very sorry it was wrong.

$mappings = array(
  167=>161
);
$all_modules = array();
foreach ($mappings as $iid=>$mid) {
  if ( $menu_genius->check( "parent_item_ids = $iid" )
   or $Itemid == $iid ) $all_modules[] = $mid;
}
return $all_modules;


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

Re: parse error using a recipe and metamod 2.6

yes thank you!
that works perfectly!

minniemouse
Beginner Modder
ranks
useravatar
Offline
3 Posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10093
Newest User:
lamanaudio
Members Online:
0
Guests Online:
286

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