PHP profile code

Hello, when I try to pull some infor from profile DB, to show on a page, I have several issues. So normally I woud use this code to display users height:

<div">'.$aProfileInfo['Height'].' </div>

But in Database, the members height parameters are shown as 1,2,3,4,5,or 6. Obviously I dont want those numbers shown for height, but the data they represent, such as the users real height..

Any help will be appreciated, thanks

Quote · 22 May 2011

anyone

Quote · 23 May 2011

You would have to look that up in the database yourself. That value stored in the profiles table for height is located in the table sys_pre_values so you will have to find it.

Something like this should work.

$iHeight = (int)$aProfileInfo['Height'];
$oDb = new BxDolDb();
$sQuery = "SELECT `LKey` FROM `sys_pre_values` WHERE `Key` = 'Height' AND `Value` = '$iHeight'";
$sHeight = _t($oDb->getOne($sQuery));
echo $sHeight;

https://www.deanbassett.com
Quote · 23 May 2011

Thanks for reply, but doesent work, give blank result, or invisible result, no erors, just no data is being echoed.

I currently have this code in my profiles.php file:

<?= _t($aPreValues['ProfileType'][$p_arr['ProfileType']]['LKey']) ?>

It shows the users profile type in admin..

I tried copying same code to BxBaseProfileview.php, and replaced Profile Type values, with Height, and Weight, to copy PreValue values and display users Height and Weight on a custom php block, and it doesent work

 

Quote · 23 May 2011

You will need to provide more info.

Things like aPreValues and aProfileInfo are not defined and available everywhere in dolphin. So information on exactly what you're trying to do and where your trying to do it is needed so a developer can write code for testing.

Your showing me this <?= _t($aPreValues['ProfileType'][$p_arr['ProfileType']]['LKey']) ?> which of course looks nothing like the code i provided and also has an array aPreValues which may not be loaded in the section of dolphin your tring to use it in.

My code relies on aProfileInfo array which also may not be available in the location your trying to use it in.

So more detailed specifics of what you're trying to do and where will be needed.




https://www.deanbassett.com
Quote · 23 May 2011

Ok here is my current code, located in BxProfileView.php

function getBlockCode_CustomGeneralInfoBox() {

$aProfileInfo = getProfileInfo($this -> oProfileGen -> _iProfileID);
return '<div class="disignBoxFirst"> <div class="boxFirstHeader"> <div class="dbTitle">'.$aProfileInfo['NickName'].'</div>
<div class="boxContent"> <div class="DescriptionMe">'.$aProfileInfo['DescriptionMe'].' </div> </div>
<div class="boxContent">

<div class="Relationship">'.$aProfileInfo['RelationshipStatus'].'</div>
<div class="Relationship">'.$aProfileInfo['Height'].'</div>

</div> </div> ';

}

The code works great, shows general info , in a php block, with custom design. Only part I'm not able to show is the Height, and Weight, and any values stored in PreValue table
they just display as random numbers

Thanks for your help..

Quote · 24 May 2011
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.