8 require_once(CH_DIRECTORY_PATH_INC .
"membership_levels.inc.php");
9 require_once(CH_DIRECTORY_PATH_INC .
"match.inc.php");
10 require_once(CH_DIRECTORY_PATH_BASE .
'scripts/ChBaseSearchResultText.php');
17 'table' =>
'Profiles',
18 'ownFields' => array(
'ID',
'NickName',
'DescriptionMe',
'Country',
'City',
'Tags',
'DateReg',
'DateOfBirth',
'Sex',
'Couple'),
19 'searchFields' => array(
'NickName',
'FullName',
'FirstName',
'LastName',
'DescriptionMe',
'City',
'Tags'),
20 'restriction' => array(
21 'activeStatus' => array(
'value'=>
'Active',
'field'=>
'Status',
'operator'=>
'='),
23 'paginate' => array(
'perPage' => 10,
'page' => 1,
'totalNum' => 10,
'totalPages' => 1),
28 'param' =>
'enable_modrewrite',
31 'browseAll' =>
'browse.php'
34 'file' =>
'profile.php?ID={id}',
35 'browseAll' =>
'browse.php'
41 parent::__construct();
46 $GLOBALS [
'_page'][
'header'] =
_t(
'_sys_profiles_caption_browse_by_day')
47 .
': ' .
getLocaleDate( strtotime(
"{$sParamValue}-{$sParamValue1}-{$sParamValue2}")
51 $sParamValue1 = (int)$sParamValue1;
52 $sParamValue2 = (int)$sParamValue2;
53 $this->aCurrent[
'restriction'][
'calendar-min'] = array(
'value' =>
"'{$sParamValue}-{$sParamValue1}-{$sParamValue2} 00:00:00'",
'field' =>
'DateReg',
'operator' =>
'>=',
'no_quote_value' =>
true);
54 $this->aCurrent[
'restriction'][
'calendar-max'] = array(
'value' =>
"'{$sParamValue}-{$sParamValue1}-{$sParamValue2} 23:59:59'",
'field' =>
'DateReg',
'operator' =>
'<=',
'no_quote_value' =>
true);
55 $this->aCurrent[
'title'] =
$GLOBALS [
'_page'][
'header'];
63 $sOutputMode = (isset (
$_GET[
'search_result_mode']) &&
$_GET[
'search_result_mode']==
'ext') ?
'ext' :
'sim';
65 $sTemplateName = ($sOutputMode ==
'ext') ?
'search_profiles_ext.html' :
'search_profiles_sim.html';
68 if ($aData[
'Couple'] > 0) {
88 $bExtMode = (!
empty(
$_GET[
'mode']) &&
$_GET[
'mode'] ==
'extended') || (!
empty(
$_GET[
'search_result_mode']) &&
$_GET[
'search_result_mode'] ==
'ext');
89 $isShowMatchPercent = $bExtMode && $iVisitorID && ( $iVisitorID !=
$aProfileInfo[
'ID'] ) &&
getParam(
'view_match_percent') &&
getParam(
'enable_match');
93 $oPrivacy =
new ChWsbPrivacy(
'sys_page_compose_privacy',
'id',
'user_id');
95 $iBlockID =
$GLOBALS[
'MySQL']->getOne(
"SELECT `ID` FROM `sys_page_compose` WHERE `Page` = 'profile' AND `Func` = 'Description' AND `Column` != 0");
96 $iPrivacyId = (int)
$GLOBALS[
'MySQL']->getOne(
"SELECT `id` FROM `sys_page_compose_privacy` WHERE `user_id`='{$aProfileInfo['ID']}' AND `block_id`='{$iBlockID}' LIMIT 1");
97 $bPublic = !$iBlockID || !$iPrivacyId || $oPrivacy->check(
'view_block', $iPrivacyId, $iVisitorID);
101 $sProfileMatch = $isShowMatchPercent ?
$GLOBALS[
'oFunctions']->getProfileMatch( $iVisitorID,
$aProfileInfo[
'ID'] ) :
'';
106 $sProfileZodiac = ($bPublic && $bExtMode &&
getParam(
'zodiac')) ?
$GLOBALS[
'oFunctions']->getProfileZodiac(
$aProfileInfo[
'DateOfBirth']) :
'';
108 $sProfile2ASc1 = $sProfile2ASc2 = $sProfile2Nick = $sProfile2Desc = $sProfile2Info = $sProfile2Zodiac =
'';
112 $sProfile2Info =
$GLOBALS[
'oFunctions']->getUserInfo($aCoupleInfo[
'ID']);
113 $sProfile2Desc = $bPublic ?
strmaxtextlen($aCoupleInfo[
'DescriptionMe'], 130) :
_t(
'_sys_profile_private_text_title');
114 $sProfile2Zodiac = ($bPublic && $bExtMode &&
getParam(
'zodiac')) ?
$GLOBALS[
'oFunctions']->getProfileZodiac($aCoupleInfo[
'DateOfBirth']) :
'';
116 $sProfile2ASc1 =
'float:left;width:31%;margin-right:10px;';
117 $sProfile2ASc2 =
'float:left;width:31%;display:block;';
120 $sProfile2ASc2 =
'display:none;';
124 'thumbnail' => $sProfileThumb,
125 'match' => $sProfileMatch,
127 'nick' => $sProfileNickname,
128 'info' => $sProfileInfo,
129 'i_am_desc' => $sProfileDesc,
130 'zodiac_sign' => $sProfileZodiac,
132 'nick2' => $sProfile2Nick,
133 'info2' => $sProfile2Info,
134 'i_am_desc2' => $sProfile2Desc,
135 'zodiac_sign2' => $sProfile2Zodiac,
137 'add_style_c1' => $sProfile2ASc1,
138 'add_style_c2' => $sProfile2ASc2,
141 if ( $aExtendedKey
and is_array($aExtendedKey)
and !
empty($aExtendedKey) ) {
142 foreach($aExtendedKey
as $sKey => $sValue )
143 $aKeys[$sKey] = $sValue;
145 $aKeys[
'ext_css_class'] =
'';
148 return ($oCustomTemplate) ? $oCustomTemplate->parseHtmlByName($sTemplateName, $aKeys) :
$GLOBALS[
'oSysTemplate']->parseHtmlByName($sTemplateName, $aKeys);
154 $sClearBoth =
'<div class="clear_both"></div>';
156 if (!isset(
$_GET[
'searchMode']))
157 $sCode =
'<div id="page_block_'.$this->id.
'">'.
$sCode.$sClearBoth.
'</div>';
170 $sWhere = parent::getRestriction ();
171 $sWhere .=
" AND (`Profiles`.`Couple` = 0 OR `Profiles`.`Couple` > `Profiles`.`ID`) ";