access to FEUsers variables from another module

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
numer9

access to FEUsers variables from another module

Post by numer9 »

Hey,
i want to alter the Calendar module so that I'll have the access to customcontent_loginname variables from inside of Calendar function. When I'm doing the $module dump, I see the data i want, but it's inside bunch of other arrays and stuff.

i coulndn't get to that var using $gCms['modules'] -> print_r of this gives me fatal error with malloc.

So: i'm inside a Calendar function that displays stuff for front-end, and I want to have access to {$customcontent_loginname} value (but not on the page, in the php code). Any programmers hints?
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: access to FEUsers variables from another module

Post by calguy1000 »

Selfreg does stuff like this.

it essentially does a "$feusers = $this->GetModuleInstance('FrontEndUsers');
then calls methods from the frontend users api.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
numer9

Re: access to FEUsers variables from another module

Post by numer9 »

that's exactly want i wanted to do - connect to another module like in selfReg. But it doesn't work - maybe it because of new module architecture?

i got the access by entering:

Code: Select all

	echo $module->cms->smarty->_tpl_vars[userid];
But your solution doesn't work. I got the function, similar to Calendar function "displaylist" (function.displaylist.php), that's starting with:

Code: Select all

function AddEventWorker(&$module, $id, &$parameters, $returnid)
{
	global $gCms;

//	print_r ($module->cms->smarty->_tpl_vars);
	echo $module->cms->smarty->_tpl_vars[userid]; // it works, but doesn't look nice
	
	$feusers = $module->cms->GetModuleInstance('FrontEndUsers'); // doesn't work, causes fatal error
        $feusers = $gCms->GetModuleInstance('FrontEndUsers');  // doesn't work, causes fatal error
}
am I missing something?
       
Locked

Return to “CMSMS Core”