Hello,
How can I get users Country in PHP block on Profile page.
Thanks,
|
Hello,
How can I get users Country in PHP block on Profile page.
Thanks,
I am assuming you want the country of the member whos profile is being viewed and not the logged in members country.
$profileID = getID($_GET['ID']); $aUserData = getProfileInfo($profileID); $sCountry = $aUserData['Country']; echo $sCountry;
https://www.deanbassett.com |
And if you want the full country name instead of the two letter country code then use this instead.
$profileID = getID($_GET['ID']); $aUserData = getProfileInfo($profileID); $sCountry = $aUserData['Country']; $sFullCountryName = _t(db_value("SELECT `LKey` FROM `sys_pre_values` WHERE `Key`='Country' AND `Value`='$sCountry'")); echo $sFullCountryName; https://www.deanbassett.com |
|
And if you want the full country name instead of the two letter country code then use this instead.
$profileID = getID($_GET['ID']); $aUserData = getProfileInfo($profileID); $sCountry = $aUserData['Country']; $sFullCountryName = _t(db_value("SELECT `LKey` FROM `sys_pre_values` WHERE `Key`='Country' AND `Value`='$sCountry'")); echo $sFullCountryName;
Hi, deano92964. Can you please tell how to make a NickName?
|
Nickname is even easier.
You could use this.
$profileID = getID($_GET['ID']); $aUserData = getProfileInfo($profileID); $sNickName= $aUserData['NickName']; echo $sNickName;
But dolphin already has a function built in for that.
For dolphin 7.1 it's just one line of code for the nickname.
echo getUsername();
https://www.deanbassett.com |
|