Cheetah
ChWsbCmts.php
Go to the documentation of this file.
1 <?php
2 
8 require_once( CH_DIRECTORY_PATH_CLASSES . 'ChWsbCmtsQuery.php' );
9 
10 define('CH_OLD_CMT_VOTES', 365*86400); // comment votes older than this number of seconds will be deleted automatically
11 
98 class ChWsbCmts
99 {
100  var $_iId = 0; // obect id to be commented
103  var $bDynamic = false;
104 
105  var $_sSystem = 'profile'; // current comment system name
106  var $_aSystem = array (); // current comments system array
107  var $_aCmtElements = array (); // comment submit form elements
108  var $_oQuery = null;
109  var $_sOrder = 'desc';
110  var $_aMoodText = array(
111  '-1' => '_sys_txt_cmt_mood_negative',
112  '0' => '_sys_txt_cmt_mood_neutral',
113  '1' => '_sys_txt_cmt_mood_positive',
114  );
115 
121  function __construct( $sSystem, $iId, $iInit = 1)
122  {
123  $this->_aCmtElements = array (
124  'CmtParent' => array ( 'reg' => '^[0-9]+$', 'msg' => str_replace('"', '\\"', trim(_t('_bad comment parent id'))) ),
125  'CmtText' => array ( 'reg' => '^.{3,2048}$', 'msg' => str_replace('"', '\\"', trim(_t('_Please enter 3-2048 characters'))) ),
126  'CmtMood' => array ( 'reg' => '^-?[0-9]?$', 'msg' => str_replace('"', '\\"', trim(_t('_You need to select the mood'))) ),
127  );
128 
129  $this->_aSystems =& $this->getSystems ();
130 
131  $this->_sSystem = $sSystem;
132  if (isset($this->_aSystems[$sSystem]))
133  $this->_aSystem = $this->_aSystems[$sSystem];
134  else
135  return;
136 
137  $this->_oQuery = new ChWsbCmtsQuery($this->_aSystem);
138 
139  if ($iInit)
140  $this->init($iId);
141 
142  $this->iGlobAllowHtml = (getParam("enable_tiny_in_comments") == "on") ? 1 : 0;
143 
144  $this->bDynamic = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest';
145  }
146 
154  static function getObjectInstance($sSys, $iId, $iInit = true)
155  {
157  if (!isset($aSystems[$sSys]))
158  return null;
159 
160  ch_import('ChTemplCmtsView');
161  $sClassName = 'ChTemplCmtsView';
162  if ($aSystems[$sSys]['class_name']) {
163  require_once (CH_DIRECTORY_PATH_ROOT . $aSystems[$sSys]['class_file']);
164  $sClassName = $aSystems[$sSys]['class_name'];
165  }
166 
167  $oCmts = new $sClassName($sSys, $iId, $iInit);
168  return $oCmts;
169  }
170 
171  public static function & getSystems ()
172  {
173  if (!isset($GLOBALS['ch_dol_cmts_systems'])) {
174  $GLOBALS['ch_dol_cmts_systems'] = $GLOBALS['MySQL']->fromCache('sys_objects_cmts', 'getAllWithKey', '
175  SELECT
176  `ID` as `system_id`,
177  `ObjectName` AS `name`,
178  `TableCmts` AS `table_cmts`,
179  `TableTrack` AS `table_track`,
180  `AllowTags` AS `allow_tags`,
181  `Nl2br` AS `nl2br`,
182  `SecToEdit` AS `sec_to_edit`,
183  `PerView` AS `per_view`,
184  `IsRatable` AS `is_ratable`,
185  `ViewingThreshold` AS `viewing_threshold`,
186  `AnimationEffect` AS `animation_effect`,
187  `AnimationSpeed` AS `animation_speed`,
188  `IsOn` AS `is_on`,
189  `IsMood` AS `is_mood`,
190  `RootStylePrefix` AS `root_style_prefix`,
191  `TriggerTable` AS `trigger_table`,
192  `TriggerFieldId` AS `trigger_field_id`,
193  `TriggerFieldComments` AS `trigger_field_comments`,
194  `ClassName` AS `class_name`,
195  `ClassFile` AS `class_file`
196  FROM `sys_objects_cmts`', 'name');
197  }
198 
199  return $GLOBALS['ch_dol_cmts_systems'];
200  }
201 
202  function init ($iId)
203  {
204  if(!$this->isEnabled())
205  return;
206 
207  if(empty($this->iId) && $iId)
208  $this->setId($iId);
209  }
210 
214  function checkAction ($iAction, $isPerformAction = false)
215  {
216  $iId = $this->_getAuthorId();
217  $check_res = checkAction($iId, $iAction, $isPerformAction);
218  return $check_res[CHECK_ACTION_RESULT] == CHECK_ACTION_RESULT_ALLOWED;
219  }
220 
221  function checkActionErrorMsg ($iAction)
222  {
223  $iId = $this->_getAuthorId();
224  $check_res = checkAction($iId, $iAction);
225  return $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED ? $check_res[CHECK_ACTION_MESSAGE] : '';
226  }
227 
228  function getId ()
229  {
230  return $this->_iId;
231  }
232 
233  function isEnabled ()
234  {
235  return isset($this->_aSystem['is_on']) && $this->_aSystem['is_on'];
236  }
237 
238  function getSystemName()
239  {
240  return $this->_sSystem;
241  }
242 
243  function getOrder ()
244  {
245  return $this->_sOrder;
246  }
247 
251  function setId ($iId)
252  {
253  if ($iId == $this->getId()) return;
254  $this->_iId = $iId;
255  }
256 
257  function getBaseUrl ()
258  {
259  return '';
260  }
261 
262  function isValidSystem ($sSystem)
263  {
264  return isset($this->_aSystems[$sSystem]);
265  }
266 
267  function isTagsAllowed ()
268  {
269  return $this->_aSystem['allow_tags'];
270  }
271 
272  function isNl2br ()
273  {
274  return $this->_aSystem['nl2br'];
275  }
276 
277  function isRatable ()
278  {
279  return $this->_aSystem['is_ratable'];
280  }
281 
282  function getAllowedEditTime ()
283  {
284  return $this->_aSystem['sec_to_edit'];
285  }
286 
287  function getPerView ()
288  {
289  return $this->_aSystem['per_view'];
290  }
291 
292  function getSystemId ()
293  {
294  return $this->_aSystem['system_id'];
295  }
296 
300  function maintenance ()
301  {
302  $iDeletedRecords = 0;
303  foreach ($this->_aSystems as $aSystem) {
304  if (!$aSystem['is_on'])
305  continue;
306  $oQuery = new ChWsbCmtsQuery($aSystem);
307  $iDeletedRecords += $oQuery->maintenance();
308  unset($oQuery);
309  }
310  return $iDeletedRecords;
311  }
312 
316  function getCommentsArray ($iCmtParentId, $sCmtOrder, $iStart = 0, $iCount = -1)
317  {
318  return $this->_oQuery->getComments ($this->getId(), $iCmtParentId, $this->_getAuthorId(), $sCmtOrder, $iStart, $iCount);
319  }
320 
321  function getCommentRow ($iCmtId)
322  {
323  return $this->_oQuery->getComment ($this->getId(), $iCmtId, $this->_getAuthorId());
324  }
325 
326  function onObjectDelete ($iObjectId = 0)
327  {
328  return $this->_oQuery->deleteObjectComments ($iObjectId ? $iObjectId : $this->getId());
329  }
330 
331  // delete all profiles comments in all systems, if some replies exist, set this comment to anonymous
332 
333  function onAuthorDelete ($iAuthorId)
334  {
335  foreach ($this->_aSystems as $sSystem => $aSystem) {
336  $oQuery = new ChWsbCmtsQuery($aSystem);
337  $oQuery->deleteAuthorComments ($iAuthorId);
338  }
339  return true;
340  }
341 
343  {
344  return $this->_oQuery->getTableName ();
345  }
346 
347  function getObjectCommentsCount ($iObjectId = 0)
348  {
349  return $this->_oQuery->getObjectCommentsCount ($iObjectId ? $iObjectId : $this->getId());
350  }
351 
356  // is rate comment allowed
357  function isRateAllowed ($isPerformAction = false)
358  {
359  return $this->checkAction (ACTION_ID_COMMENTS_VOTE, $isPerformAction);
360  }
361 
362  function msgErrRateAllowed ()
363  {
365  }
366 
367  // is post comment allowed
368  function isPostReplyAllowed ($isPerformAction = false)
369  {
370  return $this->checkAction (ACTION_ID_COMMENTS_POST, $isPerformAction);
371  }
372 
374  {
376  }
377 
378  // is edit own comment allowed
379  function isEditAllowed ($isPerformAction = false)
380  {
381  return $this->checkAction (ACTION_ID_COMMENTS_EDIT_OWN, $isPerformAction);
382  }
383 
384  function msgErrEditAllowed ()
385  {
387  }
388 
389  // is removing own comment allowed
390  function isRemoveAllowed ($isPerformAction = false)
391  {
392  return $this->checkAction (ACTION_ID_COMMENTS_REMOVE_OWN, $isPerformAction);
393  }
394 
396  {
398  }
399 
400  // is edit any comment allowed
401  function isEditAllowedAll ()
402  {
403  return isAdmin() ? true : false;
404  }
405 
406  // is removing any comment allowed
407  function isRemoveAllowedAll ()
408  {
409  return isAdmin() ? true : false;
410  }
411 
415  function actionPaginateGet ()
416  {
417  if (!$this->isEnabled())
418  return '';
419 
420  $iCmtStart = isset($_REQUEST['CmtStart']) ? (int)$_REQUEST['CmtStart'] : 0;
421  $iCmtPerPage= isset($_REQUEST['CmtPerPage']) ? (int)$_REQUEST['CmtPerPage'] : $this->getPerView();
422 
423  return $this->getPaginate($iCmtStart, $iCmtPerPage);
424  }
425 
426  function actionFormGet ()
427  {
428  if (!$this->isEnabled())
429  return '';
430 
431  $sCmtType = isset($_REQUEST['CmtType']) ? $_REQUEST['CmtType'] : 'reply';
432  $iCmtParentId= isset($_REQUEST['CmtParent']) ? (int)$_REQUEST['CmtParent'] : 0;
433 
434  return $this->getForm($sCmtType, $iCmtParentId);
435  }
436 
437  function actionCmtsGet ()
438  {
439  if (!$this->isEnabled())
440  return '';
441 
442  $iCmtParentId = (int)$_REQUEST['CmtParent'];
443  $sCmtOrder = isset($_REQUEST['CmtOrder']) ? $_REQUEST['CmtOrder'] : $this->_sOrder;
444  $iCmtStart = isset($_REQUEST['CmtStart']) ? (int)$_REQUEST['CmtStart'] : 0;
445  $iCmtPerPage= isset($_REQUEST['CmtPerPage']) ? (int)$_REQUEST['CmtPerPage'] : -1;
446 
447  return $this->getComments($iCmtParentId, $sCmtOrder, $iCmtStart, $iCmtPerPage);
448  }
449 
450  function actionCmtGet ()
451  {
452  if (!$this->isEnabled())
453  return '';
454 
455  $iCmtId = (int)$_REQUEST['Cmt'];
456  return $this->getComment ($iCmtId, (isset($_REQUEST['Type']) ? $_REQUEST['Type'] : 'new'));
457  }
458 
459  function actionCmtPost()
460  {
461  if(!$this->isEnabled())
462  return '';
463 
464  if(!$this->isPostReplyAllowed())
465  return $this->msgErrPostReplyAllowed();
466 
467  $iCmtObjectId = (int)$this->getId();
468  $iCmtParentId = (int)$_REQUEST['CmtParent'];
469  $iCmtAuthorId = $this->_getAuthorId();
470 
471  if ($this->_isSpam($_REQUEST['CmtText']))
472  return sprintf(_t("_sys_spam_detected"), CH_WSB_URL_ROOT . 'contact.php');
473 
474  $sText = $this->_prepareTextForSave ($_REQUEST['CmtText']);
475 
476  $iMood = (int)$_REQUEST['CmtMood'];
477 
478  $iCmtNewId = $this->_oQuery->addComment ($iCmtObjectId, $iCmtParentId, $iCmtAuthorId, $sText, $iMood);
479 
480  if(false === $iCmtNewId)
481  return '';
482 
483  $this->_triggerComment();
484 
485  $this->isPostReplyAllowed(true);
486 
487  ch_import('ChWsbAlerts');
488  $oZ = new ChWsbAlerts($this->_sSystem, 'commentPost', $iCmtObjectId, $iCmtAuthorId, array('comment_id' => $iCmtNewId, 'comment_author_id' => $iCmtAuthorId));
489  $oZ->alert();
490 
491  $oZ = new ChWsbAlerts('comment', 'add', $iCmtNewId, $iCmtAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iCmtObjectId));
492  $oZ->alert();
493 
494  return $iCmtNewId;
495  }
496 
497  // returns error string on error, or empty string on success
498 
499  function actionCmtRemove ()
500  {
501  if(!$this->isEnabled())
502  return '';
503 
504  $iCmtId = (int)$_REQUEST['Cmt'];
505  $iObjectId = (int)$this->getId();
506  $iAuthorId = $this->_getAuthorId();
507 
508  $aCmt = $this->_oQuery->getCommentSimple ($iObjectId, $iCmtId);
509  if(!$aCmt)
510  return _t('_No such comment');
511 
512  if($aCmt['cmt_replies'] > 0)
513  return _t('_Can not delete comments with replies');
514 
515  $isRemoveAllowed = $this->isRemoveAllowedAll() || ($aCmt['cmt_author_id'] == $iAuthorId && $this->isRemoveAllowed());
516  if (!$isRemoveAllowed && $aCmt['cmt_secs_ago'] > ($this->getAllowedEditTime()+20))
517  return $aCmt['cmt_author_id'] == $iAuthorId && !$this->isRemoveAllowed() ? strip_tags($this->msgErrRemoveAllowed()) : _t('_Access denied');
518 
519  if (!$this->_oQuery->removeComment ($iObjectId, $aCmt['cmt_id'], $aCmt['cmt_parent_id']))
520  return _t('_Database Error');
521 
522  $this->_triggerComment();
523 
524  if ($aCmt['cmt_author_id'] == $iAuthorId)
525  $this->isRemoveAllowed(true);
526 
527  ch_import('ChWsbAlerts');
528  $oZ = new ChWsbAlerts($this->_sSystem, 'commentRemoved', $iObjectId, $iAuthorId, array('comment_id' => $aCmt['cmt_id'], 'comment_author_id' => $aCmt['cmt_author_id']));
529  $oZ->alert();
530 
531  $oZ = new ChWsbAlerts('comment', 'delete', $aCmt['cmt_id'], $iAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iObjectId));
532  $oZ->alert();
533 
534  return '';
535  }
536 
537  // returns string with "err" prefix on error, or string with html form on success
538 
539  function actionCmtEdit ()
540  {
541  if (!$this->isEnabled()) return '';
542 
543  $iCmtId = (int)$_REQUEST['Cmt'];
544  $aCmt = $this->_oQuery->getCommentSimple ($this->getId(), $iCmtId);
545 
546  if (!$aCmt)
547  return 'err'._t('_No such comment');
548 
549  $isEditAllowed = $this->isEditAllowedAll() || ($aCmt['cmt_author_id'] == $this->_getAuthorId() && $this->isEditAllowed());
550  if (!$isEditAllowed && $aCmt['cmt_secs_ago'] > ($this->getAllowedEditTime()+20))
551  return 'err' . ($aCmt['cmt_author_id'] == $this->_getAuthorId() && !$this->isEditAllowed() ? strip_tags($this->msgErrEditAllowed()) : _t('_Access denied'));
552 
553  return $this->_getFormBox ('edit', array('id' => $iCmtId, 'parent_id' => $aCmt['cmt_parent_id'], 'text' => $aCmt['cmt_text']));
554  }
555 
557  {
558  if (!$this->isEnabled()) return '{}';
559 
560  $iCmtId = (int)$_REQUEST['Cmt'];
561 
562  if ($this->_isSpam($_REQUEST['CmtText']))
563  return json_encode(array('err' => sprintf(_t("_sys_spam_detected"), CH_WSB_URL_ROOT . 'contact.php')));
564 
565  $iObjectId = $this->getId();
566  $iAuthorId = $this->_getAuthorId();
567 
568  $sText = $this->_prepareTextForSave ($_REQUEST['CmtText']);
569  $sTextRet = stripslashes($sText);
570 
571  $iCmtMood = (int)$_REQUEST['CmtMood'];
572 
573  $aCmt = $this->_oQuery->getCommentSimple ($iObjectId, $iCmtId);
574  if(!$aCmt)
575  return '{}';
576 
577  $isEditAllowed = $this->isEditAllowedAll() || ($aCmt['cmt_author_id'] == $iAuthorId && $this->isEditAllowed());
578 
579  if (!$isEditAllowed && $aCmt['cmt_secs_ago'] > ($this->getAllowedEditTime()+20))
580  return '{}';
581 
582  if (($sTextRet != $aCmt['cmt_text'] || $iCmtMood != $aCmt['cmt_mood']) && $this->_oQuery->updateComment ($iObjectId, $aCmt['cmt_id'], $sText, $iCmtMood)) {
583  if ($aCmt['cmt_author_id'] == $iAuthorId)
584  $this->isEditAllowed(true);
585 
586  ch_import('ChWsbAlerts');
587  $oZ = new ChWsbAlerts($this->_sSystem, 'commentUpdated', $iObjectId, $iAuthorId, array('comment_id' => $aCmt['cmt_id'], 'comment_author_id' => $aCmt['cmt_author_id']));
588  $oZ->alert();
589 
590  $oZ = new ChWsbAlerts('comment', 'change', $aCmt['cmt_id'], $iAuthorId, array('object_system' => $this->_sSystem, 'object_id' => $iObjectId));
591  $oZ->alert();
592  }
593 
594  $aCmt = $this->_oQuery->getCommentSimple($iObjectId, $iCmtId);
595 
596  return json_encode(array('text' => $aCmt['cmt_text'], 'mood' => $aCmt['cmt_mood'], 'mood_text' => _t($this->_aMoodText[$aCmt['cmt_mood']])));
597  }
598 
599  function actionCmtRate ()
600  {
601  if (!$this->isEnabled()) return _t('_Error occured');
602  if (!$this->isRatable()) return _t('_Error occured');
603  if (!$this->isRateAllowed()) return strip_tags($this->msgErrRateAllowed());
604 
605  $iCmtId = (int)$_REQUEST['Cmt'];
606  $iRate = (int)$_REQUEST['Rate'];
607 
608  if($iRate >= 1)
609  $iRate = 1;
610  elseif($iRate <= -1)
611  $iRate = -1;
612  else
613  return _t('_Error occured');
614 
615  if(!$this->_oQuery->rateComment($this->getSystemId(), $iCmtId, $iRate, $this->_getAuthorId(), $this->_getAuthorIp()))
616  return _t('_Duplicate vote');
617 
618  $aCmt = $this->_oQuery->getCommentSimple ($this->getId(), $iCmtId);
619 
620  $this->isRateAllowed(true);
621 
622  ch_import('ChWsbAlerts');
623  $oZ = new ChWsbAlerts($this->_sSystem, 'commentRated', $this->getId(), $this->_getAuthorId(), array('comment_id' => $iCmtId, 'comment_author_id' => $aCmt['cmt_author_id'], 'rate' => $iRate));
624  $oZ->alert();
625 
626  return '';
627  }
628 
632  function _getAuthorId ()
633  {
634  return isMember() ? (int)$_COOKIE['memberID'] : 0;
635  }
636 
637  function _getAuthorPassword ()
638  {
639  return isMember() ? $_COOKIE['memberPassword'] : "";
640  }
641 
642  function _getAuthorIp ()
643  {
644  return getVisitorIP();
645  }
646 
648  {
649  if ($this->isNl2br())
650  return str_replace(array('<br />', '&shy;'), '', $s);
651  return $s;
652  }
653 
655  {
656  if ($this->iGlobAllowHtml || $this->isTagsAllowed()) {
657  $iTagsAction = CH_TAGS_VALIDATE;
658  }
659  elseif (!$this->iGlobAllowHtml && $this->isNl2br()) {
660  $s = WordWrapStr($s);
661  $iTagsAction = CH_TAGS_STRIP_AND_NL2BR;
662  }
663  else {
664  $iTagsAction = CH_TAGS_STRIP;
665  }
666 
667  return process_db_input($s, $iTagsAction);
668  }
669 
671  {
672  return 0 === strpos($s, '<iframe') ? $s : ch_linkify_html($s, 'class="' . CH_WSB_LINK_CLASS . '"');
673  }
674 
675  function _triggerComment()
676  {
677  if (!$this->_aSystem['trigger_table'])
678  return false;
679  $iId = $this->getId();
680  if (!$iId)
681  return false;
682  $iCount = $this->_oQuery->getObjectCommentsCount ($iId);
683  return $this->_oQuery->updateTriggerTable($iId, $iCount);
684  }
685 
686  function _isSpam($s)
687  {
688  return ch_is_spam($s);
689  }
690 
691  function _getAnchor($iId)
692  {
693  $aReplacement = array(
694  ' ' => '-',
695  '_' => '-'
696  );
697 
698  return str_replace(array_keys($aReplacement), array_values($aReplacement), $this->_sSystem . '-' . $this->getId() . '-' . $iId);
699  }
700 }
process_db_input
process_db_input($sText, $iStripTags=0)
Definition: utils.inc.php:256
ChWsbCmts\_prepareTextForOutput
_prepareTextForOutput($s)
Definition: ChWsbCmts.php:670
ChWsbCmts\getOrder
getOrder()
Definition: ChWsbCmts.php:243
WordWrapStr
WordWrapStr($sString, $iWidth=25, $sWrapCharacter='&shy;')
Definition: utils.inc.php:155
ChWsbCmts\isRemoveAllowedAll
isRemoveAllowedAll()
Definition: ChWsbCmts.php:407
ChWsbCmts\_prepareTextForSave
_prepareTextForSave($s)
Definition: ChWsbCmts.php:654
getVisitorIP
getVisitorIP($isProxyCheck=true)
Definition: utils.inc.php:643
ChWsbCmts\onObjectDelete
onObjectDelete($iObjectId=0)
Definition: ChWsbCmts.php:326
ChWsbCmts\$_aSystem
$_aSystem
Definition: ChWsbCmts.php:106
ChWsbCmts\$iGlobAllowHtml
$iGlobAllowHtml
Definition: ChWsbCmts.php:101
ChWsbCmts\getObjectCommentsCount
getObjectCommentsCount($iObjectId=0)
Definition: ChWsbCmts.php:347
true
if(!defined("TRUE_VAL")) define("TRUE_VAL" true
Definition: constants.inc.php:8
ChWsbCmts\$_sSystem
$_sSystem
Definition: ChWsbCmts.php:105
ChWsbCmts\actionCmtRate
actionCmtRate()
Definition: ChWsbCmts.php:599
ChWsbCmts\isEditAllowedAll
isEditAllowedAll()
Definition: ChWsbCmts.php:401
ChWsbCmts\_isSpam
_isSpam($s)
Definition: ChWsbCmts.php:686
$aSystems
$aSystems
Definition: cmts.php:20
CHECK_ACTION_RESULT_ALLOWED
const CHECK_ACTION_RESULT_ALLOWED
Definition: membership_levels.inc.php:60
$sSys
$sSys
Definition: cmts.php:15
CH_TAGS_VALIDATE
const CH_TAGS_VALIDATE
Definition: utils.inc.php:24
ChWsbCmts\isValidSystem
isValidSystem($sSystem)
Definition: ChWsbCmts.php:262
ChWsbCmts\isNl2br
isNl2br()
Definition: ChWsbCmts.php:272
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
CHECK_ACTION_RESULT
const CHECK_ACTION_RESULT
Definition: membership_levels.inc.php:54
ChWsbCmts\msgErrPostReplyAllowed
msgErrPostReplyAllowed()
Definition: ChWsbCmts.php:373
ChWsbCmts\actionFormGet
actionFormGet()
Definition: ChWsbCmts.php:426
ChWsbCmts\$_aCmtElements
$_aCmtElements
Definition: ChWsbCmts.php:107
ChWsbCmts\isRatable
isRatable()
Definition: ChWsbCmts.php:277
CHECK_ACTION_MESSAGE
const CHECK_ACTION_MESSAGE
Definition: membership_levels.inc.php:55
ACTION_ID_COMMENTS_EDIT_OWN
const ACTION_ID_COMMENTS_EDIT_OWN
Definition: membership_levels.inc.php:42
php
ChWsbCmts\checkActionErrorMsg
checkActionErrorMsg($iAction)
Definition: ChWsbCmts.php:221
$oZ
$oZ
Definition: db.php:20
ChWsbCmts\onAuthorDelete
onAuthorDelete($iAuthorId)
Definition: ChWsbCmts.php:333
$iId
$iId
Definition: license.php:15
ChWsbCmts\getId
getId()
Definition: ChWsbCmts.php:228
ChWsbCmts\_getAnchor
_getAnchor($iId)
Definition: ChWsbCmts.php:691
CH_WSB_LINK_CLASS
const CH_WSB_LINK_CLASS
Definition: utils.inc.php:12
ChWsbCmts\isPostReplyAllowed
isPostReplyAllowed($isPerformAction=false)
Definition: ChWsbCmts.php:368
ChWsbCmts\getCommentRow
getCommentRow($iCmtId)
Definition: ChWsbCmts.php:321
ChWsbCmts\maintenance
maintenance()
Definition: ChWsbCmts.php:300
ChWsbCmts\isTagsAllowed
isTagsAllowed()
Definition: ChWsbCmts.php:267
ChWsbCmts\$bDynamic
$bDynamic
Definition: ChWsbCmts.php:103
ChWsbCmts\isRateAllowed
isRateAllowed($isPerformAction=false)
Definition: ChWsbCmts.php:357
isAdmin
isAdmin()
Definition: index.php:649
CH_TAGS_STRIP_AND_NL2BR
const CH_TAGS_STRIP_AND_NL2BR
Definition: utils.inc.php:25
ChWsbCmtsQuery
Definition: ChWsbCmtsQuery.php:14
ChWsbCmts\actionCmtEdit
actionCmtEdit()
Definition: ChWsbCmts.php:539
ACTION_ID_COMMENTS_VOTE
const ACTION_ID_COMMENTS_VOTE
Definition: membership_levels.inc.php:41
ChWsbCmts\msgErrRemoveAllowed
msgErrRemoveAllowed()
Definition: ChWsbCmts.php:395
ChWsbCmts\getPerView
getPerView()
Definition: ChWsbCmts.php:287
ACTION_ID_COMMENTS_POST
const ACTION_ID_COMMENTS_POST
Definition: membership_levels.inc.php:40
ChWsbCmts
Definition: ChWsbCmts.php:99
ChWsbCmts\getCommentsArray
getCommentsArray($iCmtParentId, $sCmtOrder, $iStart=0, $iCount=-1)
Definition: ChWsbCmts.php:316
ChWsbCmts\getObjectInstance
static getObjectInstance($sSys, $iId, $iInit=true)
Definition: ChWsbCmts.php:154
ChWsbAlerts
Definition: ChWsbAlerts.php:39
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
ChWsbCmts\setId
setId($iId)
Definition: ChWsbCmts.php:251
ch_linkify_html
ch_linkify_html($sHtmlOrig, $sAttrs='')
Definition: utils.inc.php:1901
ChWsbCmts\isEnabled
isEnabled()
Definition: ChWsbCmts.php:233
ChWsbCmts\msgErrEditAllowed
msgErrEditAllowed()
Definition: ChWsbCmts.php:384
ChWsbCmts\isRemoveAllowed
isRemoveAllowed($isPerformAction=false)
Definition: ChWsbCmts.php:390
$_REQUEST
$_REQUEST['action']
Definition: cmd.php:11
ChWsbCmts\_getAuthorIp
_getAuthorIp()
Definition: ChWsbCmts.php:642
ChWsbCmts\actionPaginateGet
actionPaginateGet()
Definition: ChWsbCmts.php:415
ChWsbCmts\_triggerComment
_triggerComment()
Definition: ChWsbCmts.php:675
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChWsbCmts\getBaseUrl
getBaseUrl()
Definition: ChWsbCmts.php:257
ChWsbCmts\_getAuthorId
_getAuthorId()
Definition: ChWsbCmts.php:632
ChWsbCmts\actionCmtPost
actionCmtPost()
Definition: ChWsbCmts.php:459
ChWsbCmts\actionCmtRemove
actionCmtRemove()
Definition: ChWsbCmts.php:499
ChWsbCmts\_getAuthorPassword
_getAuthorPassword()
Definition: ChWsbCmts.php:637
ChWsbCmts\$iAutoHideRootPostForm
$iAutoHideRootPostForm
Definition: ChWsbCmts.php:102
CH_TAGS_STRIP
const CH_TAGS_STRIP
Definition: utils.inc.php:22
ChWsbCmts\$_oQuery
$_oQuery
Definition: ChWsbCmts.php:108
ChWsbCmts\getSystems
static & getSystems()
Definition: ChWsbCmts.php:171
ChWsbCmts\actionCmtGet
actionCmtGet()
Definition: ChWsbCmts.php:450
ChWsbCmts\getSystemName
getSystemName()
Definition: ChWsbCmts.php:238
$s
$s
Definition: embed.php:13
ChWsbCmts\actionCmtEditSubmit
actionCmtEditSubmit()
Definition: ChWsbCmts.php:556
ChWsbCmts\getSystemId
getSystemId()
Definition: ChWsbCmts.php:292
ChWsbCmts\__construct
__construct( $sSystem, $iId, $iInit=1)
Definition: ChWsbCmts.php:121
ChWsbCmts\checkAction
checkAction($iAction, $isPerformAction=false)
Definition: ChWsbCmts.php:214
ChWsbCmts\isEditAllowed
isEditAllowed($isPerformAction=false)
Definition: ChWsbCmts.php:379
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
ChWsbCmts\$_sOrder
$_sOrder
Definition: ChWsbCmts.php:109
ChWsbCmts\actionCmtsGet
actionCmtsGet()
Definition: ChWsbCmts.php:437
ChWsbCmts\getCommentsTableName
getCommentsTableName()
Definition: ChWsbCmts.php:342
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChWsbCmts\getAllowedEditTime
getAllowedEditTime()
Definition: ChWsbCmts.php:282
ChWsbCmts\$_iId
$_iId
Definition: ChWsbCmts.php:100
ACTION_ID_COMMENTS_REMOVE_OWN
const ACTION_ID_COMMENTS_REMOVE_OWN
Definition: membership_levels.inc.php:43
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10
ch_is_spam
ch_is_spam($val)
Definition: utils.inc.php:1080
isMember
isMember($iId=0)
Definition: profiles.inc.php:44
ChWsbCmts\_prepareTextForEdit
_prepareTextForEdit($s)
Definition: ChWsbCmts.php:647
ChWsbCmts\$_aMoodText
$_aMoodText
Definition: ChWsbCmts.php:110
ChWsbCmts\msgErrRateAllowed
msgErrRateAllowed()
Definition: ChWsbCmts.php:362
ChWsbCmts\init
init($iId)
Definition: ChWsbCmts.php:202