Cheetah
ChWallModule.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbModule');
9 ch_import('ChWsbPrivacy');
10 ch_import('ChWsbPaginate');
11 ch_import('ChWsbRssFactory');
12 ch_import('ChWsbAdminSettings');
13 
14 require_once('ChWallCmts.php');
15 require_once('ChWallVoting.php');
16 require_once('ChWallPrivacy.php');
17 require_once('ChWallResponse.php');
18 
19 define('CH_WALL_FILTER_ALL', 'all');
20 define('CH_WALL_FILTER_OWNER', 'owner');
21 define('CH_WALL_FILTER_OTHER', 'other');
22 
23 define('CH_WALL_VIEW_TIMELINE', 'timeline');
24 define('CH_WALL_VIEW_OUTLINE', 'outline');
25 
26 define('CH_WALL_PARSE_TYPE_TEXT', 'text');
27 define('CH_WALL_PARSE_TYPE_LINK', 'link');
28 define('CH_WALL_PARSE_TYPE_PHOTOS', 'photos');
29 define('CH_WALL_PARSE_TYPE_SOUNDS', 'sounds');
30 define('CH_WALL_PARSE_TYPE_VIDEOS', 'videos');
31 define('CH_WALL_PARSE_TYPE_REPOST', 'repost');
32 
33 define('CH_WALL_MEDIA_CATEGORY_NAME', 'wall');
34 
35 define('CH_WALL_DIVIDER_ID', ',');
36 define('CH_WALL_DIVIDER_OBJECT_ID', ',');
37 define('CH_WALL_DIVIDER_TIMELINE', '-');
38 
40 {
43 
49 
54  {
55  parent::__construct($aModule);
56 
57  $this->_oConfig->init($this->_oDb);
58  $this->_oTemplate->setModule($this);
59 
60  $this->_iOwnerId = 0;
61 
62  //--- Define Membership Actions ---//
63  defineMembershipActions(array('timeline repost', 'timeline post comment', 'timeline delete comment'), 'ACTION_ID_');
64  }
65 
71  function getSettingsForm($mixedResult)
72  {
73  $iId = (int)$this->_oDb->getOne("SELECT `ID` FROM `sys_options_cats` WHERE `name`='Timeline'");
74  if(empty($iId))
75  return MsgBox(_t('_wall_msg_no_results'));
76 
77  $oSettings = new ChWsbAdminSettings($iId, CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'admin');
78  $sResult = $oSettings->getForm();
79 
80  if($mixedResult !== true && !empty($mixedResult))
81  $sResult = $mixedResult . $sResult;
82 
83  return $sResult;
84  }
85  function setSettings($aData)
86  {
87  $iId = (int)$this->_oDb->getOne("SELECT `ID` FROM `sys_options_cats` WHERE `name`='Timeline'");
88  if(empty($iId))
89  return MsgBox(_t('_wall_msg_no_results'));
90 
92  return $oSettings->saveChanges($_POST);
93  }
94 
101  function actionPost()
102  {
103  $sJsObject = $this->_oConfig->getJsObject('post');
104 
105  $sResult = "parent." . $sJsObject . ".loading(false);\n";
106 
107  $this->_iOwnerId = (int)$_POST['WallOwnerId'];
108  if (!$this->_isCommentPostAllowed(true))
109  return "<script>" . $sResult . "alert('" . ch_js_string(_t('_wall_msg_not_allowed_post')) . "');</script>";
110 
111  $sPostType = process_db_input($_POST['WallPostType'], CH_TAGS_STRIP);
112  $sContentType = process_db_input($_POST['WallContentType'], CH_TAGS_STRIP);
113 
114  $sMethod = "_process" . ucfirst($sPostType) . ucfirst($sContentType);
115  if(method_exists($this, $sMethod)) {
116  $aResult = $this->$sMethod();
117  if((int)$aResult['code'] == 0) {
118  $iId = $this->_oDb->insertEvent(array(
119  'owner_id' => $this->_iOwnerId,
120  'object_id' => $aResult['object_id'],
121  'type' => $this->_oConfig->getCommonPostPrefix() . $sPostType,
122  'action' => '',
125  'description' => process_db_input($aResult['description'], CH_TAGS_NO_ACTION, CH_SLASHES_NO_ACTION)
126  ));
127 
128  $this->onPost($iId);
129 
130  $sResult = "parent.$('form#WallPost" . ucfirst($sPostType) . "').find(':input:not(:button,:submit,[type = hidden],[type = radio],[type = checkbox])').val('');\n";
131  $sResult .= "parent." . $sJsObject . "._getPost(null, " . $iId . ");";
132  } else
133  $sResult .= "alert('" . ch_js_string(_t($aResult['message'])) . "');";
134  } else
135  $sResult .= "alert('" . ch_js_string(_t('_wall_msg_failed_post')) . "');";
136 
137  return '<script>' . $sResult . '</script>';
138  }
139 
140  function actionRepost()
141  {
142  $iAuthorId = $this->_getAuthorId();
143 
144  $iOwnerId = (int)ch_get('owner_id');
145  $aContent = array(
146  'type' => process_db_input(ch_get('type')),
147  'action' => process_db_input(ch_get('action')),
148  'object_id' => (int)ch_get('object_id'),
149  );
150 
151  $aReposted = $this->_oDb->getReposted($aContent['type'], $aContent['action'], $aContent['object_id']);
152  if(empty($aReposted) || !is_array($aReposted)) {
153  $this->_echoResultJson(array('code' => 1, 'msg' => _t('_wall_txt_err_cannot_repost')));
154  return;
155  }
156 
157  $mixedAllowed = $this->_isRepostAllowed($aReposted, true);
158  if($mixedAllowed !== true) {
159  $this->_echoResultJson(array('code' => 2, 'msg' => strip_tags($mixedAllowed)));
160  return;
161  }
162 
163  $bReposted = $this->_oDb->isReposted($aReposted['id'], $iOwnerId, $iAuthorId);
164  if($bReposted) {
165  $this->_echoResultJson(array('code' => 3, 'msg' => _t('_wall_txt_err_already_reposted')));
166  return;
167  }
168 
169  $sTitle = _t($this->getRepostedLanguageKey($aReposted['type'], $aReposted['action'], $aReposted['object_id'], true), getNickName($iAuthorId));
170  $iId = $this->_oDb->insertEvent(array(
171  'owner_id' => $iOwnerId,
172  'type' => $this->_oConfig->getPrefix('common_post') . 'repost',
173  'action' => '',
174  'object_id' => $iAuthorId,
175  'content' => serialize($aContent),
177  'description' => ''
178  ));
179 
180  if(empty($iId)) {
181  $this->_echoResultJson(array('code' => 4, 'msg' => _t('_wall_txt_err_cannot_repost')));
182  return;
183  }
184 
185  $this->onRepost($iId, $aReposted);
186 
187  $aReposted = $this->_oDb->getReposted($aContent['type'], $aContent['action'], $aContent['object_id']);
188  $this->_echoResultJson(array(
189  'code' => 0,
190  'msg' => _t('_wall_txt_msg_success_repost'),
191  'count' => $aReposted['reposts'],
192  'counter' => $this->_oTemplate->getRepostCounter($aReposted),
193  'disabled' => !$bReposted
194  ));
195  }
196 
202  function actionDelete()
203  {
204  header('Content-Type:text/javascript');
205 
206  $this->_iOwnerId = (int)$_POST['WallOwnerId'];
207 
208  $iEvent = (int)$_POST['WallEventId'];
209  $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'object_id' => $iEvent));
210 
211  if(!$this->_isCommentDeleteAllowed($aEvent, true))
212  return json_encode(array('code' => 1));
213 
214  $bResult = $this->_oDb->deleteEvent(array('id' => $iEvent));
215  if($bResult) {
216  $this->onDelete($aEvent);
217 
218  return json_encode(array('code' => 0, 'id' => $iEvent));
219  } else
220  return json_encode(array('code' => 2));
221  }
227  function actionGetPost()
228  {
229  $this->_oConfig->setJsMode(true);
230  $this->_iOwnerId = (int)$_POST['WallOwnerId'];
231  $iPostId = (int)$_POST['WallPostId'];
232 
233  $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'object_id' => $iPostId));
234 
235  header('Content-Type: text/html; charset=utf-8');
236  return $this->_oTemplate->getCommon($aEvent);
237  }
243  function actionGetPosts()
244  {
245  $this->_oConfig->setJsMode(true);
246 
247  $this->_iOwnerId = $_POST['WallOwnerId'];
248  if(strpos($this->_iOwnerId, CH_WALL_DIVIDER_ID) !== false)
249  $this->_iOwnerId = explode(CH_WALL_DIVIDER_ID, $this->_iOwnerId);
250 
251  $iStart = isset($_POST['WallStart']) && !empty($_POST['WallStart']) ? (int)$_POST['WallStart'] : 0;
252  $iPerPage = isset($_POST['WallPerPage']) && !empty($_POST['WallPerPage']) ? (int)$_POST['WallPerPage'] : $this->_oConfig->getPerPage();
253  $sFilter = isset($_POST['WallFilter']) && !empty($_POST['WallFilter']) ? process_db_input($_POST['WallFilter'], CH_TAGS_STRIP) : CH_WALL_FILTER_ALL;
254  $sTimeline = isset($_POST['WallTimeline']) && !empty($_POST['WallTimeline']) ? process_db_input($_POST['WallTimeline'], CH_TAGS_STRIP) : '';
255  $aModules = isset($_POST['WallModules']) && !empty($_POST['WallModules']) ? process_db_input($_POST['WallModules'], CH_TAGS_STRIP) : array();
256 
257  header('Content-Type: text/html; charset=utf-8');
258  return $sContent = $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules);
259  }
266  {
267  $this->_oConfig->setJsMode(true);
268 
269  $iStart = isset($_POST['WallStart']) && !empty($_POST['WallStart']) ? (int)$_POST['WallStart'] : 0;
270  $iPerPage = isset($_POST['WallPerPage']) && !empty($_POST['WallPerPage']) ? (int)$_POST['WallPerPage'] : $this->_oConfig->getPerPage();
271  $sFilter = isset($_POST['WallFilter']) && !empty($_POST['WallFilter']) ? process_db_input($_POST['WallFilter'], CH_TAGS_STRIP) : CH_WALL_FILTER_ALL;
272  $aModules = isset($_POST['WallModules']) && !empty($_POST['WallModules']) ? process_db_input($_POST['WallModules'], CH_TAGS_STRIP) : array();
273 
274  list($sContent, $sPaginate) = $this->_getPostsOutline('desc', $iStart, $iPerPage, $sFilter, $aModules);
275 
276  header('Content-Type:text/javascript; charset=utf-8');
277  return json_encode(array(
278  'code' => 0,
279  'items' => $sContent,
280  'paginate' => $sPaginate
281  ));
282  }
288  function actionGetTimeline()
289  {
290  $this->_iOwnerId = $_POST['WallOwnerId'];
291  if(strpos($this->_iOwnerId, CH_WALL_DIVIDER_ID) !== false)
292  $this->_iOwnerId = explode(CH_WALL_DIVIDER_ID, $this->_iOwnerId);
293 
294  $iStart = isset($_POST['WallStart']) && !empty($_POST['WallStart']) ? (int)$_POST['WallStart'] : 0;
295  $iPerPage = isset($_POST['WallPerPage']) && !empty($_POST['WallPerPage']) ? (int)$_POST['WallPerPage'] : $this->_oConfig->getPerPage();
296  $sFilter = isset($_POST['WallFilter']) && !empty($_POST['WallFilter']) ? process_db_input($_POST['WallFilter'], CH_TAGS_STRIP) : CH_WALL_FILTER_ALL;
297  $sTimeline = isset($_POST['WallTimeline']) && !empty($_POST['WallTimeline']) ? process_db_input($_POST['WallTimeline'], CH_TAGS_STRIP) : '';
298  $aModules = isset($_POST['WallModules']) && !empty($_POST['WallModules']) ? process_db_input($_POST['WallModules'], CH_TAGS_STRIP) : array();
299 
300  header('Content-Type: text/html; charset=utf-8');
301  return $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules);
302  }
308  function actionGetPaginate()
309  {
310  $this->_iOwnerId = $_POST['WallOwnerId'];
311  if(strpos($this->_iOwnerId, CH_WALL_DIVIDER_ID) !== false)
312  $this->_iOwnerId = explode(CH_WALL_DIVIDER_ID, $this->_iOwnerId);
313 
314  $iStart = isset($_POST['WallStart']) && !empty($_POST['WallStart']) ? (int)$_POST['WallStart'] : 0;
315  $iPerPage = isset($_POST['WallPerPage']) && !empty($_POST['WallPerPage']) ? (int)$_POST['WallPerPage'] : $this->_oConfig->getPerPage();
316  $sFilter = isset($_POST['WallFilter']) && !empty($_POST['WallFilter']) ? process_db_input($_POST['WallFilter'], CH_TAGS_STRIP) : CH_WALL_FILTER_ALL;
317  $sTimeline = isset($_POST['WallTimeline']) && !empty($_POST['WallTimeline']) ? process_db_input($_POST['WallTimeline'], CH_TAGS_STRIP) : '';
318  $aModules = isset($_POST['WallModules']) && !empty($_POST['WallModules']) ? process_db_input($_POST['WallModules'], CH_TAGS_STRIP) : array();
319 
320  $oPaginate = $this->_getPaginate($sFilter, $sTimeline, $aModules);
321 
322  header('Content-Type: text/html; charset=utf-8');
323  return $oPaginate->getPaginate($iStart, $iPerPage);
324  }
330  function actionGetUploader($iOwnerId, $sType, $sSubType = '')
331  {
332  $this->_iOwnerId = $iOwnerId;
333  header('Content-Type: text/html; charset=utf-8');
334 
335  if(!in_array($sType, array('photo', 'sound', 'video')))
336  return '';
337 
338  return $this->_oTemplate->getUploader($iOwnerId, $sType, $sSubType);
339  }
346  {
347  $iRepostedId = (int)ch_get('id');
348 
349  header('Content-Type:text/javascript; charset=utf-8');
350  return json_encode(array(
351  'code' => 0,
352  'content' => $this->_oTemplate->getRepostedBy($iRepostedId)
353  ));
354  }
361  {
362  $sNoImage = $this->_oTemplate->getImageUrl('no-image.png');
363 
364  $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'object_id' => $iId));
365  if(empty($aEvent) || !is_array($aEvent) || strpos($aEvent['content'], urlencode($sUrl)) === false) {
366  header("Location: " . $sNoImage);
367  exit;
368  }
369 
370  $sUrl = base64_decode(urldecode($sUrl));
371 
372  $sProtoHttp = 'http';
373  $sProtoHttps = 'https';
374  $sProtoSite = ch_proto();
375  $sProtoImage = ch_proto($sUrl);
376 
377  if($sProtoSite == $sProtoHttp || ($sProtoSite == $sProtoHttps && $sProtoImage == $sProtoHttps)) {
378  header("Location: " . $sUrl);
379  exit;
380  }
381 
382  $bImage = false;
383  $aHeaders = get_headers($sUrl);
384 
385  $bHeaderCache = false;
386  $sHeaderCache = 'Cache-Control: max-age=2592000';
387 
388  foreach ($aHeaders as $sHeader) {
389  //--- Check type
390  $aMatches = array();
391  if(preg_match("/^Content-Type:\s*([a-z]*)\/([a-z]*)$/i", $sHeader, $aMatches)) {
392  if($aMatches[1] == 'image' && in_array($aMatches[2], array('png', 'jpeg', 'gif')))
393  $bImage = true;
394  }
395 
396  //--- Check cache
397  $aMatches = array();
398  if(preg_match("/^Cache-Control:\s*max-age\s*=\s*([0-9]*)$/i", $sHeader, $aMatches)) {
399  $bHeaderCache = true;
400 
401  if((int)$aMatches[1] < 2592000)
402  $sHeader = $sHeaderCache;
403  }
404 
405  header($sHeader);
406  }
407 
408  if(!$bImage) {
409  header("Location: " . $sNoImage);
410  exit;
411  }
412 
413  if(!$bHeaderCache)
414  header($sHeaderCache);
415 
417  }
424  function actionRss($sUsername)
425  {
426  $aOwner = $this->_oDb->getUser(process_db_input($sUsername), 'username');
427 
428  $aEvents = $this->_oDb->getEvents(array(
429  'browse' => 'owner',
430  'owner_id' => $aOwner['id'],
431  'order' => 'desc',
432  'start' => 0,
433  'count' => $this->_oConfig->getRssLength(),
434  'filter' => ''
435  ));
436 
437  $sRssBaseUrl = $this->_oConfig->getBaseUri() . 'index/' . $aOwner['username'] . '/';
438  $aRssData = array();
439  foreach($aEvents as $aEvent) {
440  if(empty($aEvent['title'])) continue;
441 
442  $aRssData[$aEvent['id']] = array(
443  'UnitID' => $aEvent['id'],
444  'OwnerID' => $aOwner['id'],
445  'UnitTitle' => $aEvent['title'],
446  'UnitLink' => CH_WSB_URL_ROOT . $sRssBaseUrl . '#wall-event-' . $aEvent['id'],
447  'UnitDesc' => $aEvent['description'],
448  'UnitDateTimeUTS' => $aEvent['date'],
449  'UnitIcon' => ''
450  );
451  }
452 
453  $oRss = new ChWsbRssFactory();
454 
455  header('Content-Type: text/html; charset=utf-8');
456  return $oRss->GenRssByData($aRssData, $aOwner['username'] . ' ' . _t('_wall_rss_caption'), $sRssBaseUrl);
457  }
458 
466  {
467  $oResponse = new ChWallResponse($this);
468  $oResponse->response($oAlert);
469  }
470 
478  {
479  if(!isLogged())
480  return '';
481 
482  $aOwner = $this->_oDb->getUser(getLoggedId(), $sType);
483  $this->_iOwnerId = $aOwner['id'];
484 
485  if(!$this->_isCommentPostAllowed())
486  return "";
487 
488  $aTopMenu = $this->_getPostTabs(CH_WALL_VIEW_TIMELINE);
489  if(empty($aTopMenu) || empty($aTopMenu['tabs']))
490  return "";
491 
492  //--- Parse template ---//
493  $sClassActive = ' wall-ptc-active';
494  $sContent = $this->_oTemplate->parseHtmlByName('post.html', array (
495  'js_code' => $this->_oTemplate->getJsCode('post', array('iOwnerId' => 0)),
496  'class_text' => !empty($aTopMenu['mask']['text']) ? $sClassActive : '',
497  'content_text' => isset($aTopMenu['mask']['text']) ? $this->_getWriteForm('_getWriteFormIndex') : '',
498  'class_link' => !empty($aTopMenu['mask']['link']) ? $sClassActive : '',
499  'content_link' => isset($aTopMenu['mask']['link']) ? $this->_getShareLinkForm('_getShareLinkFormIndex') : '',
500  'class_photo' => !empty($aTopMenu['mask']['photo']) ? $sClassActive : '',
501  'content_photo' => isset($aTopMenu['mask']['photo']) ? $this->_oTemplate->getUploader(0, 'photo') : '',
502  'class_sound' => !empty($aTopMenu['mask']['sound']) ? $sClassActive : '',
503  'content_sound' => isset($aTopMenu['mask']['sound']) ? $this->_oTemplate->getUploader(0, 'sound') : '',
504  'class_video' => !empty($aTopMenu['mask']['video']) ? $sClassActive : '',
505  'content_video' => isset($aTopMenu['mask']['video']) ? $this->_oTemplate->getUploader(0, 'video') : '',
506  ));
507 
508  $this->_oTemplate->addCss('post.css');
509  $this->_oTemplate->addJs(array('main.js', 'post.js'));
510  return array($sContent, $aTopMenu['tabs'], LoadingBox('ch-wall-post-loading'), true, 'getBlockCaptionMenu');
511  }
512 
513  function serviceViewBlockIndexTimeline($iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
514  {
515  $this->_iOwnerId = 0;
516 
517  if($iStart == -1)
518  $iStart = 0;
519  if($iPerPage == -1)
520  $iPerPage = $this->_oConfig->getPerPage('index_tl');
521  if(empty($sFilter))
522  $sFilter = CH_WALL_FILTER_ALL;
523 
524  $aVariables = array(
525  'timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules),
526  'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules),
527  'view_js_content' => $this->_oTemplate->getJsCode('view', array('iOwnerId' => $this->_iOwnerId), array(
528  'WallOwnerId' => $this->_iOwnerId,
529  'WallStart' => $iStart,
530  'WallPerPage' => $iPerPage,
531  'WallFilter' => $sFilter,
532  'WallTimeline' => $sTimeline,
533  'WallModules' => $aModules
534  )),
535  );
536 
537  ch_import('ChTemplFormView');
538  $oForm = new ChTemplFormView(array());
539  $oForm->addCssJs(true, true);
540 
541  $this->_oTemplate->addCss(array('view.css', 'view_phone.css'));
542  $this->_oTemplate->addJs(array('modernizr.js', 'main.js', 'view.js'));
543  return array($this->_oTemplate->parseHtmlByName('view.html', $aVariables), array(), LoadingBox('ch-wall-view-loading'), false, 'getBlockCaptionMenu');
544  }
545 
552  function servicePostBlockProfileTimeline($mixed, $sType = 'id')
553  {
554  $aOwner = $this->_oDb->getUser($mixed, $sType);
555  $this->_iOwnerId = $aOwner['id'];
556 
557  if(($aOwner['id'] != $this->_getAuthorId() && !$this->_isCommentPostAllowed()) || !$this->_isViewAllowed())
558  return "";
559 
560  $aTopMenu = $this->_getPostTabs(CH_WALL_VIEW_TIMELINE);
561  if(empty($aTopMenu) || empty($aTopMenu['tabs']))
562  return "";
563 
564  //--- Parse template ---//
565  $sClassActive = ' wall-ptc-active';
566  $sContent = $this->_oTemplate->parseHtmlByName('post.html', array (
567  'js_code' => $this->_oTemplate->getJsCode('post', array('iOwnerId' => $this->_iOwnerId)),
568  'class_text' => !empty($aTopMenu['mask']['text']) ? $sClassActive : '',
569  'content_text' => isset($aTopMenu['mask']['text']) ? $this->_getWriteForm() : '',
570  'class_link' => !empty($aTopMenu['mask']['link']) ? $sClassActive : '',
571  'content_link' => isset($aTopMenu['mask']['link']) ? $this->_getShareLinkForm() : '',
572  'class_photo' => !empty($aTopMenu['mask']['photo']) ? $sClassActive : '',
573  'content_photo' => isset($aTopMenu['mask']['photo']) ? $this->_oTemplate->getUploader($this->_iOwnerId, 'photo') : '',
574  'class_sound' => !empty($aTopMenu['mask']['sound']) ? $sClassActive : '',
575  'content_sound' => isset($aTopMenu['mask']['sound']) ? $this->_oTemplate->getUploader($this->_iOwnerId, 'sound') : '',
576  'class_video' => !empty($aTopMenu['mask']['video']) ? $sClassActive : '',
577  'content_video' => isset($aTopMenu['mask']['video']) ? $this->_oTemplate->getUploader($this->_iOwnerId, 'video') : '',
578  ));
579 
580  $GLOBALS['oTopMenu']->setCurrentProfileID((int)$this->_iOwnerId);
581 
582  $this->_oTemplate->addCss('post.css');
583  $this->_oTemplate->addJs(array('main.js', 'post.js'));
584  return array($sContent, $aTopMenu['tabs'], LoadingBox('ch-wall-post-loading'), true, 'getBlockCaptionMenu');
585  }
586 
588  {
589  $sJsObject = $this->_oConfig->getJsObject('post');
590  $aUploadersHidden = $this->_oConfig->getUploadersHidden($sType);
591 
592  $aTabs = $aMask = array();
593  if(!in_array('text', $aUploadersHidden)) {
594  $aMask['text'] = 0;
595  $aTabs['wall-ptype-text'] = array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changePostType(this)', 'class' => 'wall-ptype-ctl', 'icon' => 'comment-o', 'title' => _t('_wall_write'));
596  }
597 
598  if(!in_array('link', $aUploadersHidden)) {
599  $aMask['link'] = 0;
600  $aTabs['wall-ptype-link'] = array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changePostType(this)', 'class' => 'wall-ptype-ctl', 'icon' => 'link', 'title' => _t('_wall_share_link'));
601  }
602 
603  if(!in_array('photo', $aUploadersHidden) && $this->_oDb->isModule('photos')) {
604  $aMask['photo'] = 0;
605  $aTabs['wall-ptype-photo'] = array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changePostType(this)', 'class' => 'wall-ptype-ctl', 'icon' => 'picture-o', 'title' => _t('_wall_add_photo'));
606  }
607 
608  if(!in_array('sound', $aUploadersHidden) && $this->_oDb->isModule('sounds')) {
609  $aMask['sound'] = 0;
610  $aTabs['wall-ptype-sound'] = array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changePostType(this)', 'class' => 'wall-ptype-ctl', 'icon' => 'music', 'title' => _t('_wall_add_sound'));
611  }
612 
613  if(!in_array('video', $aUploadersHidden) && $this->_oDb->isModule('videos')) {
614  $aMask['video'] = 0;
615  $aTabs['wall-ptype-video'] = array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changePostType(this)', 'class' => 'wall-ptype-ctl', 'icon' => 'film', 'title' => _t('_wall_add_video'));
616  }
617 
618  if(!empty($aTabs)) {
619  reset($aTabs);
620  $sActive = key($aTabs);
621 
622  $aTabs[$sActive]['active'] = 1;
623  $aMask[ch_ltrim_str($sActive, 'wall-ptype-')] = 1;
624  }
625 
626  return array(
627  'tabs' => $aTabs,
628  'mask' => $aMask
629  );
630  }
631 
632  function serviceViewBlockProfileTimeline($mixed, $iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
633  {
634  $sContent = '';
635  $sJsObject = $this->_oConfig->getJsObject('view');
636 
637  $aOwner = $this->_oDb->getUser($mixed, $sType);
638  $this->_iOwnerId = $aOwner['id'];
639 
640  if(!$this->_isViewAllowed())
641  return $sContent;
642 
644  $aButton = $oSubscription->getButton($this->_getAuthorId(), 'ch_wall', '', $this->_iOwnerId);
645 
646  $aTopMenu = array(
647  'wall-view-all' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'title' => _t('_wall_view_all'), 'active' => 1),
648  'wall-view-owner' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'title' => _t('_wall_view_owner', getNickName($aOwner['id']))),
649  'wall-view-other' => array('href' => 'javascript:void(0)', 'onclick' => 'javascript:' . $sJsObject . '.changeFilter(this)', 'title' => _t('_wall_view_other')),
650  'wall-get-rss' => array('href' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'rss/' . $aOwner['username'] . '/', 'target' => '_blank', 'title' => _t('_wall_get_rss')),
651  'wall-subscription' => array('href' => 'javascript:void(0);', 'onclick' => 'javascript:' . $aButton['script'] . '', 'title' => $aButton['title']),
652  );
653 
654  if($iStart == -1)
655  $iStart = 0;
656  if($iPerPage == -1)
657  $iPerPage = $this->_oConfig->getPerPage('profile');
658  if(empty($sFilter))
659  $sFilter = CH_WALL_FILTER_ALL;
660 
661  $aVariables = array(
662  'timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules),
663  'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules),
664  'view_js_content' => $this->_oTemplate->getJsCode('view', array('iOwnerId' => $this->_iOwnerId), array(
665  'WallOwnerId' => $this->_iOwnerId,
666  'WallStart' => $iStart,
667  'WallPerPage' => $iPerPage,
668  'WallFilter' => $sFilter,
669  'WallTimeline' => $sTimeline,
670  'WallModules' => $aModules
671  ))
672  );
673 
674  $GLOBALS['oTopMenu']->setCurrentProfileID((int)$this->_iOwnerId);
675 
676  ch_import('ChTemplFormView');
677  $oForm = new ChTemplFormView(array());
678  $oForm->addCssJs(true, true);
679 
680  $this->_oTemplate->addCss(array('view.css', 'view_phone.css'));
681  $this->_oTemplate->addJs(array('modernizr.js', 'main.js', 'view.js'));
682  return array($oSubscription->getData() . $this->_oTemplate->parseHtmlByName('view.html', $aVariables), $aTopMenu, LoadingBox('ch-wall-view-loading'), false, 'getBlockCaptionMenu');
683  }
684 
685  function serviceViewBlockAccountTimeline($mixed, $iStart = -1, $iPerPage = -1, $sFilter = '', $sTimeline = '', $sType = 'id', $aModules = array())
686  {
687  $aOwner = $this->_oDb->getUser($mixed, $sType);
688  $this->_iOwnerId = $aOwner['id'];
689 
690  $aFriends = getMyFriendsEx($this->_iOwnerId, '', '', 'LIMIT 20');
691  if(empty($aFriends))
692  return $this->_oTemplate->getEmpty(true);
693 
694  $this->_iOwnerId = array_keys($aFriends);
695  $sOwnerId = implode(CH_WALL_DIVIDER_ID, $this->_iOwnerId);
696 
697  if($iStart == -1)
698  $iStart = 0;
699  if($iPerPage == -1)
700  $iPerPage = $this->_oConfig->getPerPage('account');
701  if(empty($sFilter))
702  $sFilter = CH_WALL_FILTER_ALL;
703 
704  $aVariables = array(
705  'timeline' => $this->_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules),
706  'content' => $this->_getPosts('desc', $iStart, $iPerPage, $sFilter, $sTimeline, $aModules),
707  'view_js_content' => $this->_oTemplate->getJsCode('view', array('iOwnerId' => $sOwnerId), array(
708  'WallOwnerId' => $sOwnerId,
709  'WallStart' => $iStart,
710  'WallPerPage' => $iPerPage,
711  'WallFilter' => $sFilter,
712  'WallTimeline' => $sTimeline,
713  'WallModules' => $aModules
714  ))
715  );
716 
717  ch_import('ChTemplFormView');
718  $oForm = new ChTemplFormView(array());
719  $oForm->addCssJs(true, true);
720 
721  $this->_oTemplate->addCss(array('view.css', 'view_phone.css'));
722  $this->_oTemplate->addJs(array('main.js', 'view.js'));
723  return array($this->_oTemplate->parseHtmlByName('view.html', $aVariables), array(), LoadingBox('ch-wall-view-loading'), false, 'getBlockCaptionMenu');
724  }
725 
726  function serviceViewBlockIndexOutline($iStart = -1, $iPerPage = -1, $sFilter = '', $aModules = array())
727  {
728  $sContent = '';
729  $this->_iOwnerId = 0;
730 
731  if($iStart == -1)
732  $iStart = 0;
733  if($iPerPage == -1)
734  $iPerPage = $this->_oConfig->getPerPage('index_ol');
735  if(empty($sFilter))
736  $sFilter = CH_WALL_FILTER_ALL;
737 
738  list($sContent, $sPaginate) = $this->_getPostsOutline('desc', $iStart, $iPerPage, $sFilter, $aModules);
739  if(empty($sContent))
740  return;
741 
742  $aTmplVars = array(
743  'outline_js_content' => $this->_oTemplate->getJsCode('outline', array('iOwnerId' => 0), array(
744  'WallFilter' => $sFilter,
745  'WallModules' => $aModules
746  )),
747  'content' => $sContent,
748  'paginate' => $sPaginate
749  );
750 
751  $this->_oTemplate->addCss(array('outline.css', 'outline_tablet.css', 'outline_phone.css'));
752  $this->_oTemplate->addJs(array('masonry.pkgd.min.js', 'main.js', 'outline.js'));
753  return array($this->_oTemplate->parseHtmlByName('outline.html', $aTmplVars), array(), LoadingBox('ch-wall-view-loading'), true, 'getBlockCaptionMenu');
754  }
755 
757  {
758  ch_instance('ChWsbModuleDb');
759  $oModuleDb = new ChWsbModuleDb();
760  $aHandlers = $this->_oDb->getHandlers(array('type' => $sType));
761 
762  $aResults = array();
763  foreach($aHandlers as $aHandler) {
764  $aModule = $oModuleDb->getModuleByUri($aHandler['module_uri']);
765  if(empty($aModule))
766  $aModule['title'] = _t('_wall_alert_module_' . $aHandler['alert_unit']);
767 
768  $aResults[$aHandler['id']] = _t('_wall_alert_action_' . $aHandler['alert_action'], $aModule['title']);
769  }
770 
771  asort($aResults);
772  return $aResults;
773  }
774 
776  {
777  $aResults = array(
778  'text' => _t('_wall_write'),
779  'link' => _t('_wall_share_link')
780  );
781 
782  if($this->_oDb->isModule('photos'))
783  $aResults['photo'] = _t('_wall_add_photo');
784 
785  if($this->_oDb->isModule('sounds'))
786  $aResults['sound'] = _t('_wall_add_sound');
787 
788  if($this->_oDb->isModule('videos'))
789  $aResults['video'] = _t('_wall_add_video');
790 
791  asort($aResults);
792  return $aResults;
793  }
794 
795  function serviceUpdateHandlers($sModuleUri = 'all', $bInstall = true)
796  {
797  $aModules = $sModuleUri == 'all' ? $this->_oDb->getModules() : array($this->_oDb->getModuleByUri($sModuleUri));
798 
799  foreach($aModules as $aModule) {
800  if(!ChWsbRequest::serviceExists($aModule, 'get_wall_data')) continue;
801 
802  $aData = ChWsbService::call($aModule['uri'], 'get_wall_data');
803  if($bInstall)
804  $this->_oDb->insertData($aData);
805  else
806  $this->_oDb->deleteData($aData);
807  }
808 
810  }
811 
813  {
814  $oMemberMenu = ch_instance('ChWsbMemberMenu');
815 
816  $aLanguageKeys = array(
817  'wall' => _t( '_wall_pc_view' ),
818  );
819 
820  // fill all necessary data;
821  $aLinkInfo = array(
822  'item_img_src' => 'time',
823  'item_img_alt' => $aLanguageKeys['wall'],
824  'item_link' => CH_WSB_URL_ROOT . $this -> _oConfig -> getBaseUri(),
825  'item_onclick' => null,
826  'item_title' => $aLanguageKeys['wall'],
827  'extra_info' => null,
828  );
829 
830  return $oMemberMenu -> getGetExtraMenuLink($aLinkInfo);
831  }
832  function serviceGetSubscriptionParams($sUnit, $sAction, $iObjectId)
833  {
834  $sUnit = str_replace('ch_', '_', $sUnit);
835  if(empty($sAction))
836  $sAction = 'main';
837 
838  $aProfileInfo = getProfileInfo($iObjectId);
839  return array(
840  'template' => array(
841  'Subscription' => _t($sUnit . '_sbs_' . $sAction, $aProfileInfo['NickName']),
842  'ViewLink' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'index/' . $aProfileInfo['NickName']
843  )
844  );
845  }
846 
847  function serviceGetSpyData()
848  {
849  $AlertName = $this->_oConfig->getAlertSystemName();
850 
851  return array(
852  'handlers' => array(
853  array('alert_unit' => $AlertName, 'alert_action' => 'post', 'module_uri' => $this->_oConfig->getUri(), 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
854  array('alert_unit' => $AlertName, 'alert_action' => 'repost', 'module_uri' => $this->_oConfig->getUri(), 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
855  array('alert_unit' => $AlertName, 'alert_action' => 'rate', 'module_uri' => $this->_oConfig->getUri(), 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
856  array('alert_unit' => $AlertName, 'alert_action' => 'commentPost', 'module_uri' => $this->_oConfig->getUri(), 'module_class' => 'Module', 'module_method' => 'get_spy_post'),
857  ),
858  'alerts' => array(
859  array('unit' => $AlertName, 'action' => 'post'),
860  array('unit' => $AlertName, 'action' => 'repost'),
861  array('unit' => $AlertName, 'action' => 'delete'),
862  array('unit' => $AlertName, 'action' => 'rate'),
863  array('unit' => $AlertName, 'action' => 'commentPost'),
864  array('unit' => $AlertName, 'action' => 'commentRemoved')
865  )
866  );
867  }
868 
869  function serviceGetSpyPost($sAction, $iObjectId = 0, $iSenderId = 0, $aExtraParams = array())
870  {
871  $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'object_id' => $iObjectId));
872  if($aEvent['owner_id'] == $iSenderId)
873  return array();
874 
875  $sLangKey = '';
876  switch ($sAction) {
877  case 'post':
878  $sLangKey = '_wall_spy_post';
879  break;
880  case 'repost':
881  $sLangKey = '_wall_spy_repost';
882  break;
883  case 'rate':
884  $sLangKey = '_wall_spy_rate';
885  break;
886  case 'commentPost':
887  $sLangKey = '_wall_spy_post_comment';
888  break;
889  }
890 
891  return array(
892  'params' => array(
893  'profile_link' => getProfileLink($iSenderId),
894  'profile_nick' => getNickName($iSenderId),
895  'recipient_p_link' => getProfileLink($aEvent['owner_id']),
896  'recipient_p_nick' => getNickName($aEvent['owner_id']),
897  ),
898  'recipient_id' => $aEvent['owner_id'],
899  'lang_key' => $sLangKey
900  );
901  }
902 
903  function serviceGetRepostElementBlock($iOwnerId, $sType, $sAction, $iObjectId, $aParams = array())
904  {
905  $aParams = array_merge($this->_oConfig->getRepostDefaults(), $aParams);
906  return $this->_oTemplate->getRepostElement($iOwnerId, $sType, $sAction, $iObjectId, $aParams);
907  }
908 
909  function serviceGetRepostCounter($sType, $sAction, $iObjectId, $aParams = array())
910  {
911  $aReposted = $this->_oDb->getReposted($sType, $sAction, $iObjectId);
912 
913  return $this->_oTemplate->getRepostCounter($aReposted, $aParams);
914  }
915 
917  {
918  return $this->_oTemplate->getRepostJsScript();
919  }
920 
921  function serviceGetRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId)
922  {
923  return $this->_oTemplate->getRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId);
924  }
925 
926  function getRepostedLanguageKey($sType, $sAction, $mixedObjectId, $bTitle = false)
927  {
928  $sLanguageKey = '_wall_reposted_';
929  if($bTitle)
930  $sLanguageKey .= 'title_';
931 
932  $sLanguageKey .= ch_ltrim_str($sType, $this->_oConfig->getPrefix('common_post'), '');
933 
934  if(!empty($sAction))
935  $sLanguageKey .= '_' . $sAction;
936 
937  if($this->_oConfig->isGrouped($sType, $sAction, $mixedObjectId))
938  $sLanguageKey .= '_grouped';
939 
940  return $sLanguageKey;
941  }
942 
943  function onPost($iId)
944  {
945  $iUserId = $this->_getAuthorId();
946 
947  //--- Event -> Post for Alerts Engine ---//
948  ch_import('ChWsbAlerts');
949  $oAlert = new ChWsbAlerts($this->_oConfig->getAlertSystemName(), 'post', $iId, $iUserId);
950  $oAlert->alert();
951  //--- Event -> Post for Alerts Engine ---//
952  }
953 
954  function onDelete($aEvent)
955  {
956  $iUserId = $this->_getAuthorId();
957  $sCommonPostPrefix = $this->_oConfig->getPrefix('common_post');
958 
959  //--- Update parent event when repost event was deleted.
960  if($aEvent['type'] == $sCommonPostPrefix . CH_WALL_PARSE_TYPE_REPOST) {
961  $this->_oDb->deleteRepostTrack($aEvent['id']);
962 
963  $aContent = unserialize($aEvent['content']);
964  $aReposted = $this->_oDb->getReposted($aContent['type'], $aContent['action'], $aContent['object_id']);
965  if(!empty($aReposted) && is_array($aReposted))
966  $this->_oDb->updateRepostCounter($aReposted['id'], $aReposted['reposts'], -1);
967  }
968 
969  //--- Find and delete repost events when parent event was deleted.
970  $bSystem = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']);
971  $aRepostEvents = $this->_oDb->getEvents(array('browse' => 'reposted_by_descriptor', 'type' => $aEvent['type']));
972  foreach($aRepostEvents as $aRepostEvent) {
973  $aContent = unserialize($aRepostEvent['content']);
974  if(isset($aContent['type']) && $aContent['type'] == $aEvent['type'] && isset($aContent['object_id']) && (($bSystem && (int)$aContent['object_id'] == (int)$aEvent['object_id']) || (!$bSystem && (int)$aContent['object_id'] == (int)$aEvent['id'])))
975  $this->_oDb->deleteEvent(array('id' => (int)$aRepostEvent['id']));
976  }
977 
978  //--- Event -> Delete for Alerts Engine ---//
979  ch_import('ChWsbAlerts');
980  $oAlert = new ChWsbAlerts($this->_oConfig->getAlertSystemName(), 'delete', $iId, $iUserId);
981  $oAlert->alert();
982  //--- Event -> Delete for Alerts Engine ---//
983  }
984 
985  function onRepost($iId, $aReposted = array())
986  {
987  $aEvent = $this->_oDb->getEvents(array('browse' => 'id', 'object_id' => $iId));
988 
989  if(empty($aReposted)) {
990  $aContent = unserialize($aEvent['content']);
991 
992  $aReposted = $this->_oDb->getReposted($aContent['type'], $aContent['action'], $aContent['object_id']);
993  if(empty($aReposted) || !is_array($aReposted))
994  return;
995  }
996 
997  $iUserId = $this->_getAuthorId();
998  $this->_oDb->insertRepostTrack($aEvent['id'], $iUserId, $this->_getAuthorIp(), $aReposted['id']);
999  $this->_oDb->updateRepostCounter($aReposted['id'], $aReposted['reposts']);
1000 
1001  //--- Wall -> Update for Alerts Engine ---//
1002  $oAlert = new ChWsbAlerts($this->_oConfig->getAlertSystemName(), 'repost', $aReposted['id'], $iUserId, array('repost_id' => $aEvent['id']));
1003  $oAlert->alert();
1004  //--- Wall -> Update for Alerts Engine ---//
1005  }
1006 
1012  {
1013  $sJsObject = $this->_oConfig->getJsObject('view');
1014 
1015  $aOwner = $this->_oDb->getUser($this->_getAuthorId());
1016 
1017  $sContent = $_POST['content'];
1018  $sContent = strip_tags($sContent);
1019  $sContent = nl2br($sContent);
1020 
1021  if(empty($sContent))
1022  return array(
1023  'code' => 1,
1024  'message' => '_wall_msg_text_empty_message'
1025  );
1026 
1027  $sContentMore = '';
1028  $iMaxLength = $this->_oConfig->getCharsDisplayMax();
1029  if(mb_strlen($sContent) > $iMaxLength) {
1030  $iLength = mb_strpos($sContent, ' ', $iMaxLength);
1031 
1032  $sContentMore = trim(mb_substr($sContent, $iLength));
1033  $sContent = trim(mb_substr($sContent, 0, $iLength));
1034  }
1035 
1036  return array(
1037  'code' => 0,
1038  'object_id' => $aOwner['id'],
1039  'content' => $this->_oTemplate->parseHtmlByName('common_text.html', array(
1040  'content' => $sContent,
1041  'ch_if:show_more' => array(
1042  'condition' => !empty($sContentMore),
1043  'content' => array(
1044  'js_object' => $sJsObject,
1045  'post_content_more' => $sContentMore
1046  )
1047  ),
1048  )),
1049  'title' => _t('_wall_added_title_text', getNickName($aOwner['id'])),
1050  'description' => $sContent
1051  );
1052  }
1054  {
1055  $aOwner = $this->_oDb->getUser($this->_getAuthorId());
1056 
1057  $sUrl = trim(process_db_input($_POST['url'], CH_TAGS_STRIP));
1058  if(empty($sUrl))
1059  return array(
1060  'code' => 1,
1061  'message' => '_wall_msg_link_empty_link'
1062  );
1063 
1064  $aSiteInfo = getSiteInfo($sUrl, array(
1065  'thumbnailUrl' => array('tag' => 'link', 'content_attr' => 'href'),
1066  'OGImage' => array('name_attr' => 'property', 'name' => 'og:image'),
1067  ));
1068  $sTitle = isset($aSiteInfo['title']) ? $aSiteInfo['title'] : $sUrl;
1069  $sDescription = '';
1070  if(isset($aSiteInfo['description']))
1071  $sDescription = preg_replace('/[^ -\x{2122}]\s+|\s*[^ -\x{2122}]/u', '', $aSiteInfo['description']);
1072 
1073  $sThumbnail = '';
1074  if(!empty($aSiteInfo['thumbnailUrl']))
1075  $sThumbnail = $aSiteInfo['thumbnailUrl'];
1076  else if(!empty($aSiteInfo['OGImage']))
1077  $sThumbnail = $aSiteInfo['OGImage'];
1078  $bThumbnail = !empty($sThumbnail);
1079 
1080  return array(
1081  'object_id' => $aOwner['id'],
1082  'content' => $this->_oTemplate->parseHtmlByName('common_link.html', array(
1083  'ch_if:show_thumnail' => array(
1084  'condition' => $bThumbnail,
1085  'content' => array(
1086  'thumbnail' => '{ch_wall_get_image_url}' . urlencode(base64_encode($sThumbnail))
1087  )
1088  ),
1089  'title' => $sTitle,
1090  'url' => strpos($sUrl, 'http://') === false && strpos($sUrl, 'https://') === false ? 'http://' . $sUrl : $sUrl,
1091  'description' => $sDescription
1092  )),
1093  'title' => _t('_wall_added_title_link', getNickName($aOwner['id'])),
1094  'description' => $sUrl . ' - ' . $sTitle
1095  );
1096  }
1097 
1102  function _getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules)
1103  {
1104  return $this->_oTemplate->getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules);
1105  }
1106  function _getLoadMore($iStart, $iPerPage, $bEnabled = true, $bVisible = true)
1107  {
1108  return $this->_oTemplate->getLoadMore($iStart, $iPerPage, $bEnabled, $bVisible);
1109  }
1110  function _getLoadMoreOutline($iStart, $iPerPage, $bEnabled = true, $bVisible = true)
1111  {
1112  return $this->_oTemplate->getLoadMoreOutline($iStart, $iPerPage, $bEnabled, $bVisible);
1113  }
1114  function _getPaginate($sFilter, $sTimeline, $aModules)
1115  {
1116  $sJsObject = $this->_oConfig->getJsObject('view');
1117 
1118  return new ChWsbPaginate(array(
1119  'page_url' => 'javascript:void(0);',
1120  'start' => 0,
1121  'count' => $this->_oDb->getEventsCount($this->_iOwnerId, $sFilter, $sTimeline, $aModules),
1122  'per_page' => $this->_oConfig->getPerPage(),
1123  'on_change_page' => $sJsObject . '.changePage({start}, {per_page})',
1124  'on_change_per_page' => $sJsObject . '.changePerPage(this)',
1125  ));
1126  }
1127  function _getPosts($sOrder, $iStart, $iPerPage, $sFilter, $sTimeline, $aModules)
1128  {
1129  $iDays = -1;
1130  $bPrevious = $bNext = false;
1131 
1132  $iStartEv = $iStart;
1133  $iPerPageEv = $iPerPage;
1134 
1135  //--- Check for Previous
1136  if($iStart - 1 >= 0) {
1137  $iStartEv -= 1;
1138  $iPerPageEv += 1;
1139  $bPrevious = true;
1140  }
1141 
1142  //--- Check for Next
1143  $iPerPageEv += 1;
1144  $aEvents = $this->_oDb->getEvents(array(
1145  'browse' => 'owner',
1146  'owner_id' => $this->_iOwnerId,
1147  'order' => $sOrder,
1148  'start' => $iStartEv,
1149  'count' => $iPerPageEv,
1150  'filter' => $sFilter,
1151  'timeline' => $sTimeline,
1152  'modules' => $aModules
1153  ));
1154 
1155  //--- Check for Previous
1156  if($bPrevious) {
1157  $aEvent = array_shift($aEvents);
1158  $iDays = (int)$aEvent['days'];
1159  }
1160 
1161  //--- Check for Next
1162  if(count($aEvents) > $iPerPage) {
1163  $aEvent = array_pop($aEvents);
1164  $bNext = true;
1165  }
1166 
1167  $iEvents = count($aEvents);
1168  $sContent = $this->_oTemplate->getEmpty($iEvents <= 0);
1169  if($iEvents <= 0)
1170  $sContent .= $this->_oTemplate->getDividerToday();
1171 
1172  $bFirst = true;
1173  foreach($aEvents as $aEvent) {
1174  $aEvent['content'] = !empty($aEvent['action']) ? $this->_oTemplate->getSystem($aEvent) : $this->_oTemplate->getCommon($aEvent);
1175  if(empty($aEvent['content']))
1176  continue;
1177 
1178  if($bFirst) {
1179  $sContent .= $this->_oTemplate->getDividerToday($aEvent);
1180  $bFirst = false;
1181  }
1182 
1183  $sContent .= !empty($aEvent['content']) ? $this->_oTemplate->getDivider($iDays, $aEvent) : '';
1184  $sContent .= $aEvent['content'];
1185  }
1186 
1187  $sContent .= $this->_getLoadMore($iStart, $iPerPage, $bNext, $iEvents > 0);
1188  return $sContent;
1189  }
1190  function _getPostsOutline($sOrder, $iStart, $iPerPage, $sFilter, $aModules)
1191  {
1192  $iStartEv = $iStart;
1193  $iPerPageEv = $iPerPage;
1194 
1195  //--- Check for Next
1196  $iPerPageEv += 1;
1197  $aEvents = $this->_oDb->getEvents(array(
1198  'browse' => CH_WALL_VIEW_OUTLINE,
1199  'order' => $sOrder,
1200  'start' => $iStartEv,
1201  'count' => $iPerPageEv,
1202  'filter' => $sFilter,
1203  'modules' => $aModules
1204  ));
1205 
1206  //--- Check for Next
1207  $bNext = false;
1208  if(count($aEvents) > $iPerPage) {
1209  $aEvent = array_pop($aEvents);
1210  $bNext = true;
1211  }
1212 
1213  $iEvents = count($aEvents);
1214  foreach($aEvents as $aEvent) {
1215  if(empty($aEvent['action']))
1216  continue;
1217 
1218  $aEvent['content'] = $this->_oTemplate->getSystem($aEvent, CH_WALL_VIEW_OUTLINE);
1219  if(empty($aEvent['content']))
1220  continue;
1221 
1222  $sContent .= $aEvent['content'];
1223  }
1224 
1225  $sPaginate = $this->_getLoadMoreOutline($iStart, $iPerPage, $bNext, $iEvents > 0);
1226  return array($sContent, $sPaginate);
1227  }
1228  function _getWriteForm($sGetFormArrayMethod = '_getWriteFormCommon')
1229  {
1230  if(!method_exists($this, $sGetFormArrayMethod))
1231  return '';
1232 
1233  $aForm = $this->$sGetFormArrayMethod();
1234  $oForm = new ChTemplFormView($aForm);
1235  return $oForm->getCode();
1236  }
1238  {
1239  $sJsObject = $this->_oConfig->getJsObject('post');
1240 
1241  $aForm = array(
1242  'form_attrs' => array(
1243  'name' => 'WallPostText',
1244  'action' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/',
1245  'method' => 'post',
1246  'enctype' => 'multipart/form-data',
1247  'target' => 'WallPostIframe',
1248  'onsubmit' => 'javascript:return ' . $sJsObject . '.postSubmit(this);'
1249  ),
1250  'inputs' => array(
1251  'content' => array(
1252  'type' => 'textarea',
1253  'name' => 'content',
1254  'caption' => '',
1255  'colspan' => true
1256  ),
1257  'submit' => array(
1258  'type' => 'submit',
1259  'name' => 'submit',
1260  'value' => _t('_wall_post'),
1261  'colspan' => true
1262  )
1263  ),
1264  );
1265  $aForm['inputs'] = array_merge($aForm['inputs'], $this->_addHidden('text'));
1266 
1267  return $aForm;
1268  }
1270  {
1271  $aForm = $this->_getWriteFormCommon();
1272  $aForm['inputs']['WallOwnerId']['value'] = 0;
1273 
1274  return $aForm;
1275  }
1276  function _getShareLinkForm($sGetFormArrayMethod = '_getShareLinkFormCommon')
1277  {
1278  if(!method_exists($this, $sGetFormArrayMethod))
1279  return '';
1280 
1281  $aForm = $this->$sGetFormArrayMethod();
1282  $oForm = new ChTemplFormView($aForm);
1283  return $oForm->getCode();
1284  }
1286  {
1287  $sJsObject = $this->_oConfig->getJsObject('post');
1288 
1289  $aForm = array(
1290  'form_attrs' => array(
1291  'name' => 'WallPostLink',
1292  'action' => CH_WSB_URL_ROOT . $this->_oConfig->getBaseUri() . 'post/',
1293  'method' => 'post',
1294  'enctype' => 'multipart/form-data',
1295  'target' => 'WallPostIframe',
1296  'onsubmit' => 'javascript:return ' . $sJsObject . '.postSubmit(this);'
1297  ),
1298  'inputs' => array(
1299  'title' => array(
1300  'type' => 'text',
1301  'name' => 'url',
1302  'caption' => _t('_wall_link_url'),
1303  ),
1304  'submit' => array(
1305  'type' => 'submit',
1306  'name' => 'submit',
1307  'value' => _t('_wall_post'),
1308  'colspan' => true
1309  )
1310  ),
1311  );
1312  $aForm['inputs'] = array_merge($aForm['inputs'], $this->_addHidden('link'));
1313 
1314  return $aForm;
1315  }
1317  {
1318  $aForm = $this->_getShareLinkFormCommon();
1319  $aForm['inputs']['WallOwnerId']['value'] = 0;
1320 
1321  return $aForm;
1322  }
1324  {
1325  return new ChWallPrivacy($this);
1326  }
1327  function _getObjectVoting($aEvent)
1328  {
1329  if(in_array($aEvent['type'], array('profile', 'friend')) || in_array($aEvent['action'], array('commentPost', 'comment_add')))
1330  return $this->_getObjectVotingDefault($aEvent['id']);
1331 
1332  $sType = $aEvent['type'];
1333  $sAction = $aEvent['action'];
1334  $iObjectId = $aEvent['object_id'];
1335  if($this->_oConfig->isGrouped($sType, $sAction, $iObjectId) || $this->_oConfig->isGroupedObject($iObjectId))
1336  return $this->_getObjectVotingDefault($aEvent['id']);
1337 
1338  $oVoting = new ChWallVoting($sType, $iObjectId);
1339  if($oVoting->isEnabled())
1340  return $oVoting;
1341 
1342  return $this->_getObjectVotingDefault($aEvent['id']);
1343  }
1344 
1345  function _getObjectVotingDefault($iEventId)
1346  {
1347  return new ChWallVoting($this->_oConfig->getVotingSystemName(), $iEventId);
1348  }
1349 
1350  function _addHidden($sPostType = "photos", $sContentType = "upload", $sAction = "post")
1351  {
1352  return array(
1353  'WallOwnerId' => array (
1354  'type' => 'hidden',
1355  'name' => 'WallOwnerId',
1356  'value' => $this->_iOwnerId,
1357  ),
1358  'WallPostAction' => array (
1359  'type' => 'hidden',
1360  'name' => 'WallPostAction',
1361  'value' => $sAction,
1362  ),
1363  'WallPostType' => array (
1364  'type' => 'hidden',
1365  'name' => 'WallPostType',
1366  'value' => $sPostType,
1367  ),
1368  'WallContentType' => array (
1369  'type' => 'hidden',
1370  'name' => 'WallContentType',
1371  'value' => $sContentType,
1372  ),
1373  );
1374  }
1375  function _isViewAllowed()
1376  {
1377  $oPrivacy = $this->_getObjectPrivacy();
1378  return $oPrivacy->check('view', $this->_iOwnerId, $this->_getAuthorId());
1379  }
1380  function _isCommentPostAllowed($bPerform = false)
1381  {
1382  if(isAdmin())
1383  return true;
1384 
1385  $iAuthorId = $this->_getAuthorId();
1386  if($iAuthorId == 0 && getParam('wall_enable_guest_comments') == 'on')
1387  return true;
1388 
1389  if(isBlocked($this->_iOwnerId, $iAuthorId))
1390  return false;
1391 
1392  $aCheckResult = checkAction($iAuthorId, ACTION_ID_TIMELINE_POST_COMMENT, $bPerform);
1393  return $aCheckResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
1394  }
1395  function _isCommentDeleteAllowed($aEvent, $bPerform = false)
1396  {
1397  if(!isLogged())
1398  return false;
1399 
1400  if(isAdmin())
1401  return true;
1402 
1403  $iUserId = (int)$this->_getAuthorId();
1404  $sCommonPostPrefix = $this->_oConfig->getCommonPostPrefix();
1405  if((int)$aEvent['owner_id'] == $iUserId || (strpos($aEvent['type'], $sCommonPostPrefix) === 0 && (int)$aEvent['object_id'] == $iUserId))
1406  return true;
1407 
1408  $aCheckResult = checkAction($iUserId, ACTION_ID_TIMELINE_DELETE_COMMENT, $bPerform);
1409  return $aCheckResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
1410  }
1411  function _isRepostAllowed($aEvent, $bPerform = false)
1412  {
1413  if(!isLogged())
1414  return false;
1415 
1416  $bSystem = $this->_oConfig->isSystem($aEvent['type'], $aEvent['action']);
1417  if($bSystem && strcmp($aEvent['action'], 'commentPost') === 0)
1418  return false;
1419 
1420  if(isAdmin())
1421  return true;
1422 
1423  $iUserId = (int)$this->_getAuthorId();
1424  if(($bSystem && (int)$aEvent['owner_id'] == $iUserId) || (!$bSystem && (int)$aEvent['object_id'] == $iUserId))
1425  return true;
1426 
1427  $aCheckResult = checkAction($iUserId, ACTION_ID_TIMELINE_REPOST, $bPerform);
1428  return $aCheckResult[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
1429  }
1430  function _getAuthorId()
1431  {
1432  return !isLogged() ? 0 : getLoggedId();
1433  }
1435  {
1436  return !isLogged() ? '' : getLoggedPassword();
1437  }
1438  function _getAuthorIp()
1439  {
1440  return getVisitorIP();
1441  }
1442  function _echoResultJson($a, $isAutoWrapForFormFileSubmit = false)
1443  {
1444  header('Content-type: text/html; charset=utf-8');
1445 
1446  $s = json_encode($a);
1447  if ($isAutoWrapForFormFileSubmit && !empty($_FILES))
1448  $s = '<textarea>' . $s . '</textarea>';
1449  echo $s;
1450  }
1451 }
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
header
</code > Be careful enabling this directive if you have a redirector script that does not use the< code > Location</code > HTTP header
Definition: URI.MungeResources.txt:10
ChWallModule\_getObjectVoting
_getObjectVoting($aEvent)
Definition: ChWallModule.php:1327
$oSettings
$oSettings
Definition: advanced_settings.php:20
ChWallVoting
Definition: ChWallVoting.php:12
ChWallModule\$_iOwnerId
$_iOwnerId
Definition: ChWallModule.php:41
getVisitorIP
getVisitorIP($isProxyCheck=true)
Definition: utils.inc.php:643
ChWallModule\$_sCmtTemplate
$_sCmtTemplate
Definition: ChWallModule.php:48
getMyFriendsEx
getMyFriendsEx($iID, $sWhereParam='', $sSortParam='', $sqlLimit='')
Definition: profiles.inc.php:384
ChTemplFormView
Definition: ChTemplFormView.php:11
ChWallModule\_getObjectPrivacy
_getObjectPrivacy()
Definition: ChWallModule.php:1323
ChWallModule\_getPostsOutline
_getPostsOutline($sOrder, $iStart, $iPerPage, $sFilter, $aModules)
Definition: ChWallModule.php:1190
getLoggedPassword
getLoggedPassword()
Definition: profiles.inc.php:36
LoadingBox
LoadingBox($sName)
Definition: design.inc.php:185
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
ChWallModule\$_sCmtViewTemplate
$_sCmtViewTemplate
Definition: ChWallModule.php:47
getSiteInfo
getSiteInfo($sSourceUrl, $aProcessAdditionalTags=array())
Definition: utils.inc.php:1460
ChWsbModule\isLogged
isLogged()
Definition: ChWsbModule.php:113
ChWallModule\serviceGetRepostElementBlock
serviceGetRepostElementBlock($iOwnerId, $sType, $sAction, $iObjectId, $aParams=array())
Definition: ChWallModule.php:903
ChWsbRequest\serviceExists
static serviceExists($mixedModule, $sMethod, $sClass="Module")
Definition: ChWsbRequest.php:70
ch_js_string
ch_js_string($mixedInput, $iQuoteType=CH_ESCAPE_STR_AUTO)
Definition: utils.inc.php:1294
CH_WALL_FILTER_ALL
const CH_WALL_FILTER_ALL
Definition: ChWallModule.php:19
ChWallModule\actionGetUploader
actionGetUploader($iOwnerId, $sType, $sSubType='')
Definition: ChWallModule.php:330
ChWallModule\_processLinkUpload
_processLinkUpload()
Definition: ChWallModule.php:1053
ChWallModule\serviceResponse
serviceResponse($oAlert)
Definition: ChWallModule.php:465
CHECK_ACTION_RESULT_ALLOWED
const CHECK_ACTION_RESULT_ALLOWED
Definition: membership_levels.inc.php:60
ChWallModule\servicePostBlockIndexTimeline
servicePostBlockIndexTimeline($sType='id')
Definition: ChWallModule.php:477
$sResult
$sResult
Definition: advanced_settings.php:26
ChWallModule\onDelete
onDelete($aEvent)
Definition: ChWallModule.php:954
$aModule
$aModule
Definition: classifieds.php:21
ChWallModule\getSettingsForm
getSettingsForm($mixedResult)
Definition: ChWallModule.php:71
ChWallModule\__construct
__construct($aModule)
Definition: ChWallModule.php:53
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$aResult
$aResult
Definition: index.php:19
ChWallModule\_getAuthorId
_getAuthorId()
Definition: ChWallModule.php:1430
ch_get
ch_get($sName)
Definition: utils.inc.php:1664
$oAlert
$oAlert
Definition: embed.php:15
CHECK_ACTION_RESULT
const CHECK_ACTION_RESULT
Definition: membership_levels.inc.php:54
$sUrl
$sUrl
Definition: cart.php:15
ChWallModule\_getLoadMoreOutline
_getLoadMoreOutline($iStart, $iPerPage, $bEnabled=true, $bVisible=true)
Definition: ChWallModule.php:1110
php
ChWsbModuleDb
Definition: ChWsbModuleDb.php:12
$iId
$iId
Definition: license.php:15
ChWallModule\serviceViewBlockIndexOutline
serviceViewBlockIndexOutline($iStart=-1, $iPerPage=-1, $sFilter='', $aModules=array())
Definition: ChWallModule.php:726
ChWallModule\_getObjectVotingDefault
_getObjectVotingDefault($iEventId)
Definition: ChWallModule.php:1345
ChWallModule\$_aPostElements
$_aPostElements
Definition: ChWallModule.php:42
ChWallModule\_getShareLinkFormIndex
_getShareLinkFormIndex()
Definition: ChWallModule.php:1316
ChWsbSubscription\getInstance
static getInstance()
Definition: ChWsbSubscription.php:67
ChWallModule\servicePostBlockProfileTimeline
servicePostBlockProfileTimeline($mixed, $sType='id')
Definition: ChWallModule.php:552
ChWallModule\$_sCmtPostTemplate
$_sCmtPostTemplate
Definition: ChWallModule.php:46
ChWallResponse
Definition: ChWallResponse.php:11
$iPerPage
else $iPerPage
Definition: browse.php:61
CH_WALL_VIEW_OUTLINE
const CH_WALL_VIEW_OUTLINE
Definition: ChWallModule.php:24
isAdmin
isAdmin()
Definition: index.php:649
CH_SLASHES_NO_ACTION
const CH_SLASHES_NO_ACTION
Definition: utils.inc.php:30
ChWallModule\serviceGetSubscriptionParams
serviceGetSubscriptionParams($sUnit, $sAction, $iObjectId)
Definition: ChWallModule.php:832
ChWallModule\actionGetPosts
actionGetPosts()
Definition: ChWallModule.php:243
ChWallModule\serviceGetRepostJsScript
serviceGetRepostJsScript()
Definition: ChWallModule.php:916
ChWallModule\_getTimeline
_getTimeline($iStart, $iPerPage, $sFilter, $sTimeline, $aModules)
Definition: ChWallModule.php:1102
ChWallModule\_getAuthorPassword
_getAuthorPassword()
Definition: ChWallModule.php:1434
$oForm
$oForm
Definition: host_tools.php:42
ChWallModule\serviceGetActionsChecklist
serviceGetActionsChecklist($sType)
Definition: ChWallModule.php:756
CH_WALL_VIEW_TIMELINE
const CH_WALL_VIEW_TIMELINE
Definition: ChWallModule.php:23
ChWsbAlerts
Definition: ChWsbAlerts.php:39
ChWallModule\serviceGetSpyData
serviceGetSpyData()
Definition: ChWallModule.php:847
ChWallModule\getRepostedLanguageKey
getRepostedLanguageKey($sType, $sAction, $mixedObjectId, $bTitle=false)
Definition: ChWallModule.php:926
ChWallModule\actionRss
actionRss($sUsername)
Definition: ChWallModule.php:424
exit
exit
Definition: cart.php:21
$sType
$sType
Definition: actions.inc.php:11
$aResults
$aResults
Definition: email_templates.php:25
ChWallModule\actionGetPaginate
actionGetPaginate()
Definition: ChWallModule.php:308
$oMemberMenu
$oMemberMenu
Definition: member_menu_queries.php:20
ChWallModule\_addHidden
_addHidden($sPostType="photos", $sContentType="upload", $sAction="post")
Definition: ChWallModule.php:1350
ChWallModule\serviceGetRepostCounter
serviceGetRepostCounter($sType, $sAction, $iObjectId, $aParams=array())
Definition: ChWallModule.php:909
$oModuleDb
$oModuleDb
Definition: classifieds.php:20
ChWallModule\_isCommentDeleteAllowed
_isCommentDeleteAllowed($aEvent, $bPerform=false)
Definition: ChWallModule.php:1395
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
ChWsbRssFactory
Definition: ChWsbRssFactory.php:9
getLoggedId
getLoggedId()
Definition: profiles.inc.php:32
$sTitle
$sTitle
Definition: actions.inc.php:13
ChWallModule\serviceGetUploadersChecklist
serviceGetUploadersChecklist($sType)
Definition: ChWallModule.php:775
ChWallModule\onPost
onPost($iId)
Definition: ChWallModule.php:943
ChWallModule\_getShareLinkForm
_getShareLinkForm($sGetFormArrayMethod='_getShareLinkFormCommon')
Definition: ChWallModule.php:1276
ChWallModule\_echoResultJson
_echoResultJson($a, $isAutoWrapForFormFileSubmit=false)
Definition: ChWallModule.php:1442
ChWallModule\actionGetPost
actionGetPost()
Definition: ChWallModule.php:227
ChWallModule\$_sDividerTemplate
$_sDividerTemplate
Definition: ChWallModule.php:44
ChWallModule\_getPostTabs
_getPostTabs($sType)
Definition: ChWallModule.php:587
getNickName
getNickName( $ID='')
Definition: profiles.inc.php:461
ChWallModule\_isRepostAllowed
_isRepostAllowed($aEvent, $bPerform=false)
Definition: ChWallModule.php:1411
CH_WALL_DIVIDER_ID
const CH_WALL_DIVIDER_ID
Definition: ChWallModule.php:35
CH_TAGS_NO_ACTION
const CH_TAGS_NO_ACTION
Definition: utils.inc.php:21
ChWallModule\_processTextUpload
_processTextUpload()
Definition: ChWallModule.php:1011
ch_file_get_contents
ch_file_get_contents($sFileUrl, $aParams=array(), $sMethod='get', $aHeaders=array(), &$sHttpCode=null)
Definition: utils.inc.php:1357
ch_instance
ch_instance($sClassName, $aParams=array(), $aModule=array())
Definition: utils.inc.php:1264
ChWallModule\setSettings
setSettings($aData)
Definition: ChWallModule.php:85
ChWallModule\_getShareLinkFormCommon
_getShareLinkFormCommon()
Definition: ChWallModule.php:1285
ChWsbPaginate
Definition: ChWsbPaginate.php:69
ChWallModule\_getLoadMore
_getLoadMore($iStart, $iPerPage, $bEnabled=true, $bVisible=true)
Definition: ChWallModule.php:1106
ChWsbModule
Definition: ChWsbModule.php:41
ChWallModule\serviceGetRepostJsClick
serviceGetRepostJsClick($iOwnerId, $sType, $sAction, $iObjectId)
Definition: ChWallModule.php:921
$bResult
$bResult
Definition: get_file.php:11
ChWallModule\actionGetImage
actionGetImage($iId, $sUrl)
Definition: ChWallModule.php:360
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition: profiles.inc.php:484
ch_proto
ch_proto($sUrl=CH_WSB_URL_ROOT)
Definition: utils.inc.php:1848
ChWallModule\serviceUpdateHandlers
serviceUpdateHandlers($sModuleUri='all', $bInstall=true)
Definition: ChWallModule.php:795
ChWallModule\serviceGetSpyPost
serviceGetSpyPost($sAction, $iObjectId=0, $iSenderId=0, $aExtraParams=array())
Definition: ChWallModule.php:869
ChWallModule\actionGetPostsOutline
actionGetPostsOutline()
Definition: ChWallModule.php:265
CH_WALL_PARSE_TYPE_REPOST
const CH_WALL_PARSE_TYPE_REPOST
Definition: ChWallModule.php:31
ChWsbAdminSettings
Definition: ChWsbAdminSettings.php:35
ChWallModule\serviceGetMemberMenuItem
serviceGetMemberMenuItem()
Definition: ChWallModule.php:812
checkAction
checkAction($iMemberId, $actionID, $performAction=false, $iForcedProfID=0, $isCheckMemberStatus=true)
Definition: membership_levels.inc.php:313
ChWallModule\actionGetRepostedBy
actionGetRepostedBy()
Definition: ChWallModule.php:345
CH_TAGS_STRIP
const CH_TAGS_STRIP
Definition: utils.inc.php:22
ChWallModule\serviceViewBlockIndexTimeline
serviceViewBlockIndexTimeline($iStart=-1, $iPerPage=-1, $sFilter='', $sTimeline='', $sType='id', $aModules=array())
Definition: ChWallModule.php:513
ChWallModule\_getAuthorIp
_getAuthorIp()
Definition: ChWallModule.php:1438
ChWallModule\_getPosts
_getPosts($sOrder, $iStart, $iPerPage, $sFilter, $sTimeline, $aModules)
Definition: ChWallModule.php:1127
isBlocked
isBlocked($iFirstProfile, $iSecondProfile)
Definition: utils.inc.php:128
defineMembershipActions
defineMembershipActions($aActionsAll, $sPrefix='CH_')
Definition: membership_levels.inc.php:744
$s
$s
Definition: embed.php:13
ChWallModule\actionDelete
actionDelete()
Definition: ChWallModule.php:202
$aProfileInfo
$aProfileInfo
Definition: short_profile_info.php:23
ChWallModule\actionPost
actionPost()
Definition: ChWallModule.php:101
$aModules
$aModules
Definition: constants.inc.php:29
ChWallModule\actionRepost
actionRepost()
Definition: ChWallModule.php:140
ChWallModule\$_sBalloonTemplate
$_sBalloonTemplate
Definition: ChWallModule.php:45
ChWsbAlerts\cache
static cache()
Definition: ChWsbAlerts.php:106
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChWallModule\_getWriteFormCommon
_getWriteFormCommon()
Definition: ChWallModule.php:1237
$aForm
$aForm
Definition: forgot.php:43
ChWallModule\actionGetTimeline
actionGetTimeline()
Definition: ChWallModule.php:288
$sAction
$sAction
Definition: categories.php:274
ChWallModule\_getPaginate
_getPaginate($sFilter, $sTimeline, $aModules)
Definition: ChWallModule.php:1114
ChWallModule\_getWriteFormIndex
_getWriteFormIndex()
Definition: ChWallModule.php:1269
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition: ChWsbService.php:32
ChWallModule\serviceViewBlockAccountTimeline
serviceViewBlockAccountTimeline($mixed, $iStart=-1, $iPerPage=-1, $sFilter='', $sTimeline='', $sType='id', $aModules=array())
Definition: ChWallModule.php:685
ChWallModule\serviceViewBlockProfileTimeline
serviceViewBlockProfileTimeline($mixed, $iStart=-1, $iPerPage=-1, $sFilter='', $sTimeline='', $sType='id', $aModules=array())
Definition: ChWallModule.php:632
ChWallModule\_getWriteForm
_getWriteForm($sGetFormArrayMethod='_getWriteFormCommon')
Definition: ChWallModule.php:1228
ChWallPrivacy
Definition: ChWallPrivacy.php:11
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChWallModule\onRepost
onRepost($iId, $aReposted=array())
Definition: ChWallModule.php:985
ch_ltrim_str
ch_ltrim_str($sString, $sPrefix, $sReplace='')
Definition: utils.inc.php:1787
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
ChWallModule\_isCommentPostAllowed
_isCommentPostAllowed($bPerform=false)
Definition: ChWallModule.php:1380
ChWallModule\_isViewAllowed
_isViewAllowed()
Definition: ChWallModule.php:1375
ChWallModule
Definition: ChWallModule.php:40
$oSubscription
$oSubscription
Definition: notifies.php:28