problem with firstname and lastname !!!

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
vireden

problem with firstname and lastname !!!

Post by vireden »

hello,

i use feu and custom content but i dont know how use firstname and lastname with uusername -->{username}

i give my program:
----------------------------------------------
global $gCms;
$feusers =& $gCms->modules['FrontEndUsers']['object'];
$userid = $feusers->LoggedInName();
$pass = $feusers->GetUserProperty($userid);

echo "a$userid
";
echo "b$feusers
";
echo "c$pass
";

$prenom = $name;

      $user="root";
      $host="Localhost";
      $password="";
      $database="cms";
             
      $connexion = mysql_connect($host, $user, $password) or die ("Connect impossible");
      $db = mysql_select_db($database, $connexion) or die ("database impossible");

      $rq = "SELECT first_name FROM cms_users WHERE username= '$userid'";
      $result = mysql_query($rq) or die ("Request impossible");
 
echo "hello $result";

-------------------------------------------------------

For echo "a$userid
"; --> it is good but,
For echo "hello $result"; --> it is bad (Hello resource id #258)

do you help me to find a answer? thanks.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm

Re: problem with firstname and lastname !!!

Post by calguy1000 »

The way to interact with the FrontEndUsers module is via the api, as described in FrontEndUsers.api.php

Try this:

Code: Select all

global $gCms;
$feusers = $gCms->modules['FrontEndUsers']['object'];
if( $feusers )
  {
      $uid = $feusers->LoggedInId();
      $properties = $feusers->GetUserProperties($uid);
      print_r( $properties );
  }
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.
Locked

Return to “CMSMS Core”