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.

 

Metamod basic recipe problem

Metamod basic recipe problem

Hi, congratulations for the plugin
I am using free Metamod in a Rocketheme Template Gantry T3, joomla 2.5 and Jomsocial 2.6.2 version
I need my menu (item 376)link to trigger my module menu according to my user's jobboard usetype (employer or jobseeker). My recipe is :
"if (
$option == 'com_jajobboard'
and $Itemid == '376'
and MM_JBEMPLOYER_USER
) return 281;
else if (
$option == 'com_jajobboard'
and $Itemid == '376'
and MM_JBJOB_SEEKER_USER
) return 282;


Although recognizes good the first parameter, "else if" seems not to work for jobseeker users, so the module is not trigger

What am i doing wrong? I have tested almost all recipe compinations!
Thank you in advance!

filaretos
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Metamod basic recipe problem

Hi filaretos,

Can I ask, where are you getting the MM_JBEMPLOYER_USER and MM_JBJOB_SEEKER_USER constants from? Are you 100% sure that the job board extension is setting these to true or false depending on the usertype?

I suspect that what's happening is that these are NOT being set, and PHP is interpreting MM_JBEMPLOYER_USER and MM_JBJOB_SEEKER_USER as the strings "MM_JBEMPLOYER_USER" and "MM_JBJOB_SEEKER_USER" isntead of true and false. Therefore, the code above will ALWAYS trigger the 1st condition if the $option and $Itemid are correct.

Looks to me like you might need to do a little more exploring to see how to detect if the user is an employer or jobseeker, then modify the PHP accordingly.

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: Metamod basic recipe problem

First of all Stephen thank you for your response.
Well, i am getting these parameters for the php file that jobboard guys use to trigger their menu module that works fine. They have these strings:
if( $usertype == JBEMPLOYER_USER ) {
        $jbmenutype     = 'employer-menus';
        $module->title     = JText::_('EMPLOYER_MENU');
    }
    elseif( $usertype == JBJOB_SEEKER_USER ){
        $jbmenutype     = 'job-seeker-menus';
        $module->title     = JText::_('JOB_SEEKER_MENU');
    }

Now i am using this string at the metamod module:
if (
$option == 'com_jajobboard'
and MM_JBEMPLOYER_USER
)return 281; else return 282;

Always works only the return 281 function not the else return function 282.
Even though i am changing the MM_JBEMPLOYER_USER to MM_JBJOB_SEEKER_USER is still working (showing the job seeker module menu assigned)but never trigger the 282 module position. That means that although i am getting the correct constants but "else return" function seems not to work properly.
I have spend many of hours to try any possible combination to make it trigger but nothing happens...

filaretos
Beginner Modder
ranks
useravatar
Offline
2 Posts
Administrator has disabled public posting

Re: Metamod basic recipe problem

Hi filaretos,

in their code they say "if ($usertype == JBEMPLOYER_USER)"...

but that is NOT the same as:

if (JBEMPLOYER_USER)...

JBEMPLOYER_USER and JBJOB_SEEKER_USER are obviously both constants, perhaps with values 1 and 2 (or other arbitrary numbers). So when you say "if (JBJOB_SEEKER_USER)" then as long as the constant has a non-zero value then the condition will be true.

So you need to find out some more from the jobboard code, about what the $usertype value is, and where it came from. I am guessing that there is some database code behind that, that looks up the user type from one of the jobboard database tables.

I don't have a copy of jobboard - sorry I can't help you find that.

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

Board Info

Board Stats:
 
Total Topics:
1696
Total Polls:
6
Total Posts:
5941
Posts this week:
7
User Info:
 
Total Users:
5418
Newest User:
outsd2
Members Online:
0
Guests Online:
88

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