• twitter image
  • facebook image
  • youtube image
  • linkedin image
Language: CMS Made Simple Czech CMS Made Simple France CMS Made Simple Spain CMS Made Simple Hungary CMS Made Simple Russia CMS Made Simple Netherlands

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: Cannot get information from FEU Module
PostPosted: Wed Dec 05, 2012 1:37 am 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
Hello Forum,

I've been having troubles with the FEU module,

First it wasn't able to retrieve the FEU details for the Orders Module order form, but that wasn't a big issue for me.

But not I'm trying to add FEU details to the Admin Email template in the orders module using this UDT but I keep getting the error that it cannot communicate with the FEU Module.

I'm beginning to pull my hair out because I'm not sure how to fix this!

I just want the FEU details to be emailed to the Admin.

My system is as follows:
Code:
CMS Install Information
CMS Version      1.11.3

Installed Modules
CMSMailer      5.2.1
CMSPrinting      1.0.3
FileManager      1.4.2
MenuManager      1.8.4
MicroTiny      1.2.4
ModuleManager      1.5.5
News      2.12.10
Search      1.7.7
ThemeManager      1.1.7
SEOTools2      1.1.1
TinyMCE      2.9.11
CGExtensions      1.31.2
FrontEndUsers      1.21
FormBuilder      0.7.3
CGSimpleSmarty      1.5.2
JQueryTools      1.1.1
Products      2.18.4
CGEcommerceBase      1.3.11
CGPaymentGatewayBase      1.1
Orders      1.13.3
Cart      1.8.4
CustomContent      1.8.3
CGSmartImage      1.9.4


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 05, 2012 1:33 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Mon Jan 29, 2007 4:47 pm
Posts: 1107
Replace
Code:
global $gCms;
$error = "";
$result = "";
$feusers = $gCms->modules['FrontEndUsers']['object'];
with
Code:
$error = "";
$result = "";
$feusers = cms_utils::get_module('FrontEndUsers');

The UDT code is quite old and the methods deprecated... but the rest should work.

_________________
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).


CMSMS Docs | Before Asking For Help!
My developer Page on the Forge | Yet another blog about CMSMS



Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 05, 2012 8:29 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
Thanks for your reply, that fixed the error, but now I get this error from the UDT:
Code:
[UDT get_feu_properties Error; Missing or empty parameter: username]


Any ideas why?

Thanks,
Karl.


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 05, 2012 8:40 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Mon Jan 29, 2007 4:47 pm
Posts: 1107
KarlDD wrote:
Thanks for your reply, that fixed the error, but now I get this error from the UDT:
Code:
[UDT get_feu_properties Error; Missing or empty parameter: username]

check this bit from the UDT:
Code:
...
   $username = $params['username'];
   if ($username == "") {
      $error = " [UDT get_feu_properties Error; Missing or empty parameter: username] ";
....

$params['username']; is empty...

so it means you have to call the UDT with a paremeter called username
Quote:
Parameters:

username (required): the Frontend Users username.
property (optional): the name of the property value to return as the result; When not specified, the result will be the Frontend Users uid.
method (optional): when not specified, the result is simply displayed; When method="assign", the value is returned in a Smarty variable with the same name as the property.

Usage:

To display the user id (uid) of a FEU user named "Frank" use:

{get_feu_properties username="Frank"}

To display the value of the property "phone_number" of the user "Jane" use:

{get_feu_properties username="Jane" property="phone_number"}

To assign the value of the property "email_addr" of the currently logged in FEU user use:

{get_feu_properties username=$username property="email_addr" method="assign"}

In this case nothing is displayed but instead the variable "$email_addr" now contains this users' email address.

_________________
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).


CMSMS Docs | Before Asking For Help!
My developer Page on the Forge | Yet another blog about CMSMS



Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 05, 2012 10:13 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
I wanted it to get the details from the logged in user, so this is how I set it up:

Code:
{get_feu_properties username=$username property="first_name"}
{get_feu_properties username=$username property="last_name"}
{get_feu_properties username=$username property="address"}
{get_feu_properties username=$username property="phone"}
{get_feu_properties username=$username property="email"}


Is that not correct? Still have the error :/


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 05, 2012 10:20 pm 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Mon Jan 29, 2007 4:47 pm
Posts: 1107
Where does $username comes from?
Put {$username} on the template. If it comes empty or null then it's not a valid Smarty variable.
Use {get_template_vars} to check what vars are available to you on a template, on a given context.

_________________
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).


CMSMS Docs | Before Asking For Help!
My developer Page on the Forge | Yet another blog about CMSMS



Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Tue Dec 11, 2012 8:32 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
I'm unsure how to get the username from the currently logged in user, the {$username} tag works in the FrontEndUser module templates but I don't know how to get the same property to work in the UDT, I'm stuck. :/


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Tue Dec 11, 2012 8:58 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
How can I get the username info from the current logged in user into this UDT?


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Tue Dec 11, 2012 9:48 pm 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Apr 18, 2008 9:34 pm
Posts: 200
Location: Nimbin, Australia
it looks like you dont need the username for the script, as the username is later converted to an ID which is what the rest of the script uses.

try this: remove

Code:
   $username = $params['username'];
   if ($username == "") {
      $error = " [UDT get_feu_properties Error; Missing or empty parameter: username] ";
   }
   else {
      $uid = $feusers->GetUserID($username);

and replace with
Code:
$uid = $feusers->LoggedInId();


i didn't quite follow (that is read) the entire post but maybe this helps.


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Tue Dec 11, 2012 10:29 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
ok, well that returns the id of the current logged in user, but if I try display any of the user properties its returns a blank field ?


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 12, 2012 12:30 am 
Offline
Dev Team Member
Dev Team Member
User avatar

Joined: Tue Oct 19, 2004 6:44 pm
Posts: 7132
Location: Fernie British Columbia, Canada
Quote:
How can I get the username info from the current logged in user into this UDT?


Code:
$feu->LoggedInName();

_________________
Follow me on twitter
--
if you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
----------------
Don't make me angry..... you won't like me when I'm angry....


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Wed Dec 12, 2012 11:55 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
I still can't get it to display the selected category, I guess I'm jst going to have to call it quits on this one.


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Thu Dec 13, 2012 5:46 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Apr 18, 2008 9:34 pm
Posts: 200
Location: Nimbin, Australia
Assuming you applied the changes I posted before try this.
Add:
Code:
print_r($properties);

after
$properties = $feusers->GetUserProperties($uid);

If that prints ok, work on the if statement within the foreach loop.


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Thu Dec 13, 2012 9:13 pm 
Offline
Forum Members
Forum Members

Joined: Wed Jul 04, 2012 3:48 am
Posts: 15
It's jusst doing the same thing, prints "6" which is the id of the logged in user, but still no properties :/


Top
 Profile  
 
 Post subject: Re: Cannot get information from FEU Module
PostPosted: Fri Dec 14, 2012 3:11 am 
Offline
Forum Members
Forum Members
User avatar

Joined: Fri Apr 18, 2008 9:34 pm
Posts: 200
Location: Nimbin, Australia
hmm.

replace the print_r with:
Code:
echo $feusers->GetUserPropertyFull(first_name,$uid );


or, since you pass on the paramenter when calling the UDT
Code:
echo $feusers->GetUserPropertyFull($params['property'],$uid );


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: paulbaker


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Arvixe - A CMSMS Partner