8 require_once( CH_DIRECTORY_PATH_BASE .
'scripts/ChBaseProfileGenerator.php' );
10 define(
'CH_BLOCK_GENERALINFO', 17);
11 define(
'CH_BLOCK_ADDITIONALINFO', 20);
20 $this->_iViewerId = $iViewerId;
25 $oPrivacy =
new ChWsbPrivacy(
'sys_page_compose_privacy',
'id',
'user_id');
27 $r =
db_res (
"SELECT `pc`.`Caption`, `pc`.`Content`, `pc`.`Func`, `pc`.`ID` AS `BlockID`
28 FROM `sys_profile_fields` AS `pf`
29 INNER JOIN `sys_page_compose` AS `pc`
30 ON ((`pc`.`Func` = 'PFBlock' AND `pc`.`Content` = `pf`.`ID`) OR (`pc`.`Func` = 'GeneralInfo' AND " .
CH_BLOCK_GENERALINFO .
" = `pf`.`ID`) OR (`pc`.`Func` = 'AdditionalInfo' AND " .
CH_BLOCK_ADDITIONALINFO .
" = `pf`.`ID`))
31 WHERE `pc`.`Page` = 'profile_info' AND `pf`.`Type` = 'block' AND `pc`.`Column` != 0
32 ORDER BY `pc`.`Column`, `pc`.`Order`");
33 while ($a = $r->fetch()) {
34 $iPrivacyId = (int)
$GLOBALS[
'MySQL']->getOne(
"SELECT `id` FROM `sys_page_compose_privacy` WHERE `user_id`='" . $this->_iProfileID .
"' AND `block_id`='" . $a[
'BlockID'] .
"' LIMIT 1");
35 if ($iPrivacyId != 0 && !$oPrivacy->check(
'view_block', $iPrivacyId, $this->_iViewerId))
41 default: $i = $a[
'Content'];
44 if (
false === $aBlock)
continue;
48 if ($this->_iViewerId == $this->_iProfileID) {
53 'Value1' =>
new xmlrpcval ($this->_aProfile[
'Email']),
65 'Value1' =>
new xmlrpcval (
_t(
'__' . $this->_aProfile[
'Status'])),
69 'Info' =>
new xmlrpcval ($aOwnInfo,
"array"),
83 if( !isset( $this->aPFBlocks[$iBlockID] )
or empty( $this->aPFBlocks[$iBlockID][
'Items'] ) )
86 $aItems = $this->aPFBlocks[$iBlockID][
'Items'];
89 foreach( $aItems
as $aItem ) {
91 $sValue1 = htmlspecialchars_decode($this->oPF->getViewableValue($aItem, $this->_aProfile[$aItem[
'Name']]), ENT_COMPAT);
93 if ($aItem[
'Name'] ==
'Age')
94 $sValue1 = (isset($this->_aProfile[
'DateOfBirth'])) ?
age($this->_aProfile[
'DateOfBirth']) :
_t(
"_uknown");
101 $aStruct[
'Caption'] =
new xmlrpcval (strip_tags(
_t($aItem[
'Caption'])));
102 $aStruct[
'Type'] =
new xmlrpcval ($aItem[
'Type']);
103 $aStruct[
'Value1'] =
new xmlrpcval (strip_tags($sValue1));
105 if ($this->bCouple) {
106 if (!in_array( $aItem[
'Name'], $this->aCoupleMutualItems)) {
107 $sValue2 = htmlspecialchars_decode($this->oPF->getViewableValue($aItem, $this->_aCouple[$aItem[
'Name']]), ENT_COMPAT);
108 if ($aItem[
'Name'] ==
'Age')
109 $sValue2 = (isset($this->_aCouple[
'DateOfBirth'])) ?
age($this->_aCouple[
'DateOfBirth']) :
_t(
"_uknown");
110 $aStruct[
'Value2'] =
new xmlrpcval (strip_tags($sValue2));
114 $aRet[] =
new xmlrpcval ($aStruct,
"struct");
118 'Info' =>
new xmlrpcval ($aRet,
"array"),