1
Sorry if this sounds like a silly question as I am very new to php and am struggling understanding the basics. I am running 2.2.3 and have made a very basic chat module but I need to access a custom field called user_gender under prefix_user_profile and I cant seem to work it out
I have tried a few things, hopefully this code snippet will show what I am trying to achieve.
include("../../mainfile.php");
include ($xoopsConfig['root_path']."header.php");
global $xoopsUser, $yourGender, $ProMode;
if($xoopsUser){
$thisUser = $xoopsUser->uname();
} else {
$thisUser = "Guest_null";
}
if ( file_exists("./language/".$xoopsConfig['language']."/index.php") ) {
$ircmotorlng = $xoopsConfig['language'];
} else {
$ircmotorlng = english;
}
if ($xoopsUser) {
$yourGender = $xoopsprofile->getVar("user_gender");
}
if($YourGender == male) {
$ProMode = PROFILMODE1;
} elseif ($yourGender == female) {
$ProMode = PROFILMODE2;
} else {
$ProMode = PROFILMODE0;
}
can anyone point out where I am going wrong and what I need to change to fetch user_gender as a variable for use in this page?
many thanks
FireHorse