Cheetah
ChBaseMailBox.php
Go to the documentation of this file.
1 <?php
2 
8  ch_import('ChWsbMailBox');
9  ch_import('ChWsbSubscription');
10 
12  {
13  // contain all needed templates for Html rendering ;
15 
16  // icon type and extension for messages types ;
17  var $sMessageIconPrefix = 'icon_';
18  var $sMessageIconExtension = '.png';
19 
20  var $sMembersFlagExtension = '.gif';
21 
22  // parameters for the displayed message's data into mailbox section;
25 
26  // parameters for the displayed subject data into archives section;
28 
46  {
47  // call the parent constructor ;
48  parent::__construct($sPageName, $aMailBoxSettings);
49 
50  // fill array with used template name ;
51  $this -> aUsedTemplates = array (
52  'messages_init_box' => 'mail_init_box.html',
53  'messages_box' => 'mail_box.html',
54  'messages_types_list' => 'mail_box_messages_types.html',
55  'messages_top_section' => 'mail_box_top_section.html',
56  'contacts_section' => 'mail_box_contacts_list.html',
57  'archives_section' => 'mail_box_archives_list.html',
58  'archives_init_section' => 'mail_box_init_archives_list.html',
59  'archives_pagina_section' => 'mail_box_archives_pagination.html',
60  'archives_pagina_items' => 'mail_box_archives_pagination_items.html',
61  'view_message_box' => 'mail_box_view_message.html',
62  'message_replay' => 'mail_box_replay_message.html',
63  'message_compose' => 'mail_box_compose_message.html',
64  );
65  }
66 
67  function getCss()
68  {
69  return array('mail.css');
70  }
71 
72  function getJs()
73  {
74  return array('mail_box.js');
75  }
76 
83  {
85 
86  $_page['js_name'] = array(
87  'mail_box.js',
88  'plugins/jquery/|jquery.ui.autocomplete.min.js',
89  'plugins/jquery/|jquery.ui.menu.min.js',
90  );
91 
92  // init some needed variables ;
93  $sOutputHtml = null;
94 
95  // check bloked;
96  if(!isAdmin($this -> aMailBoxSettings['member_id']) && isBlocked($this -> aMailBoxSettings['recipient_id'], $this -> aMailBoxSettings['member_id']) ) {
97  return MsgBox( _t('_FAILED_TO_SEND_MESSAGE_BLOCK') );
98  }
99 
100  // if isset recipient ID ;
101  $aMemberInfo = ($this -> aMailBoxSettings['recipient_id']) ? getProfileInfo($this -> aMailBoxSettings['recipient_id']) : null;
102 
103  // check if send message is allowed
104  $aComposeSettings = array();
105  $sErrMsg = $this->sendMessage('', '', $aMemberInfo ? $aMemberInfo['ID'] : 0, $aComposeSettings, true);
106  if($sErrMsg)
107  return array($sErrMsg);
108 
109  $aLanguageKeys = array (
110  'cancel' => _t( '_Cancel' ),
111  'send' => _t( '_Send' ),
112  'send_copy' => _t( '_Send copy to personal email', isset($aMemberInfo['NickName']) ? $aMemberInfo['NickName'] : null ),
113  'send_copy_my' => _t( '_Send copy to my personal email' ),
114  'notify' => _t( '_Notify by e-mail', isset($aMemberInfo['NickName']) ? $aMemberInfo['NickName'] : null ),
115  'error_message' => _t( '_please_fill_next_fields_first' ),
116  'subject' => _t( '_Subject' ),
117  'message_to' => _t( '_SEND_MSG_TO' ),
118  );
119 
120  // ** generate recipient's information ;
121 
122  $sMemberIcon = get_member_thumbnail($this -> aMailBoxSettings['recipient_id'], 'none');
123  $sRecipientName = ( !empty($aMemberInfo) ) ? getNickName($aMemberInfo['ID']) : null;
124  $sMemberLocation = ( !empty($aMemberInfo) ) ? getProfileLink($aMemberInfo['ID']) : null;
125 
126  $aForm = array (
127  'form_attrs' => array (
128  'action' => null,
129  'method' => 'post',
130  ),
131 
132  'params' => array (
133  'remove_form' => true,
134  'db' => array(
135  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
136  ),
137  ),
138 
139  'inputs' => array(
140  'actions' => array(
141  'type' => 'input_set',
142  'colspan' => 'true',
143  0 => array (
144  'type' => 'button',
145  'value' => $aLanguageKeys['send'],
146  'attrs' => array('onclick' => 'if(typeof oMailBoxComposeMessage != \'undefined\') oMailBoxComposeMessage.sendMessage()'),
147  ),
148  1 => array (
149  'type' => 'button',
150  'value' => $aLanguageKeys['cancel'],
151  'attrs' => array('onclick' => 'if(typeof oMailBoxComposeMessage != \'undefined\') oMailBoxComposeMessage.cancelCompose()'),
152  ),
153  )
154  )
155  );
156 
158  $sMessageBoxActions = $oForm -> getCode();
159 
160  $aTemplateKeys = array
161  (
162  'plugins_dir' => CH_WSB_URL_PLUGINS,
163  'error_message' => $aLanguageKeys['error_message'],
164  'current_page' => 'mail.php',
165  'recipient_id' => $aMemberInfo['ID'],
166 
167  'member_thumbnail' => $sMemberIcon,
168  'member_location' => $sMemberLocation,
169 
170  'recipient_name' => $sRecipientName,
171  'subject' => $aLanguageKeys['subject'],
172 
173  'send_copy_my' => $aLanguageKeys['send_copy_my'],
174  'send_copy_to' => $aLanguageKeys['send_copy'],
175  'notify' => $aLanguageKeys['notify'],
176  'message_to' => $aLanguageKeys['message_to'],
177 
178  'compose_actions_buttons' => $sMessageBoxActions,
179  );
180 
182  -> parseHtmlByName( $this -> aUsedTemplates['message_compose'], $aTemplateKeys );
183 
184  // generate the page toggle ellements ;
185  $aToggleItems = array
186  (
187  'inbox' => _t( '_Inbox' ),
188  'outbox' => _t( '_Outbox' ),
189  'trash' => _t( '_Trash' ),
190  'compose' => _t( '_Compose' ),
191  );
192 
193  $sRequest = 'mail.php?';
194  foreach( $aToggleItems AS $sKey => $sValue ) {
195  $aTopToggleEllements[$sValue] = array
196  (
197  'href' => $sRequest . 'mode=' . $sKey,
198  'dynamic' => false,
199  'active' => ($this -> aMailBoxSettings['mailbox_mode'] == $sKey ),
200  );
201  }
202 
203  ch_import('ChWsbEditor');
204  $oEditor = ChWsbEditor::getObjectInstance();
205  $sEditor = '';
206  if ($oEditor) {
207  $oEditor->setCustomConf ("remove_script_host: false,\nrelative_urls: false,\n");
208  $sEditor = $oEditor->attachEditor ('#compose_message', CH_EDITOR_FULL);
209  }
210 
211  return array($sEditor . $sOutputHtml, $aTopToggleEllements);
212  }
213 
220  {
222 
223  // init some needed variables;
224 
225  $sOutputHtml = null;
226  $iSenderID = 0;
227  $iMessageOwner = 0;
228 
229  // define message's owner ;
230  $sQuery =
231  "
232  SELECT
233  `Sender`, `Recipient`
234  FROM
235  `sys_messages`
236  WHERE
237  `ID` = {$this -> aMailBoxSettings['messageID']}
238  AND
239  (
240  `Sender` = {$this -> aMailBoxSettings['member_id']}
241  OR
242  `Recipient` = {$this -> aMailBoxSettings['member_id']}
243  )
244  ";
245 
246  $rResult = db_res($sQuery);
247  while(true == ($aRow = $rResult->fetch())) {
248  $iMessageOwner = ( $aRow['Sender'] == $this -> aMailBoxSettings['member_id'] )
249  ? $aRow['Recipient']
250  : $aRow['Sender'];
251 
252  $iSenderID = $aRow['Sender'];
253  }
254 
255  $sSenderNickName = getNickName($iMessageOwner);
256 
257  // set default selected tab ;
258  if ( !$this -> aMailBoxSettings['contacts_mode']) {
259  if ($iSenderID != $this -> aMailBoxSettings['member_id'])
260  $this -> aMailBoxSettings['contacts_mode'] = 'From';
261  else
262  $this -> aMailBoxSettings['contacts_mode'] = 'To';
263  }
264 
265  // contain all found messages from member ;
266  $sMessagesList = $this -> genArchiveMessages();
267  $aTopToggleEllements = array();
268  $aBottomToggleEllements = array();
269 
270  // generate the top toggle ellements ;
271  $sRequest = 'mail.php?mode=view_message';
272  foreach( $this -> aRegisteredArchivesTypes AS $sKey => $sValue ) {
273  $aTopToggleEllements[ _t('_' . $sKey) . ' ' . $sSenderNickName ] = array
274  (
275  'href' => $sRequest . '&contacts_mode=' . $sKey . '&messageID=' . $this -> aMailBoxSettings['messageID'],
276  'dynamic' => true,
277  'active' => ($this -> aMailBoxSettings['contacts_mode'] == $sKey ),
278  );
279  }
280 
281  $aLanguageKeys = array
282  (
283  'delete_messages' => _t( '_Delete'),
284  'select_all' => _t( '_Select all'),
285  'spam_messages' => _t( '_Spam report' ),
286  );
287 
288  // return builded data ;
289  if ( empty($sMessagesList) )
290  $sMessagesList = MsgBox(_t( '_Empty' ));
291 
292  $sTopControls = $oSysTemplate->parseHtmlByName('mail_box_init_archives_list_top_controls.html', array(
293  'select_all' => $aLanguageKeys['select_all'],
294  'delete_messages' => $aLanguageKeys['delete_messages'],
295  'spam_messages' => $aLanguageKeys['spam_messages'],
296  ));
297 
298  $aTemplateKeys = array (
299  'top_controls' => $sTopControls,
300  'select_messages' => _t('_Please, select at least one message'),
301  'are_you_sure' => _t('_Are_you_sure'),
302  'messages_rows' => $sMessagesList,
303  'current_page' => 'mail.php',
304 
305  );
306 
307  $sOutputHtml = $oSysTemplate -> parseHtmlByName( $this -> aUsedTemplates['archives_init_section'], $aTemplateKeys );
308  return array($sOutputHtml, $aTopToggleEllements, array(), true);
309  }
310 
317  {
320  global $site;
322 
323  // init some needed variables;
324  $sOutputHtml = null;
325  $sActionsList = null;
326 
327  // generate page toggle ellements ;
328  $aToggleItems = array
329  (
330  'inbox' => _t( '_Inbox' ),
331  'outbox' => _t( '_Outbox' ),
332  'trash' => _t( '_Trash' ),
333  'compose' => _t( '_Compose' ),
334  );
335 
336  $sRequest = 'mail.php' . '?';
337  foreach( $aToggleItems AS $sKey => $sValue ) {
338  $aTopToggleEllements[$sValue] = array
339  (
340  'href' => $sRequest . '&mode=' . $sKey,
341  'dynamic' => false,
342  'active' => false,
343  );
344  }
345 
346  // language keys ;
347  $aLanguageKeys = array
348  (
349  'back_inbox' => _t('_sys_mailbox_back_inbox'),
350  'back_outbox' => _t('_sys_mailbox_back_outbox'),
351  'back_trash' => _t('_sys_mailbox_back_trash'),
352  'spam_message' => _t( '_Report' ),
353  'delete_message' => _t( '_Delete' ),
354  'reply_message' => _t( '_Reply' ),
355  'restore_message' => _t( '_Restore' ),
356  'are_you_sure' => _t( '_Are_you_sure' ),
357  'more' => _t( '_More actions' ),
358  'mark_read' => _t( '_Mark as old' ),
359  'mark_unread' => _t( '_Mark as New' ),
360  );
361 
362  $sQuery =
363  "
364  SELECT
365  *,
366  DATE_FORMAT(`Date`, '" . getLocaleFormat(CH_WSB_LOCALE_DATE, CH_WSB_LOCALE_DB) . "') AS `Date`
367  FROM
368  `sys_messages`
369  WHERE
370  `ID` = {$this -> aMailBoxSettings['messageID']}
371  AND
372  (
373  `Sender` = {$this -> aMailBoxSettings['member_id']}
374  OR
375  `Recipient` = {$this -> aMailBoxSettings['member_id']}
376  )
377  ";
378 
379  $rResult = db_res($sQuery);
380  while( true == ($aRow = $rResult->fetch()) ) {
381  // ** generate member's information ;
382 
383  $sMemberIcon = get_member_thumbnail($aRow['Sender'], 'none');
384  $aMemberInfo = getProfileInfo($aRow['Sender']);
385 
386  // define the back link;
387  if($aRow['Trash'] == 'recipient') {
388  $sBackCaption = $aLanguageKeys['back_trash'];
389  $sBackUrl = 'mail.php' . '?mode=trash';
390  } else if ( $aRow['Sender'] == $this -> aMailBoxSettings['member_id'] ) {
391  $sBackCaption = $aLanguageKeys['back_outbox'];
392  $sBackUrl = 'mail.php' . '?mode=outbox';
393  } else {
394  $sBackCaption = $aLanguageKeys['back_inbox'];
395  $sBackUrl = 'mail.php' . '?mode=inbox';
396  }
397 
398  $sMemberNickName = getNickName($aMemberInfo['ID']);
399  $sMemberLocation = getProfileLink($aMemberInfo['ID']);
400  $sMemberSexImage = isset($aMemberInfo['Sex']) ? $oFunctions -> genSexIcon($aMemberInfo['Sex']) : null;
401 
402  $sMemberAge = ( isset($aMemberInfo['DateOfBirth']) && $aMemberInfo['DateOfBirth'] != "0000-00-00" )
403  ? _t( "_y/o", age($aMemberInfo['DateOfBirth']) )
404  : null;
405 
406  $sMemberCountry = ( isset($aMemberInfo['Country']) && $aMemberInfo['Country'])
407  ? $aMemberInfo['Country']
408  : null;
409 
410  $sMemberFlag = ($sMemberCountry)
411  ? $site['flags'] . strtolower($sMemberCountry) . $this -> sMembersFlagExtension
412  : null;
413 
414  if ( $sMemberCountry )
415  $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />';
416 
417  $sCity = ( isset($aMemberInfo['City']) && $aMemberInfo['City'] )
418  ? $aMemberInfo['City'] . ', '
419  : null;
420 
421  // member's city and country;
422  $sMemberCountry = $sCity . $sMemberCountry;
423 
424  // generate the member's actions list;
425  if ( $aRow['Sender'] != $this -> aMailBoxSettings['member_id'] ) {
426  $sActionsList = $oFunctions->getProfileViewActions($aRow['Sender']);
427  }
428 
429  // try to define the message status ;
430  if ( $aRow['Sender'] == $this -> aMailBoxSettings['member_id'] ) {
431  if ( strstr($aRow['Trash'], 'sender') ) {
432  $this -> aMailBoxSettings['mailbox_mode'] = 'trash';
433  } else {
434  $this -> aMailBoxSettings['mailbox_mode'] = 'outbox';
435  }
436  $sRelocateParameter = 'outbox';
437  } else if ( $aRow['Sender'] != $this -> aMailBoxSettings['member_id'] ) {
438  if ( strstr($aRow['Trash'], 'recipient') ) {
439  $this -> aMailBoxSettings['mailbox_mode'] = 'trash';
440  } else {
441  $this -> aMailBoxSettings['mailbox_mode'] = 'inbox';
442  }
443  $sRelocateParameter = 'inbox';
444  }
445 
446  // generate extended mailbox actions
447  switch($this -> aMailBoxSettings['mailbox_mode']) {
448  case 'inbox' :
449  // generate actions for inbox mode ;
450  $aForm = array (
451  'form_attrs' => array (
452  'action' => null,
453  'method' => 'post',
454  ),
455 
456  'params' => array (
457  'remove_form' => true,
458  'db' => array(
459  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
460  ),
461  ),
462 
463  'inputs' => array(
464  'actions' => array(
465  'type' => 'input_set',
466  'colspan' => 'true',
467  array(),
468  array (
469  'type' => 'button',
470  'value' => $aLanguageKeys['delete_message'],
471  'attrs' => array('onclick' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.deleteMessages(' . $aRow['ID'] . ')', 'class' => 'ch-btn-small'),
472  ),
473  array (
474  'type' => 'button',
475  'value' => $aLanguageKeys['spam_message'],
476  'attrs' => array('onclick' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.spamMessages(\'\', ' . $aRow['Sender'] . ')', 'class' => 'ch-btn-small'),
477  ),
478  array (
479  'type' => 'button',
480  'value' => $aLanguageKeys['mark_read'],
481  'attrs' => array('onclick' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.markMessages(\'read\', ' . $aRow['ID'] . ')', 'class' => 'ch-btn-small'),
482  ),
483  array (
484  'type' => 'button',
485  'value' => $aLanguageKeys['mark_unread'],
486  'attrs' => array('onclick' => 'if ( typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.markMessages(\'unread\', ' . $aRow['ID'] . ')', 'class' => 'ch-btn-small'),
487  )
488  )
489  )
490  );
491 
492  if($aRow['Sender'] != $this -> aMailBoxSettings['member_id']){
493  $aForm['inputs']['actions'][0] = array(
494  'type' => 'button',
495  'value' => $aLanguageKeys['reply_message'],
496  'attrs' => array('onclick' => 'oMailBoxViewMessage.replyMessage(' . $this -> aMailBoxSettings['messageID'] . ', ' . $aRow['Sender'] . ');', 'class' => 'ch-btn-small'),
497  );
498  }
499 
501  $sMessageBoxActions = $oForm -> getCode();
502  break;
503 
504  case 'outbox' :
505  // generate actions for outbox mode ;
506  $aForm = array (
507  'form_attrs' => array (
508  'action' => null,
509  'method' => 'post',
510  ),
511 
512  'params' => array (
513  'remove_form' => true,
514  'db' => array(
515  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
516  ),
517  ),
518 
519  'inputs' => array(
520  'actions' => array(
521  'type' => 'input_set',
522  'colspan' => 'true',
523  0 => array (
524  'type' => 'button',
525  'value' => $aLanguageKeys['delete_message'],
526  'attrs' => array('onclick' => 'if (typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.deleteMessages(' . $aRow['ID'] . ')', 'class' => 'ch-btn-small'),
527  ),
528  )
529  )
530  );
531 
533  $sMessageBoxActions = $oForm -> getCode();
534  break;
535 
536  case 'trash' :
537  // generate actions for outbox mode ;
538  $aForm = array (
539  'form_attrs' => array (
540  'action' => null,
541  'method' => 'post',
542  ),
543 
544  'params' => array (
545  'remove_form' => true,
546  'db' => array(
547  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
548  ),
549  ),
550 
551  'inputs' => array(
552  'actions' => array(
553  'type' => 'input_set',
554  'colspan' => 'true',
555  0 => null,
556  1 => array (
557  'type' => 'button',
558  'value' => $aLanguageKeys['restore_message'],
559  'attrs' => array('onclick' => 'if (typeof oMailBoxViewMessage != \'undefined\') oMailBoxViewMessage.restoreMessages(' . $aRow['ID'] . ');', 'class' => 'ch-btn-small'),
560  ),
561  )
562  )
563  );
564 
565  if($aRow['Sender'] != $this -> aMailBoxSettings['member_id']){
566  $aForm['inputs']['actions'][0] = array(
567  'type' => 'button',
568  'value' => $aLanguageKeys['reply_message'],
569  'attrs' => array('onclick' => 'oMailBoxViewMessage.replyMessage(' . $this -> aMailBoxSettings['messageID'] . ', ' . $aRow['Sender'] . ');', 'class' => 'ch-btn-small'),
570  );
571  }
572 
574  $sMessageBoxActions = $oForm -> getCode() ;
575  break;
576  }
577 
578  // prepare for output ;
579  $sTopcontrols = $oSysTemplate->parseHtmlByName('mail_box_view_message_top_controls.html', array(
580  'inbox_mode' => $sBackUrl,
581  'back_to_inbox' => $sBackCaption,
582  'back_img_src' => getTemplateIcon('back_to_inbox.png'),
583  ));
584 
585  $aTemplateKeys = array (
586  'top_controls' => $sTopcontrols,
587 
588  'member_thumbnail' => $sMemberIcon,
589  'member_nick_name' => $sMemberNickName,
590  'member_location' => $sMemberLocation,
591 
592  'member_sex_img' => $sMemberSexImage,
593  'member_sex' => $aMemberInfo['Sex'],
594 
595  'member_age' => $sMemberAge,
596  'member_flag' => $sMemberCountryFlag,
597  'city_country' => $sMemberCountry,
598 
599  'date_create' => $aRow['Date'],
600 
601  'message_subject' => $aRow['Subject'],
602  'member_actions_list' => $sActionsList,
603 
604  'message_text' => $aRow['Text'],
605 
606  'are_you_sure' => $aLanguageKeys['are_you_sure'],
607  'current_page' => 'mail.php',
608  'spam_message' => $aLanguageKeys['spam_message'],
609  'delete_message' => $aLanguageKeys['delete_message'],
610 
611  'message_id' => $aRow['ID'],
612  'message_actions' => $sMessageBoxActions,
613  'page_mode' => $sRelocateParameter,
614  );
615 
616  // build and return final template ;
617  $sOutputHtml = $oSysTemplate->parseHtmlByName( $this -> aUsedTemplates['view_message_box'], $aTemplateKeys );
618  }
619 
620  // if message nothing found ;
621  if ( !$rResult->rowCount() )
622  $sOutputHtml = MsgBox(_t( '_Empty' ) );
623 
624  return array($sOutputHtml, $aTopToggleEllements, array(), true);
625  }
626 
633  function getBlockCode_NewMessages($bShowEmpty = true)
634  {
636 
637  $aMessages = $this->getMessages();
638  if(empty($aMessages))
639  return $bShowEmpty ? MsgBox(_t('_Empty')) : '';
640 
641  $aTmplVars = array(
642  'ch_repeat:messages' => array()
643  );
644 
645  foreach($aMessages as $aMessage) {
646  $aTmplVars['ch_repeat:messages'][] = array(
647  'message_page' => 'mail.php',
648  'message_link' => $aMessage['ID'],
649  'member_icon' => get_member_icon($aMessage['Sender'], 'left'),
650  'member_nickname' => getNickName($aMessage['Sender']),
651  'message_ago' => defineTimeInterval($aMessage['DateTS']),
652  'message_subject' => $aMessage['Subject']
653  );
654  }
655 
656  return $oSysTemplate->parseHtmlByName('mail_box_short.html', $aTmplVars);
657  }
658 
665  {
667 
668  // init some nedded variables ;
669 
670  $sOutputHtml = null;
671 
672  // return all builded messages ;
673  $sMessageRows = $this -> genMessagesRows();
674 
675  // prepare for output ;
676  $aTemplateKeys = array
677  (
678  'current_page' => 'mail.php',
679  'mail_rows' => ( $sMessageRows ) ? $sMessageRows : MsgBox(_t( '_Empty' )),
680  'select_messages' => _t('_Please, select at least one message'),
681  'are_you_sure' => _t('_Are_you_sure'),
682  );
683 
684  // build and return final template ;
685  $sOutputHtml = $oSysTemplate -> parseHtmlByName( $this -> aUsedTemplates['messages_init_box'], $aTemplateKeys );
686 
687  // generate page toggle ellements ;
688  $aToggleItems = array
689  (
690  'inbox' => _t( '_Inbox' ),
691  'outbox' => _t( '_Outbox' ),
692  'trash' => _t( '_Trash' ),
693  'compose' => _t( '_Compose' ),
694  );
695 
696  $sRequest = 'mail.php' . '?';
697  foreach( $aToggleItems AS $sKey => $sValue ) {
698  $aTopToggleEllements[$sValue] = array
699  (
700  'href' => $sRequest . 'mode=' . $sKey,
701  'dynamic' => false,
702  'active' => ($this -> aMailBoxSettings['mailbox_mode'] == $sKey ),
703  );
704  }
705 
706  return array($sOutputHtml, $aTopToggleEllements, array(), true);
707  }
708 
715  {
717  $oFunctions,
718  $site;
719 
720  // init some needed variables;
721  $sFunctionNam = null;
722  $sOutputHtml = null;
723 
724  // set default top toggle menu item
725  $aRegisteredContacts_keys = array_keys($this -> aRegisteredContactTypes);
726  $sDefaultItem = $aRegisteredContacts_keys[0];
727 
728  if ( !$this -> aMailBoxSettings['contacts_mode'] )
729  $this -> aMailBoxSettings['contacts_mode'] = $sDefaultItem;
730 
731  // contain all found members ;
732  $aMembersList = array();
733  $aTopToggleEllements = array();
734  $aBottomToggleEllements = array();
735 
736  // define number of maximum members list for per page ;
737  if( $this -> aMailBoxSettings['contacts_page'] < 1 )
738  $this -> aMailBoxSettings['contacts_page'] = 1;
739 
740  $sLimitFrom = ( $this -> aMailBoxSettings['contacts_page'] - 1 ) * $this -> iContactsPerPage;
741  $sSqlLimit = "LIMIT {$sLimitFrom}, {$this -> iContactsPerPage}";
742 
743  if($this -> aMailBoxSettings['contacts_mode'] && array_key_exists($this -> aMailBoxSettings['contacts_mode'], $this -> aRegisteredContactTypes))
744  $sFunctionName = $this -> aRegisteredContactTypes[$this -> aMailBoxSettings['contacts_mode']];
745 
746  // default function name ;
747  if (!$sFunctionName )
748  $sFunctionName = $this -> aRegisteredContactTypes[$sDefaultItem];
749 
750  // generate the block of contacts;
751  if (method_exists($this, $sFunctionName)) {
752  // call registered method;
753  $aMembersList = $this -> $sFunctionName( $sSqlLimit );
754  if ( is_array($aMembersList) and !empty($aMembersList) ) {
755  $sComposeImg = getTemplateIcon('action_send.png');
756 
757  // generate list of members ;
758  foreach($aMembersList AS $sKey => $aProfileInfo ) {
759  $sMemberFlag = null;
760  $sMemberSexImg = null;
761 
762  $sMemberIcon = get_member_thumbnail($aProfileInfo['ID'], 'left');
763  $sMemberLocation = getProfileLink($aProfileInfo['ID']);
764 
765  $sMemberSexImg = ( isset($aProfileInfo['Sex']) ) ? $oFunctions -> genSexIcon($aProfileInfo['Sex']) : null;
766  $sMemberAge = ( isset($aProfileInfo['DateOfBirth']) && $aProfileInfo['DateOfBirth'] != "0000-00-00" )
767  ? _t( "_y/o", age($aProfileInfo['DateOfBirth']) )
768  : null;
769 
770 
771  if( isset($aProfileInfo['Country']) && $aProfileInfo['Country'] ) {
772  $sMemberFlag = $site['flags'] . strtolower($aProfileInfo['Country']) . $this -> sMembersFlagExtension;
773  }
774 
775  $sMemberCountryFlag = ($sMemberFlag)
776  ? '<img src="' . $sMemberFlag . '" alt="' . $aProfileInfo['Country'] . '" />'
777  : null;
778 
779  $aMemberKeys[] = array
780  (
781  'member_icon' => $sMemberIcon,
782  'member_location' => $sMemberLocation,
783  'member_nick_name' => getNickName($aProfileInfo['ID']),
784 
785  'member_sex_img' => $sMemberSexImg,
786  'member_sex_img_alt' => $aProfileInfo['Sex'],
787  'member_age' => $sMemberAge,
788  'member_flag' => $sMemberCountryFlag,
789  'member_country' => $aProfileInfo['Country'],
790 
791  'compose_img' => $sComposeImg,
792  'member_action_date' => $aProfileInfo['When'],
793  'member_id' => $aProfileInfo['ID'],
794  'current_page' => 'mail.php',
795  );
796  }
797  }
798 
799  // build the template ;
800  $aTemplateKeys = array
801  (
802  'ch_repeat:members' => $aMemberKeys,
803  );
804 
806  -> parseHtmlByName( $this -> aUsedTemplates['contacts_section'], $aTemplateKeys );
807 
808  }
809 
810 
811  // generate the top toggle ellements ;
812  $sRequest = 'mail.php?';
813  $sSelectedItem = ( $this -> aMailBoxSettings['contacts_mode'] )
814  ? $this -> aMailBoxSettings['contacts_mode']
815  : $sDefaultItem;
816 
817  // conatin recipient's ID;
818  $sRecipientParam = ($this -> aMailBoxSettings['recipient_id'])
819  ? '&recipient_id=' . $this -> aMailBoxSettings['recipient_id']
820  : null;
821 
822  foreach( $this -> aRegisteredContactTypes AS $sKey => $sValue ) {
823  $aTopToggleEllements[ _t('_' . $sKey) ] = array
824  (
825  'href' => $sRequest . '&mode=' . $this -> aMailBoxSettings['mailbox_mode'] . '&contacts_mode=' . $sKey . $sRecipientParam,
826  'dynamic' => true,
827  'active' => ($sSelectedItem == $sKey ),
828  );
829  }
830 
831  // generate bottom pagination section ;
832  $iAllContactPages = ceil( $this -> iTotalContactsCount / $this -> iContactsPerPage );
833  $aNeededParameters = array
834  (
835  'contacts_mode', 'recipient_id'
836  );
837 
838  // generate needed `GET` parameters ;
839  $sRequest = 'mail.php?';
840  foreach( $aNeededParameters AS $sKey ) {
841  if ( $this -> aMailBoxSettings[$sKey] )
842  $sRequest .= $sKey . '=' . $this -> aMailBoxSettings[$sKey] . '&';
843  }
844 
845  // next button ;
846  if ( $this -> aMailBoxSettings['contacts_page'] < $iAllContactPages ) {
847  $aBottomToggleEllements[ _t('_Next') ] = array
848  (
849  'href' => $sRequest . 'mode=' . $this -> aMailBoxSettings['mailbox_mode'] . '&contacts_page=' . ($this -> aMailBoxSettings['contacts_page'] + 1),
850  'dynamic' => true,
851  'class' => 'moreMembers',
852  );
853  }
854 
855  // prev button;
856  if ( $this -> aMailBoxSettings['contacts_page'] > 1 ) {
857  $aBottomToggleEllements[ _t('_Back') ] = array
858  (
859  'href' => $sRequest . 'mode=' . $this -> aMailBoxSettings['mailbox_mode'] . '&contacts_page=' . ($this -> aMailBoxSettings['contacts_page'] - 1),
860  'dynamic' => true,
861  'class' => 'backMembers',
862  );
863  }
864 
865  if ( empty($aMembersList) )
866  $sOutputHtml = MsgBox(_t( '_Empty' ));
867 
868  return array( $sOutputHtml, $aTopToggleEllements, $aBottomToggleEllements, false);
869  }
870 
877  {
879  $oFunctions,
880  $site;
881 
882  // ** INTERNAL FUNCTIONS ;
883 
891  function _genPaginationItem( $sItemType, $oObject )
892  {
894 
895  // init some needed variables ;
896  $sOutputHtml = null;
897 
898  switch($sItemType) {
899  case 'next' :
900 
901  $sLinkValue = _t('_Next');
902  $iNeededPage = $oObject -> aMailBoxSettings['contacts_page'] + 1;
903 
904  $aTemplateKeys = array
905  (
906  'item_img_src' => getTemplateIcon('next.png'),
907  'item_img_alt' => $sLinkValue,
908  'item_img_css_class' => 'bot_icon_right',
909  'item_link_action' => "oMailBoxArchive.getPaginatePage('{$iNeededPage}');return false",
910  'item_link_css_class' => 'moreMembers',
911  'item_link_href' => 'mail.php',
912  'item_link_value' => $sLinkValue,
913  );
914  break;
915  case 'prev' :
916  $sLinkValue = _t('_Back');
917  $iNeededPage = $oObject -> aMailBoxSettings['contacts_page'] - 1;
918 
919  $aTemplateKeys = array
920  (
921  'item_img_src' => getTemplateIcon('back.png'),
922  'item_img_alt' => $sLinkValue,
923  'item_img_css_class' => 'bot_icon_left',
924  'item_link_action' => "oMailBoxArchive.getPaginatePage('{$iNeededPage}');return false",
925  'item_link_css_class' => 'backMembers',
926  'item_link_href' => 'mail.php',
927  'item_link_value' => $sLinkValue,
928  );
929  break;
930  }
931 
932  if ( is_array($aTemplateKeys) ) {
934  -> parseHtmlByName( $oObject -> aUsedTemplates['archives_pagina_items'], $aTemplateKeys );
935  }
936 
937  return $sOutputHtml;
938  }
939 
940  // init some needed variables;
941 
942  $sFunctionName = null;
943  $sOutputHtml = null;
944  $sPaginationHtml = null;
945 
946  // set default top toggle menu item
947  $aRegisteredContacts_keys = array_keys($this -> aRegisteredArchivesTypes);
948  $sDefaultItem = $aRegisteredContacts_keys[0];
949 
950  if ( !$this -> aMailBoxSettings['contacts_mode'] )
951  $this -> aMailBoxSettings['contacts_mode'] = $sDefaultItem;
952 
953  // contain all found messages from member ;
954  $aMessagesList = array();
955 
956  // define number of maximum members list for per page ;
957  if( $this -> aMailBoxSettings['contacts_page'] < 1 )
958  $this -> aMailBoxSettings['contacts_page'] = 1;
959 
960  $sLimitFrom = ( $this -> aMailBoxSettings['contacts_page'] - 1 ) * $this -> iContactsPerPage;
961  $sSqlLimit = "LIMIT {$sLimitFrom}, {$this -> iContactsPerPage}";
962 
963  if($this->aMailBoxSettings['contacts_mode'] && array_key_exists($this -> aMailBoxSettings['contacts_mode'], $this -> aRegisteredArchivesTypes))
964  $sFunctionName = $this -> aRegisteredArchivesTypes[$this -> aMailBoxSettings['contacts_mode']];
965 
966  // default function name ;
967  if (!$sFunctionName )
968  $sFunctionName = $this -> aRegisteredArchivesTypes[$sDefaultItem];
969 
970  // generate the block of contacts archive;
971  if ( method_exists($this, $sFunctionName) ) {
972  // call registered method;
973  $aMessagesList = $this -> $sFunctionName( $sSqlLimit );
974  if ( is_array($aMessagesList) and !empty($aMessagesList) ) {
975  foreach($aMessagesList AS $iKey => $aItems ) {
976  $sMemberIcon = get_member_thumbnail($aItems['Sender'], 'left');
977  $sMessageSubject = (mb_strlen($aItems['Subject']) > $this -> iArchivesSubjectLength)
978  ? mb_substr($aItems['Subject'], 0, $this -> iArchivesSubjectLength) . '...'
979  : $aItems['Subject'];
980 
981  $sMessageLink = ( $aItems['ID'] == $this -> aMailBoxSettings['messageID'] )
983  : '<a href="mail.php?mode=view_message&messageID=' . $aItems['ID']. '">' . $sMessageSubject . '</a>';
984 
985  $aMessageKeys[] = array
986  (
987  'member_icon' => $sMemberIcon,
988 
989  'current_page' => 'mail.php',
990  'message_id' => $aItems['ID'],
991  'message_owner' => $aItems['Sender'],
992  'message_subject' => $sMessageLink,
993 
994  'message_date' => $aItems['When'],
995  'message_new_src' => ( $aItems['New'] ) ? getTemplateIcon('new_message.png') : getTemplateIcon(null),
996  );
997  }
998 
999  // build final template ;
1000  $aTemplateKeys = array
1001  (
1002  'contacts_mode' => $this -> aMailBoxSettings['contacts_mode'],
1003  'message_id' => $this -> aMailBoxSettings['messageID'],
1004  'ch_repeat:messages' => $aMessageKeys,
1005  );
1006 
1007  $sOutputHtml .= $oSysTemplate -> parseHtmlByName( $this -> aUsedTemplates['archives_section'], $aTemplateKeys );
1008  }
1009  }
1010 
1011  // generate the bottom pagination section ;
1012  $sPaginationHtml = '';
1013  $iAllContactPages = ceil( $this -> iTotalContactsCount / $this -> iContactsPerPage );
1014  if($iAllContactPages > 1) {
1015  $aNeededParameters = array (
1016  'contacts_mode', 'messageID',
1017  );
1018 
1019  // generate needed `GET` parameters ;
1020  $sRequest = 'mail.php?';
1021  foreach($aNeededParameters AS $sKey)
1022  $sRequest .= $sKey . '=' . $this -> aMailBoxSettings[$sKey] . '&';
1023 
1024  // build the pagination template;
1025  $aTemplateKeys = array (
1026  'prev_link' => ( $this -> aMailBoxSettings['contacts_page'] > 1 ) ? _genPaginationItem('prev', $this) : null,
1027  'next_link' => ( $this -> aMailBoxSettings['contacts_page'] < $iAllContactPages ) ? _genPaginationItem('next', $this) : null,
1028  );
1029 
1030  $sPaginationHtml .= $oSysTemplate -> parseHtmlByName( $this -> aUsedTemplates['archives_pagina_section'], $aTemplateKeys );
1031  }
1032 
1033  //archives_pagina_section
1034  if ( empty($sOutputHtml) )
1035  $sOutputHtml = MsgBox(_t( '_Empty' ));
1036 
1037  return $sOutputHtml . $sPaginationHtml;
1038  }
1039 
1045  function genMessagesRows()
1046  {
1049  global $site;
1050 
1051  // init some needed variables ;
1052 
1053  $sOutputHtml = null;
1054  $sMessageBoxActions = null;
1055  $sMessagesTypesList = null;
1056  $sPerPageBlock = null;
1057 
1058  $aSortToglleElements = array
1059  (
1060  'date_sort_toggle', 'subject_sort_toggle',
1061  'type_sort_toggle', 'author_sort_toggle',
1062  );
1063 
1064  $aMessageRows = array();
1065 
1066  // language keys ;
1067  $aLanguageKeys = array
1068  (
1069  'author' => _t( '_Author' ),
1070  'type' => _t( '_Type' ),
1071  'subject' => _t( '_Subject' ),
1072  'date' => _t( '_Date' ),
1073  'new' => _t( '_new' ),
1074  'contact' => _t( '_Contact' ),
1075  'select' => _t( '_Select' ),
1076  'all' => _t( '_All' ),
1077  'none' => _t( '_None' ),
1078  'read' => _t( '_Read' ),
1079  'unread' => _t( '_Unread' ),
1080  'delete' => _t( '_Delete' ),
1081  'spam' => _t( '_Report' ),
1082  'more' => _t( '_More actions' ),
1083  'mark_read' => _t( '_Mark as old' ),
1084  'mark_unread'=> _t( '_Mark as New' ),
1085  'restore' => _t( '_Restore' ),
1086  'click_sort' => _t( '_Click to sort' ),
1087  'recipient' => _t( '_Recipient' ),
1088  );
1089 
1090  // get messages array ;
1091  $aMessages = &$this -> getMessages();
1092 
1093  // generate list of messages types
1094  if ( is_array($this -> aRegisteredMessageTypes) and !empty($this -> aRegisteredMessageTypes) ) {
1095  foreach( $this -> aRegisteredMessageTypes AS $iKey => $sRegisteredType ) {
1096  $sChecked = null;
1097  if ( !empty($this -> aReceivedMessagesTypes) and in_array($sRegisteredType, $this -> aReceivedMessagesTypes) ) {
1098  $sChecked = ' checked="checked" ';
1099  }
1100 
1101  $aTemplateKeys = array
1102  (
1103  'letters_type' => $sRegisteredType,
1104  'letters_type_caption' => _t( '_' . $sRegisteredType ),
1105  'checked' => $sChecked,
1106  );
1107 
1108  $sMessagesTypesList .= $oSysTemplate
1109  -> parseHtmlByName( $this -> aUsedTemplates['messages_types_list'], $aTemplateKeys );
1110  }
1111  unset($aTemplateKeys);
1112  }
1113 
1114  // processing all messages ;
1115  if ( is_array($aMessages) and !empty($aMessages) ) {
1116  // need for row devide ;
1117  $iIndex = 1;
1118  foreach( $aMessages as $iKey => $aItems ) {
1119  // generate image and keyword for type of message ;
1120  $sTypeIcon = getTemplateIcon( $this -> sMessageIconPrefix . $aItems['Type'] . $this -> sMessageIconExtension );
1121  $sTypeLang = _t( '_' . $aItems['Type'] );
1122 
1123  // get message's subject ;
1124  $sSubject = ( mb_strlen($aItems['Subject']) > $this -> iMessageSubjectLength )
1125  ? mb_substr($aItems['Subject'], 0, $this -> iMessageSubjectLength) . '...'
1126  : $aItems['Subject'];
1127 
1128  // get message's description ;
1129  $sDescription = strip_tags($aItems['Text']);
1130  ( mb_strlen($sDescription) > $this -> iMessageDescrLength )
1131  ? $sDescription = mb_substr($sDescription, 0, $this -> iMessageDescrLength) . '...'
1132  : null;
1133 
1134  // generate the `new` message's icon ;
1135  $sNewMessageImg = ($aItems['New']) ? getTemplateIcon('new_message.png') : getTemplateIcon(null);
1136 
1137  // color devider ;
1138  $sFiledCss = !( $iIndex % 2 ) ? 'filled' : 'not_filled';
1139 
1140  $aProfileInfo = $this -> aMailBoxSettings['mailbox_mode'] != 'outbox'
1141  ? getProfileInfo($aItems['Sender'])
1142  : getProfileInfo($aItems['Recipient']);
1143 
1144  $sMemberIcon = $this -> aMailBoxSettings['mailbox_mode'] != 'outbox'
1145  ? get_member_thumbnail($aItems['Sender'], 'left')
1146  : get_member_thumbnail($aItems['Recipient'], 'left');
1147 
1148  $sMemberLocation = $this -> aMailBoxSettings['mailbox_mode'] != 'outbox'
1149  ? getProfileLink($aItems['Sender'])
1150  : getProfileLink($aItems['Recipient']);
1151 
1152  $sMemberNickName = getNickName($aProfileInfo['ID']);
1153  $sMemberAge = ( $aProfileInfo['DateOfBirth'] != "0000-00-00" )
1154  ? _t( "_y/o", age($aProfileInfo['DateOfBirth']) )
1155  : null;
1156 
1157  $sMemberCountry = $aProfileInfo['Country'];
1158  $sMemberFlag = $site['flags'] . strtolower($sMemberCountry) . $this -> sMembersFlagExtension;
1159  $sMemberSexImg = $oFunctions -> genSexIcon($aProfileInfo['Sex']);
1160 
1161  if ( $sMemberCountry )
1162  $sMemberCountryFlag = '<img src="' . $sMemberFlag . '" alt="' . $sMemberCountry . '" />';
1163 
1164  // generate the message status ;
1165  $sMessageStatus = ($aItems['New']) ? 'unread' : 'read';
1166 
1167  $aMessageRows[] = array
1168  (
1169  'message_id' => $aItems['ID'],
1170  'message_status' => $sMessageStatus,
1171  'message_owner' => $aItems['Sender'],
1172  'message_link' => $aItems['ID'],
1173  'message_page' => 'mail.php',
1174 
1175  'member_icon' => $sMemberIcon,
1176  'member_location' => $sMemberLocation,
1177  'member_nickname' => $sMemberNickName,
1178  'member_sex_img' => $sMemberSexImg,
1179  'member_sex' => $aProfileInfo['Sex'],
1180  'member_age' => $sMemberAge,
1181  'member_flag' => $sMemberCountryFlag,
1182  'member_country' => $sMemberCountry,
1183 
1184  'message_type' => $sTypeLang,
1185  'message_type_icon' => $sTypeIcon,
1186 
1187  'message_subject' => $sSubject,
1188  'ch_if:show_new' => array(
1189  'condition' => $aItems['New'],
1190  'content' => array()
1191  ),
1192  'message_descr' => $sDescription,
1193 
1194  'message_new_img' => $sNewMessageImg,
1195  'message_new' => $aLanguageKeys['new'],
1196  'message_contact_url' => CH_WSB_URL_ROOT . "mail.php?mode=compose&recipient_id=" . $aProfileInfo['ID'],
1197  'message_contact' => $aLanguageKeys['contact'],
1198 
1199  'message_date' => $aItems['Date'],
1200  'message_ago' => defineTimeInterval($aItems['DateTS']),
1201  'filled_class' => $sFiledCss,
1202  );
1203  $iIndex++;
1204  }
1205  }
1206 
1207  // init sort toggle ellements ;
1208  switch ( $this -> aMailBoxSettings['sort_mode'] ) {
1209  case 'date' :
1210  $aSortToglleElements['date_sort_toggle'] = 'toggle_up';
1211  break;
1212  case 'date_desc' :
1213  $aSortToglleElements['date_sort_toggle'] = 'toggle_down';
1214  break;
1215  case 'subject' :
1216  $aSortToglleElements['subject_sort_toggle'] = 'toggle_up';
1217  break;
1218  case 'subject_desc' :
1219  $aSortToglleElements['subject_sort_toggle'] = 'toggle_down';
1220  break;
1221  case 'type' :
1222  $aSortToglleElements['type_sort_toggle'] = 'toggle_up';
1223  break;
1224  case 'type_desc' :
1225  $aSortToglleElements['type_sort_toggle'] = 'toggle_down';
1226  break;
1227  case 'author' :
1228  $aSortToglleElements['author_sort_toggle'] = 'toggle_up';
1229  break;
1230  case 'author_desc' :
1231  $aSortToglleElements['author_sort_toggle'] = 'toggle_down';
1232  break;
1233  }
1234 
1235  // generate the pagination ;
1236  $sRequest = CH_WSB_URL_ROOT . 'mail.php?';
1237 
1238  // need for additional parameters ;
1239  $aGetParams = array('mode', 'sorting', 'messages_types');
1240  if ( is_array($aGetParams) and !empty($aGetParams) )
1241  foreach($aGetParams AS $sValue )
1242  if ( isset($_GET[$sValue]) ) {
1243  $sRequest .= '&amp;' . $sValue . '=' . $_GET[$sValue];
1244  }
1245 
1246  $sCuttedUrl = $sRequest;
1247  $sRequest = $sRequest . '&amp;page={page}&amp;per_page={per_page}';
1248  $oPaginate = new ChWsbPaginate
1249  (
1250  array
1251  (
1252  'page_url' => $sRequest,
1253  'count' => $this -> iTotalMessageCount,
1254  'per_page' => $this -> aMailBoxSettings['per_page'],
1255  'sorting' => $this -> aMailBoxSettings['sort_mode'],
1256  'page' => $this -> aMailBoxSettings['page'],
1257 
1258  'on_change_page' => "oMailBoxMessages.getPaginatePage('{$sRequest}')",
1259  'on_change_per_page' => "oMailBoxMessages.getPage(this.value, '{$sCuttedUrl}')",
1260  )
1261  );
1262  $sPagination = $oPaginate -> getPaginate();
1263 
1264  // generate messages section
1265  if ( !empty($aMessageRows) ) {
1266  $aTemplateKeys = array
1267  (
1268  'per_page' => $this -> aMailBoxSettings['per_page'],
1269  'page_number' => $this -> aMailBoxSettings['page'],
1270  'page_mode' => $this -> aMailBoxSettings['mailbox_mode'],
1271  'messages_types' => $this -> aMailBoxSettings['messages_types'],
1272 
1273  'messages_types_list' => $sMessagesTypesList,
1274  'per_page_block' => $oPaginate -> getPages(),
1275 
1276  'author' => $this -> aMailBoxSettings['mailbox_mode'] != 'outbox'
1277  ? $aLanguageKeys['author']
1278  : $aLanguageKeys['recipient'],
1279 
1280  'type' => $aLanguageKeys['type'],
1281  'subject' => $aLanguageKeys['subject'],
1282  'date' => $aLanguageKeys['date'],
1283  'click_sort' => $aLanguageKeys['click_sort'],
1284  'ch_repeat:messages' => $aMessageRows,
1285 
1286  'sort_date' => ( $this -> aMailBoxSettings['sort_mode'] == 'date' ) ? 'date_desc' : 'date',
1287  'sort_subject' => ( $this -> aMailBoxSettings['sort_mode'] == 'subject' ) ? 'subject_desc' : 'subject',
1288  'sort_type' => ( $this -> aMailBoxSettings['sort_mode'] == 'type' ) ? 'type_desc' : 'type',
1289  'sort_author' => ( $this -> aMailBoxSettings['sort_mode'] == 'author' ) ? 'author_desc' : 'author',
1290 
1291  'date_sort_toggle_ellement' => $aSortToglleElements['date_sort_toggle'],
1292  'subject_sort_toggle_ellement' => $aSortToglleElements['subject_sort_toggle'],
1293  'type_sort_toggle_ellement' => $aSortToglleElements['type_sort_toggle'],
1294  'author_sort_toggle_ellement' => $aSortToglleElements['author_sort_toggle'],
1295 
1296  'current_page' => 'mail.php',
1297  'select' => $aLanguageKeys['select'],
1298  'all_messages' => $aLanguageKeys['all'],
1299  'none_messages' => $aLanguageKeys['none'],
1300  'read_messages' => $aLanguageKeys['read'],
1301  'unread_messages' => $aLanguageKeys['unread'],
1302 
1303  'pagination_block' => $sPagination,
1304  );
1305 
1306  // generate extended mailbox actions
1307  switch($this -> aMailBoxSettings['mailbox_mode']) {
1308  case 'inbox' :
1309  $aForm = array (
1310  'form_attrs' => array (
1311  'action' => null,
1312  'method' => 'post',
1313  ),
1314 
1315  'params' => array (
1316  'remove_form' => true,
1317  'db' => array(
1318  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
1319  ),
1320  ),
1321 
1322  'inputs' => array(
1323  'actions' => array(
1324  'type' => 'input_set',
1325  'colspan' => 'true',
1326  array (
1327  'type' => 'button',
1328  'value' => $aLanguageKeys['delete'],
1329  'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.deleteMessages(\'messages_container\', \'genMessagesRows\')', 'class' => 'ch-btn-small'),
1330  ),
1331  array (
1332  'type' => 'button',
1333  'value' => $aLanguageKeys['spam'],
1334  'attrs' => array('onclick' => 'if (typeof oMailBoxMessages != \'undefined\') oMailBoxMessages.spamMessages(\'messages_container\')', 'class' => 'ch-btn-small'),
1335  ),
1336  array (
1337  'type' => 'button',
1338  'value' => $aLanguageKeys['mark_read'],
1339  'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.markMessages(\'read\', \'genMessagesRows\')', 'class' => 'ch-btn-small'),
1340  ),
1341  array (
1342  'type' => 'button',
1343  'value' => $aLanguageKeys['mark_unread'],
1344  'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.markMessages(\'unread\', \'genMessagesRows\')', 'class' => 'ch-btn-small'),
1345  )
1346  )
1347  )
1348  );
1349 
1350  $oForm = new ChTemplFormView($aForm);
1351  $sMessageBoxActions = $oForm -> getCode();
1352  break;
1353 
1354  case 'outbox' :
1355  $aForm = array (
1356  'form_attrs' => array (
1357  'action' => null,
1358  'method' => 'post',
1359  ),
1360 
1361  'params' => array (
1362  'remove_form' => true,
1363  'db' => array(
1364  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
1365  ),
1366  ),
1367 
1368  'inputs' => array(
1369  'actions' => array(
1370  'type' => 'input_set',
1371  'colspan' => 'true',
1372  0 => array (
1373  'type' => 'button',
1374  'value' => $aLanguageKeys['delete'],
1375  'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.deleteMessages(\'messages_container\', \'genMessagesRows\')', 'class' => 'ch-btn-small'),
1376  ),
1377  )
1378  )
1379  );
1380 
1381  $oForm = new ChTemplFormView($aForm);
1382  $sMessageBoxActions = $oForm -> getCode();
1383  break;
1384 
1385  case 'trash' :
1386  $aForm = array (
1387  'form_attrs' => array (
1388  'action' => null,
1389  'method' => 'post',
1390  ),
1391 
1392  'params' => array (
1393  'remove_form' => true,
1394  'db' => array(
1395  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
1396  ),
1397  ),
1398 
1399  'inputs' => array(
1400  'actions' => array(
1401  'type' => 'input_set',
1402  'colspan' => 'true',
1403  0 => array (
1404  'type' => 'button',
1405  'value' => $aLanguageKeys['restore'],
1406  'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.restoreMessages(\'messages_container\', \'genMessagesRows\')', 'class' => 'ch-btn-small'),
1407  ),
1408  1 => array (
1409  'type' => 'button',
1410  'value' => $aLanguageKeys['delete'],
1411  'attrs' => array('onclick' => 'if ( typeof oMailBoxMessages != \'undefined\' ) oMailBoxMessages.hideDeletedMessages(\'messages_container\', \'genMessagesRows\')', 'class' => 'ch-btn-small'),
1412  ),
1413  ),
1414  )
1415  );
1416 
1417  $oForm = new ChTemplFormView($aForm);
1418  $sMessageBoxActions = $oForm -> getCode();
1419  break;
1420  }
1421 
1422  $aTemplateKeys['messages_actions_block'] = $sMessageBoxActions;
1423 
1424  //return builded rows ;
1425  $sMessagesSection = $oSysTemplate -> parseHtmlByName( $this -> aUsedTemplates['messages_box'], $aTemplateKeys );
1426  $sPerPageBlock = $oPaginate -> getPages();
1427  } else
1428  $sMessagesSection = MsgBox( _t('_Empty') );
1429 
1430  // generate mailboxe's top section ;
1431  $sTopControls = $oSysTemplate -> parseHtmlByName('mail_box_messages_list_top_controls.html', array(
1432  'messages_types_list' => $sMessagesTypesList,
1433  'per_page_block' => $sPerPageBlock,
1434  ));
1435 
1436  $aTemplateKeys = array (
1437  'per_page' => $this -> aMailBoxSettings['per_page'],
1438  'page_number' => $this -> aMailBoxSettings['page'],
1439  'page_mode' => $this -> aMailBoxSettings['mailbox_mode'],
1440  'messages_types' => $this -> aMailBoxSettings['messages_types'],
1441  'messages_sort' => $this -> aMailBoxSettings['sort_mode'],
1442  'top_controls' => $sTopControls,
1443  'messages_section' => $sMessagesSection
1444  );
1445 
1446  $sOutputHtml = $oSysTemplate -> parseHtmlByName('mail_box_messages_list.html', $aTemplateKeys);
1447 
1448  // return all builded data ;
1449  return $sOutputHtml;
1450  }
1451 
1459  function genReplayMessage($iRecipientID, $iMessageID = 0)
1460  {
1462 
1463  $iMessageID = (int) $iMessageID;
1464  $iRecipientID = (int) $iRecipientID;
1465 
1466  // check if send message is allowed
1467  $aComposeSettings = array();
1468  $sErrMsg = $this->sendMessage('', '', $iRecipientID, $aComposeSettings, true);
1469  if ($sErrMsg)
1470  return $sErrMsg;
1471 
1472  // init some needed variables ;
1473  $sOutputHtml = '';
1474  $aMemberInfo = getProfileInfo($this->aMailBoxSettings['member_id']);
1475  $aRecipientInfo = getProfileInfo($iRecipientID);
1476 
1477  $aLanguageKeys = array
1478  (
1479  'information' => ( $iMessageID ) ? _t( '_Reply' ) : _t( '_COMPOSE_H1' ),
1480  'cancel' => ch_js_string( _t('_Cancel') ),
1481  'send' => ch_js_string( _t('_Send') ),
1482  'send_copy' => _t( '_Send copy to personal email', $aRecipientInfo['NickName'] ),
1483  'send_copy_my' => _t( '_Send copy to my personal email' ),
1484  'notify' => _t( '_Notify by e-mail', $aRecipientInfo['NickName'] ),
1485  'error_message' => ch_js_string( _t('_please_fill_next_fields_first') ),
1486  );
1487 
1488  if ( !empty($aMemberInfo) && !empty($aRecipientInfo) ) {
1489  // ** generate recipient's information ;
1490 
1491  $sMemberIcon = get_member_thumbnail($this->aMailBoxSettings['member_id'], 'none');
1492  $sMemberNickName = getNickName($aMemberInfo['ID']);
1493  $sMemberLocation = getProfileLink($aMemberInfo['ID']);
1494 
1495  $sCurrentDate = date('d.m.Y G:i');
1496 
1498  ? $this->addReToSubject(db_value
1499  (
1500  "
1501  SELECT
1502  `Subject`
1503  FROM
1504  `sys_messages`
1505  WHERE
1506  `ID` = {$iMessageID}
1507  AND
1508  (
1509  `Sender` = {$this -> aMailBoxSettings['member_id']}
1510  OR
1511  `Recipient` = {$this -> aMailBoxSettings['member_id']}
1512  )
1513  "
1514  ))
1515  : null;
1516 
1517  $aForm = array (
1518  'form_attrs' => array (
1519  'action' => null,
1520  'method' => 'post',
1521  ),
1522 
1523  'params' => array (
1524  'remove_form' => true,
1525  'db' => array(
1526  'submit_name' => 'do_submit', // some filed name with non empty value to determine if the for was submitted,
1527  ),
1528  ),
1529 
1530  'inputs' => array(
1531  'actions' => array(
1532  'type' => 'input_set',
1533  'colspan' => 'true',
1534  0 => array (
1535  'type' => 'button',
1536  'value' => $aLanguageKeys['send'],
1537  'attrs' => array('onclick' => 'if(typeof oMailBoxReplayMessage != \'undefined\') oMailBoxReplayMessage.sendMessage(' . $iRecipientID . ')'),
1538  ),
1539  1 => array (
1540  'type' => 'button',
1541  'value' => $aLanguageKeys['cancel'],
1542  'attrs' => array('onclick' => 'if(typeof oMailBoxReplayMessage != \'undefined\') oMailBoxReplayMessage.cancelReplay()'),
1543  ),
1544  )
1545  )
1546  );
1547 
1548  $oForm = new ChTemplFormView($aForm);
1549  $sMessageBoxActions = $oForm -> getCode();
1550 
1551  $aTemplateKeys = array
1552  (
1553  'error_message' => $aLanguageKeys['error_message'],
1554  'current_page' => 'mail.php',
1555 
1556  'information' => $aLanguageKeys['information'],
1557 
1558  'member_thumbnail' => $sMemberIcon,
1559  'member_nick_name' => $sMemberNickName,
1560  'member_location' => $sMemberLocation,
1561 
1562  'date_create' => $sCurrentDate,
1563 
1564  'message_subject' => $sMessageSubject,
1565 
1566  'send_copy_my' => $aLanguageKeys['send_copy_my'],
1567  'send_copy_to' => $aLanguageKeys['send_copy'],
1568  'notify' => $aLanguageKeys['notify'],
1569 
1570  'action_buttons' => $sMessageBoxActions,
1571  );
1572 
1574  -> parseHtmlByName( $this -> aUsedTemplates['message_replay'], $aTemplateKeys );
1575  }
1576 
1577  ch_import('ChWsbEditor');
1578  $oEditor = ChWsbEditor::getObjectInstance();
1579  $sEditor = '';
1580  if ($oEditor) {
1581  $oEditor->setCustomConf ("remove_script_host: false,\nrelative_urls: false,\n");
1582  $sEditor = $oEditor->attachEditor ('#compose_message', CH_EDITOR_FULL, $this->bAjaxMode);
1583  }
1584 
1585  return $sEditor . $sOutputHtml;
1586  }
1592  function addReToSubject($sSubject)
1593  {
1594  if (preg_match('/^(Re)(\[(\d+)\])?\:\s?(.*)$/i', $sSubject, $aMatches)) {
1595  //echoDbg($aMatches);
1596  $iRe = empty($aMatches[3]) ? 1 : (int)$aMatches[3];
1597 
1598  $sSubject = $aMatches[1] . '[' . ($iRe + 1) . ']: ' . $aMatches[4];
1599  } else {
1600  $sSubject = 'Re: ' . $sSubject;
1601  }
1602 
1603  return $sSubject;
1604  }
1605 
1614  function getAutoCompleteList($sQuery, $iLimit = 10 )
1615  {
1616  $aFields = array ('NickName');
1617  ch_import('ChWsbMemberInfo');
1618  $o = ChWsbMemberInfo::getObjectInstance(getParam('sys_member_info_name'));
1619  if ($o)
1620  $aFields = $o->getMemberNameFields();
1621 
1622  // init some needed variables ;
1623  $iLimit = (int) $iLimit;
1624  $sQuery = process_db_input($sQuery, CH_TAGS_STRIP);
1625 
1626  $sWhere = '';
1627  foreach ($aFields as $sField)
1628  $sWhere .= "`{$sField}` LIKE '%{$sQuery}%' OR ";
1629  $sWhere .= '0';
1630 
1631  $sQuery = "SELECT `ID`, `NickName` FROM `Profiles` WHERE $sWhere LIMIT {$iLimit}";
1632  $rResult = db_res($sQuery);
1633  $aOutput = array();
1634  while( true == ($aRow = $rResult->fetch()) )
1635  $aOutput[] = array('id' => $aRow['ID'], 'value' => getNickName($aRow['ID']));
1636 
1637  return json_encode($aOutput);
1638  }
1639 
1649  public static function get_member_menu_bubble_new_messages($iMemberId, $iOldCount = 0)
1650  {
1652 
1653  $iMemberId = (int) $iMemberId;
1654  $iOldCount = (int) $iOldCount;
1655 
1656  $iNewMessages = 0;
1657  $aNotifyMessages = array();
1658 
1659  if ( $iMemberId ) {
1660 
1661  $sQuery =
1662  "
1663  SELECT
1664  `ID`, `Sender`, `Type`
1665  FROM
1666  `sys_messages`
1667  WHERE
1668  (
1669  `Recipient` = {$iMemberId}
1670  AND
1671  NOT FIND_IN_SET('Recipient', `Trash`)
1672  )
1673  AND
1674  `New` = '1'
1675  ORDER BY
1676  `Date`
1677  ";
1678 
1679  $rResult = db_res($sQuery);
1680  $aMessages = array();
1681  while( true == ($aRow = $rResult->fetch()) ) {
1682  $aMessages[] = array($aRow['ID'], $aRow['Sender'], $aRow['Type']);
1683  }
1684 
1685  $iNewMessages = count($aMessages);
1686 
1687  // if have some difference;
1688  if ( $iNewMessages > $iOldCount) {
1689  // generate notify messages;
1690  for( $i = $iOldCount; $i < $iNewMessages; $i++) {
1691  $aKeys = array (
1692  'sender_thumb' => $oFunctions -> getMemberIcon($aMessages[$i][1], 'left'),
1693  'sender_nickname' => getNickName($aMessages[$i][1]),
1694  'message_id' => $aMessages[$i][0],
1695 
1696  'sent_key' => _t( '_Sent you a' ),
1697  'letter_key' => _t( '_' . $aMessages[$i][2] ),
1698  );
1699  $sMessage = $oSysTemplate -> parseHtmlByName('mail_box_notify_window.html', $aKeys);
1700 
1701  $aNotifyMessages[] = array(
1702  'message' => $oSysTemplate
1703  -> parseHtmlByName('member_menu_notify_window.html', array('message' => $sMessage))
1704  );
1705  }
1706  }
1707  }
1708 
1709  $aRetEval = array(
1710  'count' => $iNewMessages,
1711  'messages' => $aNotifyMessages,
1712  );
1713 
1714  return $aRetEval;
1715  }
1716 
1724  {
1726 
1727  $iMemberId = (int) $iMemberId;
1728 
1729  // define the member's menu position ;
1730  $sExtraMenuPosition = ( isset($_COOKIE['menu_position']) )
1731  ? $_COOKIE['menu_position']
1732  : getParam( 'ext_nav_menu_top_position' );
1733 
1734  $aNewMessages = array();
1735  $aLanguageKeys = array (
1736  'sent' => _t('_Sent'),
1737  'compose' => _t('_Compose new letter'),
1738  'trash' => _t('_Trash'),
1739  'inbox' => _t('_Inbox'),
1740  );
1741 
1742  // ** Get statistics ;
1743 
1744  // get count of inbox messages;
1746 
1747  // get count of sent messages ;
1749 
1750  // get count of trashed messages ;
1752 
1753  // generate member's new messages list ;
1754  if ( $iMemberId ) {
1755 
1756  // generate list with unread messages list ;
1757  $sQuery =
1758  "
1759  SELECT
1760  `ID`, `Sender`, `Subject`
1761  FROM
1762  `sys_messages`
1763  WHERE
1764  `Recipient`={$iMemberId}
1765  AND
1766  `New`='1'
1767  AND
1768  NOT FIND_IN_SET('Recipient', `Trash`)
1769  ORDER BY
1770  `Date` DESC
1771  LIMIT 5
1772  ";
1773 
1774  $rResult = db_res($sQuery);
1775  while( true == ($aRow = $rResult->fetch()) ) {
1776  $aMemberInfo = getProfileInfo($aRow['Sender']);
1777  $sThumb = $oFunctions -> getMemberIcon($aMemberInfo['ID'], 'none');
1778 
1779  $sSubject = ( mb_strlen($aRow['Subject']) > 40 )
1780  ? mb_substr($aRow['Subject'], 0, 40) . '...'
1781  : $aRow['Subject'];
1782 
1783  $aNewMessages[] = array(
1784  'sender_link' => getProfileLink($aMemberInfo['ID']),
1785  'sender_nick' => getNickName($aMemberInfo['ID']),
1786  'msg_caption' => $sSubject,
1787  'thumbnail' => $sThumb,
1788  'message_id' => $aRow['ID'],
1789  'site_url' => $GLOBALS['site']['url'],
1790  );
1791  }
1792  }
1793 
1794  $aExtraSection = array(
1795  'go_inbox' => $aLanguageKeys['inbox'],
1796  'inbox_count' => $iInboxCount,
1797 
1798  'go_outbox' => $aLanguageKeys['sent'],
1799  'outbox_count' => $iSentCount,
1800 
1801  'go_trash' => $aLanguageKeys['trash'],
1802  'trash_count' => $iTrashCount,
1803 
1804  'go_compose' => $aLanguageKeys['compose'],
1805  );
1806 
1807  // fill array with needed keys ;
1808  $aTemplateKeys = array (
1809 
1810  'ch_if:menu_position_bottom' => array (
1811  'condition' => ( $sExtraMenuPosition == 'bottom' ),
1812  'content' => $aExtraSection,
1813  ),
1814 
1815  'ch_if:menu_position_top' => array (
1816  'condition' => ( $sExtraMenuPosition == 'top' || $sExtraMenuPosition == 'static' ),
1817  'content' => $aExtraSection,
1818  ),
1819 
1820  'ch_repeat:new_message' => $aNewMessages,
1821  );
1822 
1823  $sOutputCode = $oSysTemplate
1824  -> parseHtmlByName( 'mail_box_member_menu_messages.html', $aTemplateKeys );
1825 
1826  return $sOutputCode;
1827  }
1828  }
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
CH_WSB_LOCALE_DATE
const CH_WSB_LOCALE_DATE
Definition: utils.inc.php:16
$aMembersList
$aMembersList
Definition: communicator.php:22
$sMessage
$sMessage
Definition: actions.inc.php:17
$iMemberId
$iMemberId
Definition: profile.php:91
ChWsbMemberInfo\getObjectInstance
static getObjectInstance($sObject)
Definition: ChWsbMemberInfo.php:39
ChTemplFormView
Definition: ChTemplFormView.php:11
$sOutputHtml
$sOutputHtml
Definition: browse.php:86
ChBaseMailBox\genArchiveMessages
genArchiveMessages()
Definition: ChBaseMailBox.php:876
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
$sLimitFrom
$sLimitFrom
Definition: post_mod_crss.php:49
ChBaseMailBox\$iArchivesSubjectLength
$iArchivesSubjectLength
Definition: ChBaseMailBox.php:27
ch_js_string
ch_js_string($mixedInput, $iQuoteType=CH_ESCAPE_STR_AUTO)
Definition: utils.inc.php:1294
defineTimeInterval
defineTimeInterval($iTime, $bAutoDateConvert=true, $bShort=false)
Definition: utils.inc.php:831
get_member_icon
get_member_icon($ID, $float='none', $bGenProfLink=false)
Definition: design.inc.php:170
$aComposeSettings
$aComposeSettings
Definition: mail.php:115
$_page
$_page['name_index']
Definition: about_us.php:13
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChBaseMailBox\$sMessageIconExtension
$sMessageIconExtension
Definition: ChBaseMailBox.php:18
ChWsbMailBox\$aMailBoxSettings
$aMailBoxSettings
Definition: ChWsbMailBox.php:34
ChBaseMailBox\$sMessageIconPrefix
$sMessageIconPrefix
Definition: ChBaseMailBox.php:17
php
ChBaseMailBox\genMessagesRows
genMessagesRows()
Definition: ChBaseMailBox.php:1045
ChWsbMailBox\getMessages
getMessages()
Definition: ChWsbMailBox.php:455
ChBaseMailBox\__construct
__construct( $sPageName, &$aMailBoxSettings)
Definition: ChBaseMailBox.php:45
ChWsbPageView\getCode
getCode()
Definition: ChWsbPageView.php:261
ChBaseMailBox\getBlockCode_Contacts
getBlockCode_Contacts()
Definition: ChBaseMailBox.php:714
$aMemberInfo
$aMemberInfo
Definition: profile_info.php:34
isAdmin
isAdmin()
Definition: index.php:649
ChBaseMailBox\getBlockCode_MailBox
getBlockCode_MailBox()
Definition: ChBaseMailBox.php:664
$oFunctions
$oFunctions
Definition: ChTemplFunctions.php:20
ChBaseMailBox\addReToSubject
addReToSubject($sSubject)
Definition: ChBaseMailBox.php:1592
$oForm
$oForm
Definition: host_tools.php:42
ChBaseMailBox\getBlockCode_ViewMessage
getBlockCode_ViewMessage()
Definition: ChBaseMailBox.php:316
ChBaseMailBox\getAutoCompleteList
getAutoCompleteList($sQuery, $iLimit=10)
Definition: ChBaseMailBox.php:1614
ChBaseMailBox\getCss
getCss()
Definition: ChBaseMailBox.php:67
$_GET
$_GET['debug']
Definition: index.php:67
$iIndex
$iIndex
Definition: bottom_menu_compose.php:142
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
getTemplateIcon
getTemplateIcon($sFileName)
Definition: design.inc.php:193
ChBaseMailBox\$iMessageDescrLength
$iMessageDescrLength
Definition: ChBaseMailBox.php:24
getNickName
getNickName( $ID='')
Definition: profiles.inc.php:461
ChWsbEditor\getObjectInstance
static getObjectInstance($sObject=false)
Definition: ChWsbEditor.php:87
$site
$site['ver']
Definition: version.inc.php:8
$iMessageID
$iMessageID
Definition: mail.php:22
ChBaseMailBox\$sMembersFlagExtension
$sMembersFlagExtension
Definition: ChBaseMailBox.php:20
ChWsbPaginate
Definition: ChWsbPaginate.php:69
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChBaseMailBox\genReplayMessage
genReplayMessage($iRecipientID, $iMessageID=0)
Definition: ChBaseMailBox.php:1459
ChWsbMailBox\getCountTrashedMessages
static getCountTrashedMessages($iMemberId, $sMessageStatus=null)
Definition: ChWsbMailBox.php:962
ChBaseMailBox\get_member_menu_bubble_new_messages
static get_member_menu_bubble_new_messages($iMemberId, $iOldCount=0)
Definition: ChBaseMailBox.php:1649
ChWsbMailBox\getCountSentMessages
static getCountSentMessages($iMemberId, $sMessageStatus=null)
Definition: ChWsbMailBox.php:902
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition: profiles.inc.php:484
CH_EDITOR_FULL
const CH_EDITOR_FULL
Definition: ChWsbEditor.php:20
CH_TAGS_STRIP
const CH_TAGS_STRIP
Definition: utils.inc.php:22
age
age( $birth_date)
Definition: profiles.inc.php:119
ChWsbPageView\$sPageName
$sPageName
Definition: ChWsbPageView.php:100
ChBaseMailBox
Definition: ChBaseMailBox.php:12
isBlocked
isBlocked($iFirstProfile, $iSecondProfile)
Definition: utils.inc.php:128
CH_WSB_LOCALE_DB
const CH_WSB_LOCALE_DB
Definition: utils.inc.php:19
ChBaseMailBox\getJs
getJs()
Definition: ChBaseMailBox.php:72
$aProfileInfo
$aProfileInfo
Definition: short_profile_info.php:23
ChWsbMailBox
Definition: ChWsbMailBox.php:20
ChWsbMailBox\sendMessage
sendMessage( $sMessageSubject, $sMessageBody, $vRecipientID, &$aComposeSettings, $isSimulateSending=false)
Definition: ChWsbMailBox.php:729
$sMessageSubject
$sMessageSubject
Definition: mail.php:37
db_res
db_res($query, $bindings=[])
Definition: db.inc.php:39
ChBaseMailBox\getBlockCode_NewMessages
getBlockCode_NewMessages($bShowEmpty=true)
Definition: ChBaseMailBox.php:633
db_value
db_value($query, $bindings=[], $error_checking=true, $index=0)
Definition: db.inc.php:98
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChBaseMailBox\$aUsedTemplates
$aUsedTemplates
Definition: ChBaseMailBox.php:14
getLocaleFormat
getLocaleFormat($iCode=CH_WSB_LOCALE_DATE_SHORT, $iType=CH_WSB_LOCALE_PHP)
Definition: utils.inc.php:89
$aForm
$aForm
Definition: forgot.php:43
ChBaseMailBox\$iMessageSubjectLength
$iMessageSubjectLength
Definition: ChBaseMailBox.php:23
ChWsbMailBox\getCountInboxMessages
static getCountInboxMessages($iMemberId, $sMessageStatus=null)
Definition: ChWsbMailBox.php:932
$sMessagesList
$sMessagesList
Definition: mail.php:49
$oSysTemplate
$oSysTemplate
Definition: params.inc.php:22
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
$o
$o
Definition: cmd.php:193
$oTemplConfig
$oTemplConfig
Definition: params.inc.php:90
ChBaseMailBox\get_member_menu_messages_list
static get_member_menu_messages_list( $iMemberId=0)
Definition: ChBaseMailBox.php:1723
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChBaseMailBox\getBlockCode_Archives
getBlockCode_Archives()
Definition: ChBaseMailBox.php:219
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
ChBaseMailBox\getBlockCode_ComposeMessage
getBlockCode_ComposeMessage()
Definition: ChBaseMailBox.php:82