Cheetah
ChBaseProfileGenerator.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbProfile');
9 ch_import('ChWsbPaginate');
10 ch_import('ChWsbProfileFields');
11 ch_import('ChTemplVotingView');
12 ch_import('ChWsbCmtsProfile');
13 
15 {
16  public $oTemplConfig;
17  //var $sColumnsOrder;
18  public $oPF; // profile fields object
19  public $aPFBlocks; //profile fields blocks
21  public $bPFEditable = false;
22 
25 
26  public function __construct($ID)
27  {
28  global $site;
29 
30  $this->aMutualFriends = array();
31 
32  parent::__construct($ID, 0);
33 
34  $this->oVotingView = new ChTemplVotingView('profile', (int)$ID);
35  $this->oCmtsView = new ChWsbCmtsProfile('profile', (int)$ID);
36 
37  //$this->ID = $this->_iProfileID;
38 
39  $this->oTemplConfig = new ChTemplConfig($site);
40  //$this->sColumnsOrder = getParam( 'profile_view_cols' );
41  //INSERT INTO `sys_options` VALUES('profile_view_cols', 'thin,thick', 0, 'Profile view columns order', 'digit', '', '', NULL, '');
42 
43  if ($this->_iProfileID) {
44  $this->getProfileData();
45 
46  if ($this->_aProfile) {
47  if (isMember()) {
49  if ($iMemberId == $this->_iProfileID) {
50  $this->owner = true;
51 
52  if ($_REQUEST['editable']) {
53  $this->bPFEditable = true;
54  $iPFArea = 2; // Edit Owner
55  } else {
56  $iPFArea = isAdmin() ? 5 : 6;
57  } // View Owner
58  } else {
59  $iPFArea = isAdmin() ? 5 : 6;
60  }
61  } elseif (isModerator()) {
62  $iPFArea = 7;
63  } else {
64  $iPFArea = 8;
65  }
66 
67  $this->oPF = new ChWsbProfileFields($iPFArea);
68  if (!$this->oPF->aBlocks) {
69  return false;
70  }
71 
72  $this->aPFBlocks = $this->oPF->aBlocks;
73 
74  if ($this->bCouple) {
75  $this->aCoupleMutualItems = $this->oPF->getCoupleMutualFields();
76  }
77 
78  $this->iFriendsPerPage = (int)getParam('friends_per_page');
79  $this->FindMutualFriends($iMemberId, $_GET['page'], $_GET['per_page']);
80  } else {
81  return false;
82  }
83  } else {
84  return false;
85  }
86  }
87 
88  public function genColumns($sOldStyle = false)
89  {
90  ob_start(); ?>
91  <div id="thin_column">
92  <?php $this->showColumnBlocks(1, $sOldStyle); ?>
93  </div>
94 
95  <div id="thick_column">
96  <?php $this->showColumnBlocks(2, $sOldStyle); ?>
97  </div>
98  <?php
99 
100  return ob_get_clean();
101  }
102 
103  public function showColumnBlocks($column, $sOldStyle = false)
104  {
105  $sVisible = ($GLOBALS['logged']['member']) ? 'memb': 'non';
106 
107  $sAddSQL = ($sOldStyle == true) ? " AND `Func`='PFBlock' " : '';
108  $rBlocks = db_res("SELECT * FROM `sys_page_compose` WHERE `Page` = 'profile' AND `Column`=$column AND FIND_IN_SET( '$sVisible', `Visible` ) {$sAddSQL} ORDER BY `Order`");
109  while ($aBlock = $rBlocks ->fetch()) {
110  $func = 'showBlock' . $aBlock['Func'];
111  $this->$func($aBlock['Caption'], $aBlock['Content']);
112  }
113  }
114 
116  {
118  }
119 
120  public function showBlockPFBlock($iPageBlockID, $sCaption, $sContent, $bNoDB = false)
121  {
122  $iPFBlockID = (int)$sContent;
123 
124  $bMayEdit = ((isMember() || isAdmin()) && ($this->_iProfileID == getLoggedId()));
125 
126  $sRet = $this->getViewValuesTable($iPageBlockID, $iPFBlockID);
127 
128  if ($bNoDB) {
129  if ($bMayEdit && $sRet) {
130  return array(
131  '<div class="ch-def-bc-margin">' . $sRet . '</div>',
132  array(
133  _t('_Edit') => array(
134  //'caption' => _t('_Edit'),
135  'href' => 'pedit.php?ID=' . $this->_iProfileID,
136  'dynamicPopup' => false,
137  'active' => $this->bPFEditable,
138  ),
139  ),
140  array(),
141  '',
142  );
143  } else {
144  return empty($sRet) ? $sRet : array('<div class="ch-def-bc-margin">' . $sRet . '</div>', array(), array(), '');
145  }
146  } else {
147  echo DesignBoxContent(_t($sCaption), $sRet, 1);
148  }
149  }
150 
151  public function getViewValuesTable($iPageBlockID, $iPFBlockID)
152  {
153  if (!isset($this->aPFBlocks[$iPFBlockID]) or empty($this->aPFBlocks[$iPFBlockID]['Items'])) {
154  return '';
155  }
156 
157  // get parameters
159  $aItems = $this->aPFBlocks[$iPFBlockID]['Items'];
160 
161  // collect inputs
162  $aInputs = array();
163  $aInputsSecond = array();
164 
165  foreach ($aItems as $aItem) {
166  $sItemName = $aItem['Name'];
167  $sValue1 = $this->_aProfile[$sItemName];
168  $sValue2 = $this->_aCouple[$sItemName];
169 
170  if ($aItem['Name'] == 'Age') {
171  $sValue1 = $this->_aProfile['DateOfBirth'];
172  $sValue2 = $this->_aCouple['DateOfBirth'];
173  }
174 
175  if ($this->bPFEditable) {
176  $aParams = array(
177  'couple' => $this->bCouple,
178  'values' => array(
179  $sValue1,
180  $sValue2
181  ),
182  'profile_id' => $this->_iProfileID,
183  );
184 
185  $aInputs[] = $this->oPF->convertEditField2Input($aItem, $aParams, 0);
186 
187  if ($aItem['Type'] == 'pass') {
188  $aItem_confirm = $aItem;
189 
190  $aItem_confirm['Name'] .= '_confirm';
191  $aItem_confirm['Caption'] = '_Confirm password';
192  $aItem_confirm['Desc'] = '_Confirm password descr';
193 
194  $aInputs[] = $this->oPF->convertEditField2Input($aItem_confirm, $aParams, 0);
195 
196  if ($this->bCouple and !in_array($sItemName, $this->aCoupleMutualItems)) {
197  $aInputsSecond[] = $this->oPF->convertEditField2Input($aItem_confirm, $aInputParams, 1);
198  }
199  }
200 
201  if ($this->bCouple and !in_array($sItemName, $this->aCoupleMutualItems) and $sValue2) {
202  $aInputsSecond[] = $this->oPF->convertEditField2Input($aItem, $aParams, 1);
203  }
204  } else {
205  if ($sValue1 || $aItem['Type'] == 'bool') { //if empty, do not draw
206  $aInputs[] = array(
207  'type' => 'value',
208  'name' => $aItem['Name'],
209  'caption' => _t($aItem['Caption']),
210  'value' => $this->oPF->getViewableValue($aItem, $sValue1),
211  'wrap_text' => $aItem['Type'] == 'area',
212  );
213  }
214 
215  if ($this->bCouple and !in_array($sItemName, $this->aCoupleMutualItems) and ($sValue2 || $aItem['Type'] == 'bool')) {
216  $aInputsSecond[] = array(
217  'type' => 'value',
218  'name' => $aItem['Name'],
219  'caption' => _t($aItem['Caption']),
220  'value' => $this->oPF->getViewableValue($aItem, $sValue2),
221  );
222  }
223  }
224  }
225 
226  // merge with couple
227  if (!empty($aInputsSecond)) {
228  $aHeader1 = array( // wrapper for merging
229  array( // input itself
230  'type' => 'block_header',
231  'caption' => _t('_First Person')
232  )
233  );
234 
235  $aHeader2 = array(
236  array(
237  'type' => 'block_header',
238  'caption' => _t('_Second Person'),
239  )
240  );
241 
242  $aInputs = array_merge($aHeader1, $aInputs, $aHeader2, $aInputsSecond);
243  }
244 
245  if (empty($aInputs)) {
246  return '';
247  }
248 
249  if ($this->bPFEditable) {
250  // add submit button
251  $aInputs[] = array(
252  'type' => 'submit',
253  'colspan' => 'true',
254  'value' => _t('_Save'),
255  );
256 
257  // add hidden inputs
258  // profile id
259  $aInputs[] = array(
260  'type' => 'hidden',
261  'name' => 'ID',
262  'value' => $this->_iProfileID,
263  );
264 
265  $aInputs[] = array(
266  'type' => 'hidden',
267  'name' => 'force_ajax_save',
268  'value' => '1',
269  );
270 
271  $aInputs[] = array(
272  'type' => 'hidden',
273  'name' => 'pf_block',
274  'value' => $iPFBlockID,
275  );
276 
277  $aInputs[] = array(
278  'type' => 'hidden',
279  'name' => 'do_submit',
280  'value' => '1',
281  );
282 
283  $aFormAttrs = array(
284  'method' => 'post',
285  'action' => CH_WSB_URL_ROOT . 'pedit.php',
286  'onsubmit' => "submitViewEditForm(this, $iPageBlockID, " . ch_html_attribute($_SERVER['PHP_SELF']) . "'?ID={$this->_iProfileID}'); return false;",
287  'name' => 'edit_profile_form',
288  );
289 
290  $aFormParams = array();
291  } else {
292  $aFormAttrs = array(
293  'name' => 'view_profile_form',
294  );
295 
296  $aFormParams = array(
297  'remove_form' => true,
298  );
299  }
300 
301  // generate form array
302  $aForm = array(
303  'form_attrs' => $aFormAttrs,
304  'params' => $aFormParams,
305  'inputs' => $aInputs,
306  );
307 
309 
310  return $oForm->getCode();
311  }
312 
319  public function showBlockCover($sCaption, $bNoDB = false)
320  {
321  global $p_arr;
322 
323  $bProfileOwner = isLogged() && $p_arr['ID'] == getLoggedId();
324  $sProfileNickname = getNickName($p_arr['ID']);
325 
326  $sProfileThumbnail = '';
327  $sProfileThumbnail2x = '';
328  $sProfileThumbnailHref = '';
329 
330  $bProfileThumbnail = false;
331  $bProfileThumbnailHref = false;
332 
333  $aProfileThumbnail = ChWsbService::call('photos', 'profile_photo', array($p_arr['ID'], 'browse', 'full'), 'Search');
334  if (!empty($aProfileThumbnail) && is_array($aProfileThumbnail)) {
335  $sProfileThumbnail = $aProfileThumbnail['file_url'];
336  $sProfileThumbnailHref = $aProfileThumbnail['view_url'];
337 
338  $bProfileThumbnail = true;
339  $bProfileThumbnailHref = true;
340 
341  $aProfileThumbnail2x = ChWsbService::call('photos', 'profile_photo', array($p_arr['ID'], 'browse2x', 'full'), 'Search');
342  if (!empty($aProfileThumbnail2x) && is_array($aProfileThumbnail2x)) {
343  $sProfileThumbnail2x = $aProfileThumbnail['file_url'];
344  }
345  }
346 
347  if ($bProfileOwner && ChWsbRequest::serviceExists('photos', 'get_manage_profile_photo_url')) {
348  $sProfileThumbnailHref = ChWsbService::call('photos', 'get_manage_profile_photo_url', array($p_arr['ID'], 'profile_album_name'));
349 
350  $bProfileThumbnailHref = !empty($sProfileThumbnailHref);
351  }
352 
353  $sProfileCoverHref = '';
354  $bProfileCoverHref = false;
355 
356  if (ChWsbRequest::serviceExists('photos', 'profile_cover', 'Search')) {
357  $sProfileCoverHref = ChWsbService::call('photos', 'profile_cover', array($p_arr['ID'], 'file'), 'Search');
358  $bProfileCoverHref = !empty($sProfileCoverHref);
359  }
360 
361  $sProfileCoverChangeHref = '';
362  $bProfileCoverChangeHref = false;
363  if ($bProfileOwner && ChWsbRequest::serviceExists('photos', 'get_album_uploader_url')) {
364  $sProfileCoverChangeHref = ChWsbService::call('photos', 'get_manage_profile_photo_url', array($p_arr['ID'], 'profile_cover_album_name'));
365  $bProfileCoverChangeHref = !empty($sProfileCoverChangeHref);
366  }
367 
368  ch_import('ChWsbMemberInfo');
369  $o = ChWsbMemberInfo::getObjectInstance('sys_status_message');
370  $sProfileStatus = $o ? $o->get($p_arr) : '';
371 
372  $sBackground = '';
373  $sBackgroundClass = '';
374  if ($bProfileCoverHref) {
375  $sBackground = $sProfileCoverHref;
376  $sBackgroundClass = ' sys-pcb-cover';
377  } elseif ($bProfileThumbnail) {
378  $sBackground = $sProfileThumbnail;
379  $sBackgroundClass = ' sys-pcb-thumbnail';
380  }
381 
382  $aTmplVarsMenu = array();
383  // I don't want the menu on the cover, so i commented this one out.
384  /*
385  $aMenuItems = $GLOBALS['oTopMenu']->getSubItems();
386  foreach($aMenuItems as $aMenuItem)
387  $aTmplVarsMenu[] = array(
388  'href' => $aMenuItem['Link'],
389  'ch_if:show_onclick' => array(
390  'condition' => !empty($aMenuItem['Onclick']),
391  'content' => array(
392  'onclick' => $aMenuItem['Onclick']
393  )
394  ),
395  'ch_if:show_target' => array(
396  'condition' => !empty($aMenuItem['Target']),
397  'content' => array(
398  'target' => $aMenuItem['Target']
399  )
400  ),
401  'caption' => _t($aMenuItem['Caption'])
402  );
403  */
404  $sContent = $GLOBALS['oSysTemplate']->parseHtmlByName('profile_cover.html', array(
405  'background_class' => $sBackgroundClass,
406  'ch_if:show_background' => array(
407  'condition' => !empty($sBackground),
408  'content' => array(
409  'background' => $sBackground
410  )
411  ),
412  'ch_if:show_actions' => array(
413  'condition' => $bProfileOwner,
414  'content' => array(
415  'ch_if:show_action_thumbnail' => array(
416  'condition' => $bProfileThumbnailHref,
417  'content' => array(
418  'href_upload_thumbnail' => $sProfileThumbnailHref
419  ),
420  ),
421  'ch_if:show_action_cover' => array(
422  'condition' => $bProfileCoverChangeHref,
423  'content' => array(
424  'href_upload' => $sProfileCoverChangeHref,
425  )
426  )
427  )
428  ),
429  'ch_if:show_thumbnail_image' => array(
430  'condition' => $bProfileThumbnail,
431  'content' => array(
432  'thumbnail_href' => $sProfileThumbnailHref,
433  'thumbnail' => $sProfileThumbnail,
434  'thumbnail2x' => $sProfileThumbnail2x,
435  )
436  ),
437  'ch_if:show_thumbnail_letter_text' => array(
438  'condition' => !$bProfileThumbnail && !$bProfileThumbnailHref,
439  'content' => array(
440  'letter' => mb_substr($sProfileNickname, 0, 1)
441  )
442  ),
443  'ch_if:show_thumbnail_letter_link' => array(
444  'condition' => !$bProfileThumbnail && $bProfileThumbnailHref,
445  'content' => array(
446  'thumbnail_href' => $sProfileThumbnailHref,
447  'letter' => mb_substr($sProfileNickname, 0, 1)
448  )
449  ),
450  'nickname' => $sProfileNickname,
451  'status' => $sProfileStatus,
452  'ch_repeat:menu_items' => $aTmplVarsMenu,
453  ));
454 
455  return array($sContent, array(), array(), true);
456  }
457 
464  public function showBlockActionsMenu($sCaption, $bNoDB = false)
465  {
466  global $p_arr;
467 
468  /*
469  if( (!$iMemberID or !$iViewedMemberID) or ($iMemberID == $iViewedMemberID) )
470  return null;
471  */
472 
473  $sActions = $GLOBALS['oFunctions']->getProfileViewActions($p_arr['ID'], 'Profile');
474 
475  if ($bNoDB) {
476  return $sActions;
477  } else {
478  echo DesignBoxContent(_t($sCaption), $sActions, 1);
479  }
480  }
481 
482  public function showBlockFriendRequest($sCaption, $bNoDB = false)
483  {
484  if (!isMember()) {
485  return "";
486  }
487  $aViewer = getProfileInfo();
488  $sQuery = "SELECT `ID` FROM `sys_friend_list` WHERE `Profile`='" . $aViewer['ID'] . "' AND `Check`=0 LIMIT 1";
489  $mixedCheck = $GLOBALS['MySQL']->getOne($sQuery);
490  if ((int)$mixedCheck == 0) {
491  return "";
492  }
493  $sContent = _t('_pending_friend_request_answer', CH_WSB_URL_ROOT . "communicator.php?person_switcher=to&communicator_mode=friends_requests");
495  return array($sContent, array(), array(), false);
496  }
497 
498  public function showBlockRateProfile($sCaption, $bNoDB = false)
499  {
500  $votes = getParam('votes');
501 
502  // Check if profile votes enabled
503  if (!$votes || !$this->oVotingView->isEnabled() || isBlocked($this -> _iProfileID, getLoggedId())) {
504  return;
505  }
506 
507  $ret = $this->oVotingView->getBigVoting();
508  $ret = $GLOBALS['oSysTemplate']->parseHtmlByName('default_margin.html', array('content' => $ret));
509 
510  if ($bNoDB) {
511  return $ret;
512  } else {
513  echo DesignBoxContent(_t($sCaption), $ret, 1);
514  }
515  }
516 
517  public function showBlockCmts()
518  {
519  if (!$this->oCmtsView->isEnabled() || isBlocked($this -> _iProfileID, getLoggedId())) {
520  return '';
521  }
522  return $this->oCmtsView->getCommentsFirst();
523  }
524 
525  public function showBlockFriends($sCaption, $oParent, $bNoDB = false)
526  {
527  $iLimit = $this->iFriendsPerPage;
528 
529  $sAllFriends = 'viewFriends.php?iUser=' . $this -> _iProfileID;
530  $sProfileLink = getProfileLink($this -> _iProfileID);
531 
532  // count all friends ;
533  $iCount = getFriendNumber($this->_iProfileID);
534 
535  $sPaginate = '';
536  if ($iCount) {
537  $iPages = ceil($iCount / $iLimit);
538  $iPage = (isset($_GET['page'])) ? (int) $_GET['page'] : 1;
539 
540  if ($iPage < 1) {
541  $iPage = 1;
542  }
543  if ($iPage > $iPages) {
544  $iPage = $iPages;
545  }
546 
547  $sqlFrom = ($iPage - 1) * $iLimit;
548  if ($sqlFrom < 1) {
549  $sqlFrom = 0;
550  }
551  $sqlLimit = "LIMIT {$sqlFrom}, {$iLimit}";
552  } else {
553  return ;
554  }
555 
556  $aAllFriends = getMyFriendsEx($this->_iProfileID, '', 'image', $sqlLimit);
557  $iCurrCount = count($aAllFriends);
558 
559  $aTmplVars = array(
560  'ch_repeat:friends' => array()
561  );
562  foreach ($aAllFriends as $iFriendID => $aFriendsPrm) {
563  $aTmplVars['ch_repeat:friends'][] = array(
564  'content' => get_member_thumbnail($iFriendID, 'none', true, 'visitor', array('is_online' => $aFriendsPrm[5]))
565  );
566  }
567  $sOutputHtml = $GLOBALS['oSysTemplate']->parseHtmlByName('profile_friends.html', $aTmplVars);
568 
569  $oPaginate = new ChWsbPaginate(array(
570  'page_url' => CH_WSB_URL_ROOT . 'profile.php',
571  'count' => $iCount,
572  'per_page' => $iLimit,
573  'page' => $iPage,
574  'on_change_page' => 'return !loadDynamicBlock({id}, \'' . $sProfileLink. '?page={page}&per_page={per_page}\');',
575  ));
576 
577  $sPaginate = $oPaginate->getSimplePaginate($sAllFriends);
578  return array( $sOutputHtml, array(), $sPaginate, true);
579  }
580 
581  public function showBlockMutualFriends($sCaption, $bNoDB = false)
582  {
583  $iViewer = getLoggedId();
584  if ($this->_iProfileID == $iViewer) {
585  return;
586  }
587  if ($this->iCountMutFriends > 0) {
588  $sCode = $sPaginate = '';
589 
591  $iPage = (int)$_GET['page'] > 0 ? (int)$_GET['page'] : 1;
592 
593  $aTmplVars = array(
594  'ch_repeat:friends' => array()
595  );
596  foreach ($this->aMutualFriends as $iKey => $sValue) {
597  $aTmplVars['ch_repeat:friends'][] = array(
598  'content' => get_member_thumbnail($iKey, 'none', true)
599  );
600  }
601  $sCode = $GLOBALS['oSysTemplate']->parseHtmlByName('profile_friends.html', $aTmplVars);
602 
603  if ($this->iCountMutFriends > $iPerPage) {
604  $oPaginate = new ChWsbPaginate(array(
605  'page_url' => CH_WSB_URL_ROOT . 'profile.php',
606  'count' => $this->iCountMutFriends,
607  'per_page' => $iPerPage,
608  'page' => $iPage,
609  'on_change_page' => 'return !loadDynamicBlock({id}, \'' . getProfileLink($this->_iProfileID). '?page={page}&per_page={per_page}\');',
610  ));
611  $sPaginate = $oPaginate->getSimplePaginate('', -1, -1, false);
612  }
613 
614  if ($bNoDB) {
615  return array($sCode, array(), $sPaginate, true);
616  } else {
617  return DesignBoxContent(_t($sCaption), $sCode, 1);
618  }
619  }
620  }
621 
622  public function CountMutualFriends($iViewer)
623  {
624  return getMutualFriendsCount($this->_iProfileID, $iViewer);
625  }
626 
627  public function FindMutualFriends($iViewer, $iPage = 1, $iPerPage = 14)
628  {
629  $iViewer = (int)$iViewer;
630  $this->iCountMutFriends = $this->CountMutualFriends($iViewer);
631  if ($this->iCountMutFriends > 0) {
632  $iPage = $iPage > 0 ? (int)$iPage : 1;
633  $iPerPage = $iPerPage > 0 ? (int)$iPerPage : $this->iFriendsPerPage;
634  $sLimit = "LIMIT " . ($iPage - 1) * $iPerPage . ", $iPerPage";
635 
636  $sQuery = "
637  SELECT p.ID AS `friendID` , p.NickName
638  FROM `Profiles` AS p
639  INNER JOIN (SELECT `ID` AS `ID`, `When` FROM `sys_friend_list` WHERE `Profile` = '{$this->_iProfileID}' AND `Check` =1
640  UNION SELECT `Profile` AS `ID`, `When` FROM `sys_friend_list` WHERE `ID` = '{$this->_iProfileID}' AND `Check` =1) AS `f1`
641  ON (`f1`.`ID` = `p`.`ID`)
642  INNER JOIN (SELECT `ID` AS `ID`, `When` FROM `sys_friend_list` WHERE `Profile` = '{$iViewer}' AND `Check` =1
643  UNION SELECT `Profile` AS `ID`, `When` FROM `sys_friend_list` WHERE `ID` = '{$iViewer}' AND `Check` =1) AS `f2`
644  ON (`f2`.`ID` = `p`.`ID`)
645  ORDER BY p.`Avatar` DESC
646  $sLimit
647  ";
648 
649  $vResult = db_res($sQuery);
650  while ($aRow = $vResult ->fetch()) {
651  $this->aMutualFriends[ $aRow['friendID'] ] = $aRow['NickName'];
652  }
653  }
654  }
655 
656  public function GenSqlConditions(&$aSearchBlocks, &$aRequestParams, $aFilterSortSettings = array())
657  {
658  $aWhere = array();
659  $sJoin = '';
660  $sPossibleOrder = '';
661 
662  // --- cut 1
663  //collect where request array
664  foreach ($aSearchBlocks as $iBlockID => $aBlock) {
665  foreach ($aBlock['Items'] as $aItem) {
666  if (!isset($aRequestParams[ $aItem['Name'] ])) {
667  continue;
668  }
669 
670  $sItemName = $aItem['Name'];
671  $mValue = $aRequestParams[$sItemName];
672 
673  switch ($aItem['Type']) {
674  case 'text':
675  case 'area':
676  if ($sItemName == 'Tags') {
677  $sJoin .= " INNER JOIN `sys_tags` ON (`sys_tags`.`Type` = 'profile' AND `sys_tags`.`ObjID` = `Profiles`.`ID`) ";
678  $aWhere[] = "`sys_tags`.`Tag` = '" . process_db_input($mValue, CH_TAGS_STRIP) . "'";
679  } else {
680  $aWhere[] = "`Profiles`.`$sItemName` LIKE '%" . process_db_input($mValue, CH_TAGS_STRIP) . "%'";
681  }
682  break;
683 
684  case 'num':
685  $mValue[0] = (int)$mValue[0];
686  $mValue[1] = (int)$mValue[1];
687  $aWhere[] = "`Profiles`.`$sItemName` >= {$mValue[0]} AND `Profiles`.`$sItemName` <= {$mValue[1]}";
688  break;
689 
690  case 'date':
691  $iMin = floor($mValue[0] * 365.25); //for leap years
692  $iMax = floor($mValue[1] * 365.25);
693 
694  $aWhere[] = "DATEDIFF( NOW(), `Profiles`.`$sItemName` ) >= $iMin AND DATEDIFF( NOW(), `Profiles`.`$sItemName` ) <= $iMax"; // TODO: optimize it, move static sql part to the right part and leave db field only in the left part
695 
696  //$aWhere[] = "DATE_ADD( `$sItemName`, INTERVAL {$mValue[0]} YEAR ) <= NOW() AND DATE_ADD( `$sItemName`, INTERVAL {$mValue[1]} YEAR ) >= NOW()"; //is it correct statement?
697  break;
698 
699  case 'select_one':
700  if (is_array($mValue)) {
701  $sValue = implode(',', $mValue);
702  $aWhere[] = "FIND_IN_SET( `Profiles`.`$sItemName`, '" . process_db_input($sValue, CH_TAGS_STRIP) . "' )";
703  } else {
704  $aWhere[] = "`Profiles`.`$sItemName` = '" . process_db_input($mValue, CH_TAGS_STRIP) . "'";
705  }
706  break;
707 
708  case 'select_set':
709  $aSet = array();
710 
711  $aMyValues = is_array($mValue) ? $mValue : array($mValue);
712 
713  foreach ($aMyValues as $sValue) {
714  $sValue = process_db_input($sValue, CH_TAGS_STRIP);
715  $aSet[] = "FIND_IN_SET( '$sValue', `Profiles`.`$sItemName` )";
716  }
717 
718  $aWhere[] = '( ' . implode(' OR ', $aSet) . ' )';
719  break;
720 
721  case 'range':
722  //impl
723  break;
724 
725  case 'bool':
726  $aWhere[] = "`Profiles`.`$sItemName`";
727  break;
728 
729  case 'system':
730  switch ($aItem['Name']) {
731  case 'Couple':
732  if ($mValue == '-1') {
733  } elseif ($mValue) {
734  $aWhere[] = "`Profiles`.`Couple` > `Profiles`.`ID`";
735  } else {
736  $aWhere[] = "`Profiles`.`Couple` = 0";
737  }
738  break;
739 
740  case 'Keyword':
741  case 'Location':
742  $aFields = explode("\n", $aItem['Extra']);
743  $aKeyw = array();
744  $sValue = process_db_input($mValue, CH_TAGS_STRIP);
745 
746  foreach ($aFields as $sField) {
747  $aKeyw[] = "`Profiles`.`$sField` LIKE '%$sValue%'";
748  }
749 
750  $aWhere[] = '( ' . implode(' OR ', $aKeyw) . ')';
751  break;
752 
753  case 'ID':
754  $aWhere[] = "`ID` = $mValue";
755  break;
756  }
757  break;
758  }
759  }
760  }
761 
762  // --- cut 2
763 
764  if (getParam("ch_zip_enabled") == "on" && $aRequestParams['distance'] > 0) {
765  ChWsbService::call('zipcodesearch', 'get_sql_parts', array($_REQUEST['Country'], $_REQUEST['zip'], $_REQUEST['metric'], $_REQUEST['distance'], &$sJoin, &$aWhere));
766  }
767 
768  // --- cut 3
769 
770  // collect query string
771  $aWhere[] = "`Profiles`.`Status` = 'Active'";
772 
773  // add online only
774  if ($_REQUEST['online_only']) {
775  $iOnlineTime = (int)getParam('member_online_time');
776  $aWhere[] = "`DateLastNav` >= DATE_SUB(NOW(), INTERVAL $iOnlineTime MINUTE)";
777  }
778 
779  // --- cut 4
780 
781  $sPossibleOrder = '';
782  switch ($_REQUEST['show']) {
783  case 'featured':
784  $aWhere[] = "`Profiles`.`Featured` = '1'";
785  break;
786  case 'birthdays':
787  $aWhere[] = "MONTH(`DateOfBirth`) = MONTH(CURDATE()) AND DAY(`DateOfBirth`) = DAY(CURDATE())";
788  break;
789  case 'top_rated':
790  $sPossibleOrder = ' ORDER BY `Profiles`.`Rate` DESC, `Profiles`.`RateCount` DESC';
791  break;
792  case 'popular':
793  $sPossibleOrder = ' ORDER BY `Profiles`.`Views` DESC';
794  break;
795  case 'moderators':
796  $sJoin .= " INNER JOIN `" . DB_PREFIX . "ChatProfiles` ON `Profiles`.`ID`= `" . DB_PREFIX . "ChatProfiles`.`ID` ";
797  $aWhere[] = "`" . DB_PREFIX . "ChatProfiles`.`Type`='moder'";
798  break;
799  }
800 
801  switch ($aFilterSortSettings['sort']) {
802  case 'activity':
803  $sPossibleOrder = ' ORDER BY `Profiles`.`DateLastNav` DESC';
804  break;
805  case 'date_reg':
806  $sPossibleOrder = ' ORDER BY `Profiles`.`DateReg` DESC';
807  break;
808  case 'rate':
809  $sPossibleOrder = ' ORDER BY `Profiles`.`Rate` DESC, `Profiles`.`RateCount` DESC';
810  break;
811  default:
812  break;
813  }
814 
815  // --- cut 5
816  if ($_REQUEST['photos_only']) {
817  $aWhere[] = "`Profiles`.`Avatar`";
818  }
819 
820  $aWhere[] = "(`Profiles`.`Couple`='0' OR `Profiles`.`Couple`>`Profiles`.`ID`)";
821 
822  return array($aWhere, $sJoin, $sPossibleOrder);
823  }
824 
825  public function GenSearchResultBlock($aSearchBlocks, $aRequestParams, $aFilterSortSettings = array(), $sPgnRoot = 'profile.php')
826  {
827  if (empty($aSearchBlocks)) { // the request is empty. do not search.
828  return array('', array(), '', '');
829  }
830 
831  // status uptimization
832  $iOnlineTime = (int)getParam("member_online_time");
833  $sIsOnlineSQL = ", if(`DateLastNav` > SUBDATE(NOW(), INTERVAL {$iOnlineTime} MINUTE ), 1, 0) AS `is_online`";
834 
835  $sQuery = 'SELECT DISTINCT SQL_CALC_FOUND_ROWS IF( `Profiles`.`Couple`=0, `Profiles`.`ID`, IF( `Profiles`.`Couple`>`Profiles`.`ID`, `Profiles`.`ID`, `Profiles`.`Couple` ) ) AS `ID` ' . $sIsOnlineSQL . ' FROM `Profiles` ';
836  $sQueryCnt = 'SELECT COUNT(DISTINCT IF( `Profiles`.`Couple`=0, `Profiles`.`ID`, IF( `Profiles`.`Couple`>`Profiles`.`ID`, `Profiles`.`ID`, `Profiles`.`Couple` ) )) AS "Cnt" FROM `Profiles` ';
837 
838  list($aWhere, $sJoin, $sPossibleOrder) = $this->GenSqlConditions($aSearchBlocks, $aRequestParams, $aFilterSortSettings);
839 
840  $sWhere = ' WHERE ' . implode(' AND ', $aWhere);
841 
842  //collect the whole query string
843  $sQuery = $sQuery . $sJoin . $sWhere . $sPossibleOrder;
844  $sQueryCnt = $sQueryCnt . $sJoin . $sWhere . $sPossibleOrder;
845 
846  //echo $sQuery;
847 
848  $iCountProfiles = (int)(db_value($sQueryCnt));
849 
850  $sResults = $sTopFilter = '';
851  if ($iCountProfiles) {
852  //collect pagination
853  $iCurrentPage = isset($_GET['page']) ? (int)$_GET['page'] : 1;
854  $iResultsPerPage = isset($_GET['res_per_page']) ? (int)$_GET['res_per_page'] : 10;
855 
856  if ($iCurrentPage < 1) {
857  $iCurrentPage = 1;
858  }
859  if ($iResultsPerPage < 1) {
860  $iResultsPerPage = 10;
861  }
862 
863  $iTotalPages = ceil($iCountProfiles / $iResultsPerPage);
864 
865  if ($iTotalPages > 1) {
866  if ($iCurrentPage > $iTotalPages) {
867  $iCurrentPage = $iTotalPages;
868  }
869 
870  $sLimitFrom = ($iCurrentPage - 1) * $iResultsPerPage;
871  $sQuery .= " LIMIT {$sLimitFrom}, {$iResultsPerPage}";
872 
873  list($sPagination, $sTopFilter) = $this->genSearchPagination($iCountProfiles, $iCurrentPage, $iResultsPerPage, $aFilterSortSettings, $sPgnRoot);
874  } else {
875  $sPagination = '';
876  }
877 
878  //make search
879  $aProfiles = array();
880  $aProfileStatuses = array();
881  $rProfiles = db_res($sQuery);
882  while ($aProfile = $rProfiles->fetch()) {
883  $aProfiles[] = $aProfile['ID'];
884  $aProfileStatuses[$aProfile['ID']] = $aProfile['is_online'];
885  }
886 
887  $sOutputMode = (isset($_REQUEST['search_result_mode']) && $_REQUEST['search_result_mode'] == 'ext') ? 'ext' : 'sim';
888 
889  $aDBTopMenu = array();
890  foreach (array( 'sim', 'ext' ) as $myMode) {
891  switch ($myMode) {
892  case 'sim':
893  $modeTitle = _t('_Simple');
894  break;
895  case 'ext':
896  $modeTitle = _t('_Extended');
897  break;
898  }
899 
900  $aGetParams = $_GET;
901  unset($aGetParams['search_result_mode']);
902  $sRequestString = $this->collectRequestString($aGetParams);
903  $aDBTopMenu[$modeTitle] = array('href' => ch_html_attribute($_SERVER['PHP_SELF']) . "?search_result_mode={$myMode}{$sRequestString}", 'dynamic' => false, 'active' => ($myMode == $sOutputMode));
904  }
905 
906  if ($sOutputMode == 'sim') {
907  $sBlockWidthSQL = "SELECT `PageWidth`, `ColWidth` FROM `sys_page_compose` WHERE `Page`='profile' AND `Func`='ProfileSearch'";
908  $aBlockWidthInfo = db_arr($sBlockWidthSQL);
909 
910  $iBlockWidth = (int)((int)$aBlockWidthInfo['PageWidth'] /* * (int)$aBlockWidthInfo['ColWidth'] / 100*/) - 20;
911 
912  $iMaxThumbWidth = getParam('max_thumb_width') + 6;
913 
914  $iDestWidth = $iCountProfiles * ($iMaxThumbWidth + 6);
915 
916  if ($iDestWidth > $iBlockWidth) {
917  $iMaxAllowed = (int)floor($iBlockWidth / ($iMaxThumbWidth + 6));
918  $iDestWidth = $iMaxAllowed * ($iMaxThumbWidth + 6);
919  }
920  }
921  $sWidthCent = ($iDestWidth > 0) ? "width:{$iDestWidth}px;" : '';
922 
923  $sResults .= '<div class="block_rel_100 ch-def-bc-margin' . ($sOutputMode == 'sim' ? '-thd' : '') . '">';
924 
925  //output search results
926  require_once(CH_DIRECTORY_PATH_ROOT . 'templates/tmpl_'.$GLOBALS['tmpl'].'/scripts/ChTemplSearchProfile.php');
927  $oChTemplSearchProfile = new ChTemplSearchProfile();
928  $iCounter = 0;
929 
930  foreach ($aProfiles as $iProfID) {
931  $aProfileInfo = getProfileInfo($iProfID);
932 
933  //attaching status value
934  $aProfileStatus = array(
935  'is_online' => $aProfileStatuses[$iProfID]
936  );
937  $aProfileInfo = array_merge($aProfileStatus, $aProfileInfo);
938 
939  $sResults .= $oChTemplSearchProfile->displaySearchUnit($aProfileInfo);
940  $iCounter++;
941  }
942 
943  $sResults .= <<<EOF
944  <div id="ajaxy_popup_result_div" style="display: none;"></div>
945  <div class="clear_both"></div>
946  </div>
947 EOF;
948 
949  return array($sResults, $aDBTopMenu, $sPagination, $sTopFilter);
950  } else {
951  return array(MsgBox(_t('_Empty')), array(), '', '');
952  }
953  }
954 
955  public function GenProfilesCalendarBlock()
956  {
957  ch_import('ChWsbProfilesCalendar');
958 
959  $aDateParams = array();
960  $sDate = $_REQUEST['date'];
961  if ($sDate) {
962  $aDateParams = explode('/', $sDate);
963  }
964  $oCalendar = new ChWsbProfilesCalendar((int)$aDateParams[0], (int)$aDateParams[1], $this);
965 
966  $sOutputMode = (isset($_REQUEST['mode']) && $_REQUEST['mode'] == 'dob') ? 'dob' : 'dor';
967  $aDBTopMenu = array();
968  foreach (array( 'dob', 'dor' ) as $myMode) {
969  switch ($myMode) {
970  case 'dob':
971  if ($sOutputMode == $myMode) {
972  $oCalendar->setMode('dob');
973  }
974  $modeTitle = _t('Date of birth');
975  break;
976  case 'dor':
977  $modeTitle = _t('Date of registration');
978  break;
979  }
980 
981  $aGetParams = $_GET;
982  unset($aGetParams['mode']);
983  $sRequestString = $this->collectRequestString($aGetParams);
984  $aDBTopMenu[$modeTitle] = array('href' => ch_html_attribute($_SERVER['PHP_SELF']) . "?mode={$myMode}{$sRequestString}", 'dynamic' => true, 'active' => ($myMode == $sOutputMode));
985  }
986 
987  //return $oCalendar->display();
988  return array( $oCalendar->display(), $aDBTopMenu );
989  }
990 
991  public function genSearchPagination($iCountProfiles, $iCurrentPage, $iResultsPerPage, $aFilterSortSettings = array(), $sPgnRoot = '')
992  {
993  $aGetParams = $_GET;
994  unset($aGetParams['page']);
995  unset($aGetParams['res_per_page']);
996  unset($aGetParams['sort']);
997 
998  $sRequestString = $this->collectRequestString($aGetParams);
999  $sRequestString = CH_WSB_URL_ROOT . strip_tags($sPgnRoot) . '?' . substr($sRequestString, 1);
1000 
1001  $sPaginTmpl = $sRequestString . '&res_per_page={per_page}&page={page}&sort={sorting}';
1002 
1003  // gen pagination block ;
1004 
1005  $oPaginate = new ChWsbPaginate(
1006  array(
1007  'page_url' => $sPaginTmpl,
1008  'count' => $iCountProfiles,
1009  'per_page' => $iResultsPerPage,
1010  'sorting' => $aFilterSortSettings['sort'], // New param
1011  'page' => $iCurrentPage,
1012  )
1013  );
1014 
1015  $sPagination = $oPaginate->getPaginate();
1016 
1017  // fill array with sorting params
1018  $aSortingParam = array(
1019  'none' => _t('_None'),
1020  'activity' => _t('_Latest activity'),
1021  'date_reg' => _t('_FieldCaption_DateReg_View'),
1022  );
1023  if (getParam('votes')) {
1024  $aSortingParam['rate'] = _t('_Rate');
1025  }
1026 
1027  // gen sorting block ( type of : drop down ) ;
1028  $sSortBlock = $oPaginate->getSorting($aSortingParam);
1029  $sSortElement = '<div class="ordered_block">' . $sSortBlock . '</div><div class="clear_both"></div>';
1030  $sSortElement = $GLOBALS['oSysTemplate']->parseHtmlByName('designbox_top_controls.html', array(
1031  'top_controls' => $sSortElement
1032  ));
1033 
1034  return array($sPagination, $sSortElement);
1035  }
1036 
1037  public function collectRequestString($aGetParams, $sKeyPref = '', $sKeyPostf = '')
1038  {
1039  if (!is_array($aGetParams)) {
1040  return '';
1041  }
1042 
1043  $sRet = '';
1044  foreach ($aGetParams as $sKey => $sValue) {
1045  if ($sValue === '') {
1046  continue;
1047  }
1048 
1049  if (!is_array($sValue)) {
1050  $sRet .= '&' . urlencode($sKeyPref . $sKey . $sKeyPostf) . '=' . urlencode(process_pass_data($sValue));
1051  } else {
1052  $sRet .= $this->collectRequestString($sValue, "{$sKeyPref}{$sKey}{$sKeyPostf}[", "]"); //recursive call
1053  }
1054  }
1055 
1056  return $sRet;
1057  }
1058 
1059  public function GenActionsMenuBlock()
1060  {
1061  // init some user's values
1063 
1064  $iMemberID = getLoggedId();
1065 
1066  $iViewedMemberID = (int)$p_arr['ID'];
1067 
1068  if ((!$iMemberID or !$iViewedMemberID) or ($iMemberID == $iViewedMemberID)) {
1069  return null;
1070  }
1071 
1072  // prepare all nedded keys
1073  $p_arr['url'] = CH_WSB_URL_ROOT;
1074  $p_arr['window_width'] = $this->oTemplConfig->popUpWindowWidth;
1075  $p_arr['window_height'] = $this->oTemplConfig->popUpWindowHeight;
1076  $p_arr['anonym_mode'] = $this->oTemplConfig->bAnonymousMode;
1077  $p_arr['member_id'] = $iMemberID;
1078  $p_arr['member_pass'] = getPassword($iMemberID);
1079 
1080  $sActions = $GLOBALS['oFunctions']->genObjectsActions($p_arr, 'Profile', 'cellpadding="0" cellspacing="0"');
1081 
1082  return $sActions;
1083  }
1084 }
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
ChBaseProfileGenerator\GenActionsMenuBlock
GenActionsMenuBlock()
Definition: ChBaseProfileGenerator.php:1059
ChBaseProfileGenerator\genSearchPagination
genSearchPagination($iCountProfiles, $iCurrentPage, $iResultsPerPage, $aFilterSortSettings=array(), $sPgnRoot='')
Definition: ChBaseProfileGenerator.php:991
ChBaseProfileGenerator\collectRequestString
collectRequestString($aGetParams, $sKeyPref='', $sKeyPostf='')
Definition: ChBaseProfileGenerator.php:1037
$iMemberId
$iMemberId
Definition: profile.php:91
ChWsbMemberInfo\getObjectInstance
static getObjectInstance($sObject)
Definition: ChWsbMemberInfo.php:39
getMyFriendsEx
getMyFriendsEx($iID, $sWhereParam='', $sSortParam='', $sqlLimit='')
Definition: profiles.inc.php:384
ChTemplFormView
Definition: ChTemplFormView.php:11
$sOutputHtml
$sOutputHtml
Definition: browse.php:86
ChWsbProfileFields
Definition: ChWsbProfileFields.php:13
ChBaseProfileGenerator\$oPF
$oPF
Definition: ChBaseProfileGenerator.php:18
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
$sLimitFrom
$sLimitFrom
Definition: post_mod_crss.php:49
ChWsbRequest\serviceExists
static serviceExists($mixedModule, $sMethod, $sClass="Module")
Definition: ChWsbRequest.php:70
ChBaseProfileGenerator\genColumns
genColumns($sOldStyle=false)
Definition: ChBaseProfileGenerator.php:88
ChBaseProfileGenerator\GenSearchResultBlock
GenSearchResultBlock($aSearchBlocks, $aRequestParams, $aFilterSortSettings=array(), $sPgnRoot='profile.php')
Definition: ChBaseProfileGenerator.php:825
ChTemplSearchProfile
Definition: ChTemplSearchProfile.php:11
$sCode
$sCode
Definition: explanation.php:19
$ret
$ret
Definition: index.php:39
ChBaseProfileGenerator\$iCountMutFriends
$iCountMutFriends
Definition: ChBaseProfileGenerator.php:23
ChBaseProfileGenerator\$iFriendsPerPage
$iFriendsPerPage
Definition: ChBaseProfileGenerator.php:24
getMutualFriendsCount
getMutualFriendsCount($iId, $iProfileId)
Definition: profiles.inc.php:347
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChBaseProfileGenerator\showBlockPFBlock
showBlockPFBlock($iPageBlockID, $sCaption, $sContent, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:120
ChBaseProfileGenerator\showBlockFriendRequest
showBlockFriendRequest($sCaption, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:482
php
ChBaseProfileGenerator\GenProfilesCalendarBlock
GenProfilesCalendarBlock()
Definition: ChBaseProfileGenerator.php:955
isLogged
isLogged()
Definition: profiles.inc.php:24
ChBaseProfileGenerator\getViewValuesTable
getViewValuesTable($iPageBlockID, $iPFBlockID)
Definition: ChBaseProfileGenerator.php:151
ChBaseProfileGenerator\showColumnBlocks
showColumnBlocks($column, $sOldStyle=false)
Definition: ChBaseProfileGenerator.php:103
ChBaseProfileGenerator\__construct
__construct($ID)
Definition: ChBaseProfileGenerator.php:26
ChBaseProfileGenerator\showBlockMutualFriends
showBlockMutualFriends($sCaption, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:581
ChBaseProfileGenerator
Definition: ChBaseProfileGenerator.php:15
ChBaseProfileGenerator\showBlockCover
showBlockCover($sCaption, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:319
ChWsbProfile\getPassword
getPassword()
Definition: ChWsbProfile.php:146
ChWsbProfile\getNickName
getNickName()
Definition: ChWsbProfile.php:140
$iPerPage
else $iPerPage
Definition: browse.php:61
isAdmin
isAdmin()
Definition: index.php:649
ChWsbProfile\getProfileData
getProfileData()
Definition: ChWsbProfile.php:53
isModerator
isModerator($iId=0)
Definition: profiles.inc.php:58
ch_html_attribute
ch_html_attribute($mixedInput)
Definition: utils.inc.php:1324
$oForm
$oForm
Definition: host_tools.php:42
ChBaseProfileGenerator\$bPFEditable
$bPFEditable
Definition: ChBaseProfileGenerator.php:21
db_arr
db_arr($query, $bindings=[])
Definition: db.inc.php:76
$_GET
$_GET['debug']
Definition: index.php:67
and
and
Definition: license.txt:18
$aFields
$aFields
Definition: preValues.php:19
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
get_member_thumbnail
get_member_thumbnail($ID, $float, $bGenProfLink=false, $sForceSex='visitor', $aOnline=array())
Definition: design.inc.php:165
getLoggedId
getLoggedId()
Definition: profiles.inc.php:32
$aProfile
$aProfile
Definition: flash.php:14
$site
$site['ver']
Definition: version.inc.php:8
$_REQUEST
$_REQUEST['action']
Definition: cmd.php:11
ChBaseProfileGenerator\showBlockCmts
showBlockCmts()
Definition: ChBaseProfileGenerator.php:517
ChBaseProfileGenerator\showBlockActionsMenu
showBlockActionsMenu($sCaption, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:464
ChWsbPaginate
Definition: ChWsbPaginate.php:69
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
ChTemplConfig
Definition: ChTemplConfig.php:21
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChBaseProfileGenerator\CountMutualFriends
CountMutualFriends($iViewer)
Definition: ChBaseProfileGenerator.php:622
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition: profiles.inc.php:484
ChWsbProfile\$_aProfile
$_aProfile
Definition: ChWsbProfile.php:13
ChBaseProfileGenerator\$aPFBlocks
$aPFBlocks
Definition: ChBaseProfileGenerator.php:19
CH_TAGS_STRIP
const CH_TAGS_STRIP
Definition: utils.inc.php:22
isBlocked
isBlocked($iFirstProfile, $iSecondProfile)
Definition: utils.inc.php:128
$aProfileInfo
$aProfileInfo
Definition: short_profile_info.php:23
process_pass_data
process_pass_data($text, $strip_tags=0)
Definition: utils.inc.php:290
$iPage
$iPage
Definition: browse.php:50
db_res
db_res($query, $bindings=[])
Definition: db.inc.php:39
ChBaseProfileGenerator\showBlockEcho
showBlockEcho($sCaption, $sContent)
Definition: ChBaseProfileGenerator.php:115
db_value
db_value($query, $bindings=[], $error_checking=true, $index=0)
Definition: db.inc.php:98
ChBaseProfileGenerator\FindMutualFriends
FindMutualFriends($iViewer, $iPage=1, $iPerPage=14)
Definition: ChBaseProfileGenerator.php:627
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChBaseProfileGenerator\GenSqlConditions
GenSqlConditions(&$aSearchBlocks, &$aRequestParams, $aFilterSortSettings=array())
Definition: ChBaseProfileGenerator.php:656
$aForm
$aForm
Definition: forgot.php:43
$p_arr
$p_arr
Definition: profile.php:68
$sCaption
$sCaption
Definition: tellfriend.php:39
ChBaseProfileGenerator\$aCoupleMutualItems
$aCoupleMutualItems
Definition: ChBaseProfileGenerator.php:20
ChBaseProfileGenerator\showBlockRateProfile
showBlockRateProfile($sCaption, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:498
ChWsbCmtsProfile
Definition: ChWsbCmtsProfile.php:11
ChWsbProfile
Definition: ChWsbProfile.php:11
$ID
$ID
Definition: click.php:11
DesignBoxContent
DesignBoxContent($title, $content, $db_num=0, $caption_item='', $bottom_item='')
Definition: design.inc.php:78
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition: ChWsbService.php:32
getFriendNumber
getFriendNumber($iID, $iFrStatus=1, $iOnline=0, $sqlWhere='')
Definition: profiles.inc.php:301
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChBaseProfileGenerator\showBlockFriends
showBlockFriends($sCaption, $oParent, $bNoDB=false)
Definition: ChBaseProfileGenerator.php:525
ChBaseProfileGenerator\$oTemplConfig
$oTemplConfig
Definition: ChBaseProfileGenerator.php:16
ChTemplVotingView
Definition: ChTemplVotingView.php:14
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
or
Voluntary License Schemes The Licensor waives the right to collect whether individually or
Definition: license.txt:37
isMember
isMember($iId=0)
Definition: profiles.inc.php:44
ChWsbProfilesCalendar
Definition: ChWsbProfilesCalendar.php:11
ChWsbProfile\$bCouple
$bCouple
Definition: ChWsbProfile.php:14