Cheetah
ChWallDb.php
Go to the documentation of this file.
1 <?php
2 
8 require_once( CH_DIRECTORY_PATH_CLASSES . 'ChWsbModuleDb.php' );
9 
10 class ChWallDb extends ChWsbModuleDb
11 {
12  var $_oConfig;
13  /*
14  * Constructor.
15  */
16  function __construct(&$oConfig)
17  {
18  parent::__construct();
19 
20  $this->_oConfig = $oConfig;
21  $this->_sPrefix = $oConfig->getDbPrefix();
22  }
23  function insertData($aData)
24  {
25  foreach($aData['handlers'] as $aHandler) {
26  //--- Delete module related events ---//
27  $this->deleteEvent(array('type' => $aHandler['alert_unit'], 'action' => $aHandler['alert_action']));
28 
29  //--- Update Wall Handlers ---//
30  $this->query("INSERT INTO `" . $this->_sPrefix . "handlers`(`alert_unit`, `alert_action`, `module_uri`, `module_class`, `module_method`, `groupable`, `group_by`, `timeline`, `outline`) VALUES('" . $aHandler['alert_unit'] . "', '" . $aHandler['alert_action'] . "', '" . $aHandler['module_uri'] . "', '" . $aHandler['module_class'] . "', '" . $aHandler['module_method'] . "', '" . $aHandler['groupable'] . "', '" . $aHandler['group_by'] . "', '" . $aHandler['timeline'] . "', '" . $aHandler['outline'] . "')");
31  }
32 
33  //--- Update System Alerts ---//
34  $iHandlerId = (int)$this->getOne("SELECT `id` FROM `sys_alerts_handlers` WHERE `name`='" . $this->_oConfig->getAlertSystemName() . "' LIMIT 1");
35 
36  foreach($aData['alerts'] as $aAlert)
37  $this->query("INSERT INTO `sys_alerts`(`unit`, `action`, `handler_id`) VALUES('" . $aAlert['unit'] . "', '" . $aAlert['action'] . "', '" . $iHandlerId . "')");
38  }
39  function deleteData($aData)
40  {
41  foreach($aData['handlers'] as $aHandler) {
42  //--- Delete module related events ---//
43  $this->deleteEvent(array('type' => $aHandler['alert_unit'], 'action' => $aHandler['alert_action']));
44 
45  //--- Update Wall Handlers ---//
46  $this->query("DELETE FROM `" . $this->_sPrefix . "handlers` WHERE `alert_unit`='" . $aHandler['alert_unit'] . "' AND `alert_action`='" . $aHandler['alert_action'] . "' AND `module_uri`='" . $aHandler['module_uri'] . "' AND `module_class`='" . $aHandler['module_class'] . "' AND `module_method`='" . $aHandler['module_method'] . "' LIMIT 1");
47  }
48 
49  //--- Update System Alerts ---//
50  $iHandlerId = (int)$this->getOne("SELECT `id` FROM `sys_alerts_handlers` WHERE `name`='" . $this->_oConfig->getAlertSystemName() . "' LIMIT 1");
51 
52  foreach($aData['alerts'] as $aAlert)
53  $this->query("DELETE FROM `sys_alerts` WHERE `unit`='" . $aAlert['unit'] . "' AND `action`='" . $aAlert['action'] . "' AND `handler_id`='" . $iHandlerId . "' LIMIT 1");
54  }
55  function insertEvent($aParams)
56  {
57  $aSet = array();
58  foreach($aParams as $sKey => $sValue)
59  $aSet[] = "`" . $sKey . "`='" . $sValue . "'";
60  if(!array_key_exists('date', $aParams))
61  $aSet[] = "`date`=UNIX_TIMESTAMP()";
62 
63  if((int)$this->query("INSERT INTO `" . $this->_sPrefix . "events` SET " . implode(", ", $aSet)) <= 0)
64  return 0;
65 
66  $iId = (int)$this->lastId();
67  if($iId > 0 && isset($aParams['owner_id']) && (int)$aParams['owner_id'] > 0) {
68  //--- Wall -> Update for Alerts Engine ---//
69  ch_import('ChWsbAlerts');
70  $oAlert = new ChWsbAlerts('ch_' . $this->_oConfig->getUri(), 'update', $aParams['owner_id']);
71  $oAlert->alert();
72  //--- Wall -> Update for Alerts Engine ---//
73  }
74 
75  return $iId;
76  }
77  function updateEvent($aParams, $iId)
78  {
79  $aUpdate = array();
80  foreach($aParams as $sKey => $sValue)
81  $aUpdate[] = "`" . $sKey . "`='" . $sValue . "'";
82  $sSql = "UPDATE `" . $this->_sPrefix . "events` SET " . implode(", ", $aUpdate) . " WHERE `id`='" . $iId . "'";
83  return $this->query($sSql);
84  }
85  function deleteEvent($aParams, $sWhereAddon = "")
86  {
87  $aWhere = array();
88  foreach($aParams as $sKey => $sValue)
89  $aWhere[] = "`" . $sKey . "`='" . $sValue . "'";
90  $sSql = "DELETE FROM `" . $this->_sPrefix . "events` WHERE " . implode(" AND ", $aWhere) . $sWhereAddon;
91  return $this->query($sSql);
92  }
93  function deleteEventCommon($aParams)
94  {
95  return $this->deleteEvent($aParams, " AND `type` LIKE '" . $this->_oConfig->getCommonPostPrefix() . "%'");
96  }
97  function getUser($mixed, $sType = 'id')
98  {
99  $aBindings = [];
100  switch($sType) {
101  case 'id':
102  $sWhereClause = "`ID`= ?";
103  $aBindings = [$mixed];
104  break;
105  case 'username':
106  $sWhereClause = "`NickName`= ?";
107  $aBindings = [$mixed];
108  break;
109  }
110 
111  $sSql = "SELECT `ID` AS `id`, `Couple` AS `couple`, `NickName` AS `username`, `Password` AS `password`, `Email` AS `email`, `Sex` AS `sex`, `Status` AS `status` FROM `Profiles` WHERE " . $sWhereClause . " LIMIT 1";
112  $aUser = $this->getRow($sSql, $aBindings);
113 
114  if(empty($aUser))
115  $aUser = array('id' => 0, 'couple' => 0, 'username' => _t('_wall_anonymous'), 'password' => '', 'email' => '', 'sex' => 'male');
116 
117  return $aUser;
118  }
119 
120  //--- View Events Functions ---//
121  function getHandlers($aParams = array())
122  {
123  $sMethod = 'getAll';
124  $sWhereClause = '';
125 
126  switch($aParams['type']) {
127  case 'timeline':
128  $sWhereClause = "AND `timeline`='1'";
129  break;
130  case 'outline':
131  $sWhereClause = "AND `outline`='1'";
132  break;
133  case 'by_uri':
134  $sWhereClause = "AND `module_uri`='" . $aParams['value'] . "'";
135  break;
136  }
137 
138  $sSql = "SELECT
139  `id` AS `id`,
140  `alert_unit` AS `alert_unit`,
141  `alert_action` AS `alert_action`,
142  `module_uri` AS `module_uri`,
143  `module_class` AS `module_class`,
144  `module_method` AS `module_method`,
145  `groupable` AS `groupable`,
146  `group_by` AS `group_by`,
147  `timeline` AS `timeline`,
148  `outline` AS `outline`
149  FROM `" . $this->_sPrefix . "handlers`
150  WHERE 1 AND `alert_unit` NOT LIKE ('wall_common_%') " . $sWhereClause;
151  return $this->$sMethod($sSql);
152  }
153 
154  function getEvents($aParams)
155  {
156  $sMethod = "getAll";
157  $sJoinClause = $sWhereClause = $sOrderClause = $sLimitClause = "";
158 
159  $sWhereClause .= "AND `te`.`active`='1' AND `te`.`hidden`<>'1' ";
160 
161  $sWhereModuleFilter = '';
162  if(isset($aParams['modules']) && !empty($aParams['modules']) && is_array($aParams['modules']))
163  $sWhereModuleFilter = "AND `type` IN ('" . implode("','", $aParams['modules']) . "') ";
164 
165  if(isset($aParams['timeline']) && strpos($aParams['timeline'], CH_WALL_DIVIDER_TIMELINE) !== false) {
166  list($iTLStart, $iTLEnd) = explode(CH_WALL_DIVIDER_TIMELINE, $aParams['timeline']);
167 
168  $iNowMorning = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
169  $iNowEvening = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
170  $sWhereClause .= "AND `date`>='" . ($iNowMorning - 86400 * $iTLEnd) . "' AND `date`<='" . ($iNowEvening - 86400 * $iTLStart) . "' ";
171  }
172 
173  switch($aParams['browse']) {
174  case 'id':
175  $sMethod = 'getRow';
176  $sWhereClause = "AND `te`.`id`='" . $aParams['object_id'] . "' ";
177  $sLimitClause = "LIMIT 1";
178  break;
179 
180  case 'owner':
181  if($sWhereModuleFilter == '') {
182  $aHidden = $this->_oConfig->getHandlersHidden(CH_WALL_VIEW_TIMELINE);
183  $sWhereModuleFilter = "AND `th`.`timeline`='1' AND `th`.`id` NOT IN ('" . implode("','", $aHidden) . "') ";
184  }
185 
186  if(!empty($aParams['owner_id'])) {
187  if(is_array($aParams['owner_id'])) {
188  $sIds = implode("','", $aParams['owner_id']);
189 
190  $sWhereClause .= "AND (`te`.`owner_id` IN ('" . $sIds . "') OR (`te`.`owner_id`='0' AND `te`.`object_id` IN ('" . $sIds . "'))) ";
191  }
192  else
193  $sWhereClause .= "AND (`te`.`owner_id`='" . $aParams['owner_id'] . "' OR (`te`.`owner_id`='0' AND `te`.`object_id`='" . $aParams['owner_id'] . "')) ";
194  }
195  else
196  $sWhereClause .= "AND NOT(`te`.`owner_id`<>'0' AND `te`.`type` LIKE '" . $this->_oConfig->getCommonPostPrefix() . "%' AND `te`.`action`='') ";
197 
198  $sWhereClause .= isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '';
199  $sWhereClause .= $sWhereModuleFilter;
200  $sOrderClause = isset($aParams['order']) ? "ORDER BY `te`.`date` " . strtoupper($aParams['order']) : "";
201  $sLimitClause = isset($aParams['count']) ? "LIMIT " . $aParams['start'] . ", " . $aParams['count'] : "";
202  break;
203 
204  case 'last':
205  $sMethod = 'getRow';
206 
207  if($sWhereModuleFilter == '') {
208  $aHidden = $this->_oConfig->getHandlersHidden(CH_WALL_VIEW_TIMELINE);
209  $sWhereModuleFilter = "AND `th`.`timeline`='1' AND `th`.`id` NOT IN ('" . implode("','", $aHidden) . "') ";
210  }
211 
212  if(!empty($aParams['owner_id'])) {
213  if(is_array($aParams['owner_id'])) {
214  $sIds = implode("','", $aParams['owner_id']);
215 
216  $sWhereClause .= "AND (`te`.`owner_id` IN ('" . $sIds . "') OR (`te`.`owner_id`='0' AND `te`.`object_id` IN ('" . $sIds . "'))) ";
217  }
218  else
219  $sWhereClause .= "AND (`te`.`owner_id`='" . $aParams['owner_id'] . "' OR (`te`.`owner_id`='0' AND `te`.`object_id`='" . $aParams['owner_id'] . "')) ";
220  }
221  else
222  $sWhereClause .= "AND NOT(`te`.`owner_id`<>'0' AND `te`.`type` LIKE '" . $this->_oConfig->getCommonPostPrefix() . "%' AND `te`.`action`='') ";
223 
224  $sWhereClause .= isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '';
225  $sWhereClause .= $sWhereModuleFilter;
226  $sOrderClause = "ORDER BY `te`.`date` ASC";
227  $sLimitClause = "LIMIT 1";
228  break;
229 
230  case 'descriptor':
231  $sMethod = 'getRow';
232  $sWhereClause = "";
233 
234  if(isset($aParams['type']))
235  $sWhereClause .= "AND `te`.`type`='" . $aParams['type'] . "' ";
236  if(isset($aParams['action']))
237  $sWhereClause .= "AND `te`.`action`='" . $aParams['action'] . "' ";
238  if(isset($aParams['object_id']))
239  $sWhereClause .= "AND `te`.`object_id`='" . $aParams['object_id'] . "' ";
240 
241  $sLimitClause = "LIMIT 1";
242  break;
243 
244  case 'reposted_by_descriptor':
245  $sWhereClause = "";
246 
247  if(isset($aParams['type']))
248  $sWhereClause .= "AND `te`.`content` LIKE '%" . $this->escape($aParams['type'], false) . "%'";
249 
250  if(isset($aParams['action']))
251  $sWhereClause .= "AND `te`.`content` LIKE '%" . $this->escape($aParams['action'], false) . "%'";
252  break;
253 
255  if($sWhereModuleFilter == '') {
256  $aHidden = $this->_oConfig->getHandlersHidden(CH_WALL_VIEW_OUTLINE);
257  $sWhereModuleFilter = "AND `th`.`outline`='1' AND `th`.`id` NOT IN ('" . implode("','", $aHidden) . "') ";
258  }
259 
260  $sJoinClause = "LEFT JOIN `Profiles` AS `tp` ON `te`.`owner_id`=`tp`.`ID`";
261  $sWhereClause .= "AND `tp`.`Status`='Active' ";
262  $sWhereClause .= isset($aParams['filter']) ? $this->_getFilterAddon($aParams['owner_id'], $aParams['filter']) : '';
263  $sWhereClause .= $sWhereModuleFilter;
264  $sOrderClause = isset($aParams['order']) ? "ORDER BY `te`.`date` " . strtoupper($aParams['order']) : "";
265  $sLimitClause = isset($aParams['count']) ? "LIMIT " . $aParams['start'] . ", " . $aParams['count'] : "";
266  break;
267  }
268 
269  $sSql = "SELECT
270  `te`.`id` AS `id`,
271  `te`.`owner_id` AS `owner_id`,
272  `te`.`object_id` AS `object_id`,
273  `te`.`type` AS `type`,
274  `te`.`action` AS `action`,
275  `te`.`content` AS `content`,
276  `te`.`title` AS `title`,
277  `te`.`description` AS `description`,
278  `te`.`reposts` AS `reposts`,
279  `te`.`date` AS `date`,
280  `te`.`active` AS `active`,
281  `te`.`hidden` AS `hidden`,
282  DATE_FORMAT(FROM_UNIXTIME(`te`.`date`), '" . $this->_oConfig->getDividerDateFormat() . "') AS `print_date`,
283  DAYOFYEAR(FROM_UNIXTIME(`te`.`date`)) AS `days`,
284  DAYOFYEAR(NOW()) AS `today`,
285  (UNIX_TIMESTAMP() - `te`.`date`) AS `ago`,
286  ROUND((UNIX_TIMESTAMP() - `te`.`date`)/86400) AS `ago_days`
287  FROM `" . $this->_sPrefix . "events` AS `te`
288  LEFT JOIN `" . $this->_sPrefix . "handlers` AS `th` ON `te`.`type`=`th`.`alert_unit` AND `te`.`action`=`th`.`alert_action` " . $sJoinClause . "
289  WHERE 1 " . $sWhereClause . " " . $sOrderClause . " " . $sLimitClause;
290 
291  $aEvents = $this->$sMethod($sSql);
292  if(empty($aEvents) || !is_array($aEvents))
293  return array();
294 
295  if($sMethod == 'getRow')
296  $this->_processEvent($aEvents);
297  else
298  foreach($aEvents as $iKey => $aEvent)
299  $this->_processEvent($aEvents[$iKey]);
300 
301  return $aEvents;
302  }
303 
304  function getEventsCount($iOwnerId, $sFilter, $sTimeline, $aModules)
305  {
306  $sWhereClause = "";
307  if(!empty($iOwnerId)) {
308  if(!is_array($iOwnerId))
309  $sWhereClause = "`owner_id`='" . $iOwnerId . "' ";
310  else
311  $sWhereClause = "`owner_id` IN ('" . implode("','", $iOwnerId) . "') ";
312  }
313 
314  if(!empty($sTimeline) && strpos($sTimeline, CH_WALL_DIVIDER_TIMELINE) !== false) {
315  list($iTLStart, $iTLEnd) = explode(CH_WALL_DIVIDER_TIMELINE, $sTimeline);
316 
317  $iNowMorning = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
318  $iNowEvening = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
319  $sWhereClause .= "AND `date`>='" . ($iNowMorning - 86400 * $iTLEnd) . "' AND `date`<='" . ($iNowEvening - 86400 * $iTLStart) . "' ";
320  }
321 
322  if(!empty($aModules) && is_array($aModules))
323  $sWhereClause .= "AND `type` IN ('" . implode("','", $aModules) . "') ";
324 
325  $sWhereClause .= $this->_getFilterAddon($iOwnerId, $sFilter);
326 
327  $sSql = "SELECT COUNT(*) FROM `" . $this->_sPrefix . "events` WHERE " . $sWhereClause . " LIMIT 1";
328  return $this->getOne($sSql);
329  }
330 
331  function updateSimilarObject($iId, &$oAlert, $sDuration = 'day')
332  {
333  $sType = $oAlert->sUnit;
334  $sAction = $oAlert->sAction;
335 
336  //Check handler
337  $aHandler = $this->_oConfig->getHandlers($sType . '_' . $sAction);
338  if(empty($aHandler) || !is_array($aHandler) || (int)$aHandler['groupable'] != 1)
339  return false;
340 
341  //Check content's extra values
342  if(isset($aHandler['group_by']) && !empty($aHandler['group_by']) && (!isset($oAlert->aExtras[$aHandler['group_by']]) || empty($oAlert->aExtras[$aHandler['group_by']])))
343  return false;
344 
345  $sWhereClause = "";
346  switch($sDuration) {
347  case 'day':
348  $iDayStart = mktime(0, 0, 0, date('m'), date('d'), date('Y'));
349  $iDayEnd = mktime(23, 59, 59, date('m'), date('d'), date('Y'));
350  $sWhereClause .= "AND `date`>" . $iDayStart . " AND `date`<" . $iDayEnd . " ";
351  break;
352  }
353 
354  if(isset($aHandler['group_by']))
355  $sWhereClause .= "AND `content` LIKE '%" . $oAlert->aExtras[$aHandler['group_by']] . "%' ";
356 
357  $sSql = "UPDATE `" . $this->_sPrefix . "events`
358  SET
359  `object_id`=CONCAT(`object_id`, '" . CH_WALL_DIVIDER_OBJECT_ID . $oAlert->iObject . "'),
360  `title`='',
361  `description`='',
362  `date`=UNIX_TIMESTAMP()
363  WHERE
364  `id`<>'" . $iId . "' AND
365  `owner_id`='" . $oAlert->iSender . "' AND
366  `type`='" . $sType . "' AND
367  `action`='" . $sAction . "' " . $sWhereClause;
368  $mixedResult = $this->query($sSql);
369 
370  if((int)$mixedResult > 0)
371  $this->deleteEvent(array('id' => $iId));
372 
373  return $mixedResult;
374  }
375 
376  //--- Comment Functions ---//
378  {
379  $sSql = "SELECT COUNT(`cmt_id`) FROM `" . $this->_sPrefix . "comments` WHERE `cmt_object_id`='" . $iId . "' AND `cmt_parent_id`='0' LIMIT 1";
380  return (int)$this->getOne($sSql);
381  }
382 
383  //--- Shared Media Functions ---//
385  {
386  $aType2Db = array(
387  'sharedPhoto' => array('table' =>'ch_shared_photo_files', 'id' => 'medID'),
388  'sharedSound' => array('table' => 'RayMp3Files', 'id' => 'ID'),
389  'sharedVideo' => array('table' => 'RayVideoFiles', 'id' => 'ID')
390  );
391 
392  $sSql = "SELECT `Categories` FROM `" . $aType2Db[$sType]['table'] . "` WHERE `" . $aType2Db[$sType]['id'] . "`='" . $iId . "' LIMIT 1";
393  return $this->getOne($sSql);
394  }
395 
399  function insertRepostTrack($iEventId, $iAuthorId, $sAuthorIp, $iRepostedId)
400  {
401  $iNow = time();
402  $iAuthorNip = ip2long($sAuthorIp);
403  return (int)$this->query("INSERT INTO `" . $this->_sPrefix . "repost_track` SET `event_id`='" . $iEventId . "', `author_id`='" . $iAuthorId . "', `author_nip`='" . $iAuthorNip . "', `reposted_id`='" . $iRepostedId . "', `date`='" . $iNow . "'") > 0;
404  }
405 
406  function deleteRepostTrack($iEventId)
407  {
408  return (int)$this->query("DELETE FROM `" . $this->_sPrefix . "repost_track` WHERE `event_id`='" . $iEventId . "'") > 0;
409  }
410 
411  function updateRepostCounter($iId, $iCounter, $iIncrement = 1)
412  {
413  $iReposts = (int)$iCounter + $iIncrement;
414  if($iReposts < 0)
415  $iReposts = 0;
416 
417  return (int)$this->updateEvent(array('reposts' => $iReposts), $iId) > 0;
418  }
419 
420  function getReposted($sType, $sAction, $iObjectId)
421  {
422  $bSystem = $this->_oConfig->isSystem($sType, $sAction);
423  if($bSystem)
424  $aParams = array('browse' => 'descriptor', 'type' => $sType, 'action' => $sAction, 'object_id' => $iObjectId);
425  else
426  $aParams = array('browse' => 'id', 'object_id' => $iObjectId);
427 
428  $aReposted = $this->getEvents($aParams);
429  if($bSystem && (empty($aReposted) || !is_array($aReposted))) {
430  $iOwnerId = 0;
431  $iDate = 0;
432  $iHidden = 1;
433 
434  $mixedResult = $this->_oConfig->getSystemDataByDescriptor($sType, $sAction, $iObjectId);
435  if(is_array($mixedResult)) {
436  $iOwnerId = !empty($mixedResult['owner_id']) ? (int)$mixedResult['owner_id'] : 0;
437  $iDate = !empty($mixedResult['date']) ? (int)$mixedResult['date'] : 0;
438  if(!empty($iOwnerId) && !empty($iDate))
439  $iHidden = 0;
440  }
441 
442  $iId = $this->insertEvent(array(
443  'owner_id' => $iOwnerId,
444  'type' => $sType,
445  'action' => $sAction,
446  'object_id' => $iObjectId,
447  'content' => '',
448  'title' => '',
449  'description' => '',
450  'date' => $iDate,
451  'hidden' => $iHidden
452  ));
453 
454  $aReposted = $this->getEvents(array('browse' => 'id', 'object_id' => $iId));
455  }
456 
457  return $aReposted;
458  }
459 
460  function getRepostedBy($iRepostedId)
461  {
462  return $this->getColumn("SELECT `author_id` FROM `" . $this->_sPrefix . "repost_track` WHERE `reposted_id`='" . $iRepostedId . "'");
463  }
464 
465  function isReposted($iRepostedId, $iOwnerId, $iAuthorId)
466  {
467  $sQuery = "SELECT
468  `te`.`id`
469  FROM `" . $this->_sPrefix . "repost_track` AS `trt`
470  LEFT JOIN `" . $this->_sPrefix . "events` AS `te` ON `trt`.`event_id`=`te`.`id`
471  WHERE `trt`.`author_id`='" . $iAuthorId . "' AND `trt`.`reposted_id`='" . $iRepostedId . "' AND `te`.`owner_id`='" . $iOwnerId . "'";
472 
473  return (int)$this->getOne($sQuery) > 0;
474  }
475 
476  //--- Private functions ---//
477  function _getFilterAddon($iOwnerId, $sFilter)
478  {
479  switch($sFilter) {
481  $sFilterAddon = " AND `te`.`action`='' AND `te`.`object_id`='" . $iOwnerId . "' ";
482  break;
484  $sFilterAddon = " AND `te`.`action`='' AND `te`.`object_id`<>'" . $iOwnerId . "' ";
485  break;
486  case CH_WALL_FILTER_ALL:
487  default:
488  $sFilterAddon = "";
489  }
490  return $sFilterAddon;
491  }
492  function _processEvent(&$aEvent)
493  {
495 
496  $aEvent['content'] = str_replace("[ray_url]", $sHomeUrl, $aEvent['content']);
497  $aEvent['ago'] = defineTimeInterval($aEvent['date']);
498  }
499 }
ChWallDb\updateEvent
updateEvent($aParams, $iId)
Definition: ChWallDb.php:77
ChWallDb\insertData
insertData($aData)
Definition: ChWallDb.php:23
ChWallDb\deleteData
deleteData($aData)
Definition: ChWallDb.php:39
defineTimeInterval
defineTimeInterval($iTime, $bAutoDateConvert=true, $bShort=false)
Definition: utils.inc.php:831
CH_WALL_FILTER_ALL
const CH_WALL_FILTER_ALL
Definition: ChWallModule.php:19
CH_WALL_DIVIDER_OBJECT_ID
const CH_WALL_DIVIDER_OBJECT_ID
Definition: ChWallModule.php:36
CH_WALL_FILTER_OWNER
const CH_WALL_FILTER_OWNER
Definition: ChWallModule.php:20
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChWallDb\insertEvent
insertEvent($aParams)
Definition: ChWallDb.php:55
$oAlert
$oAlert
Definition: embed.php:15
$sHomeUrl
$sHomeUrl
Definition: header.inc.php:41
ChWallDb\getUser
getUser($mixed, $sType='id')
Definition: ChWallDb.php:97
php
ChWsbModuleDb
Definition: ChWsbModuleDb.php:12
$iId
$iId
Definition: license.php:15
CH_WALL_VIEW_OUTLINE
const CH_WALL_VIEW_OUTLINE
Definition: ChWallModule.php:24
ChWallDb\deleteRepostTrack
deleteRepostTrack($iEventId)
Definition: ChWallDb.php:406
ChWallDb\getEvents
getEvents($aParams)
Definition: ChWallDb.php:154
CH_WALL_VIEW_TIMELINE
const CH_WALL_VIEW_TIMELINE
Definition: ChWallModule.php:23
ChWsbAlerts
Definition: ChWsbAlerts.php:39
ChWsbDb\getRow
getRow($sQuery, $aBindings=[], $iFetchStyle=PDO::FETCH_ASSOC)
Definition: ChWsbDb.php:225
$sType
$sType
Definition: actions.inc.php:11
ChWallDb\insertRepostTrack
insertRepostTrack($iEventId, $iAuthorId, $sAuthorIp, $iRepostedId)
Definition: ChWallDb.php:399
ChWsbDb\query
query($sQuery, $aBindings=[])
Definition: ChWsbDb.php:386
ChWallDb\updateRepostCounter
updateRepostCounter($iId, $iCounter, $iIncrement=1)
Definition: ChWallDb.php:411
ChWallDb\_getFilterAddon
_getFilterAddon($iOwnerId, $sFilter)
Definition: ChWallDb.php:477
ChWallDb\_processEvent
_processEvent(&$aEvent)
Definition: ChWallDb.php:492
ChWallDb\$_oConfig
$_oConfig
Definition: ChWallDb.php:12
ChWallDb\deleteEvent
deleteEvent($aParams, $sWhereAddon="")
Definition: ChWallDb.php:85
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
ChWallDb\__construct
__construct(&$oConfig)
Definition: ChWallDb.php:16
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChWallDb\getCommentsCount
getCommentsCount($iId)
Definition: ChWallDb.php:377
time
that in the case of a Adaptation or at a minimum such credit will if a credit for all contributing authors of the Adaptation or Collection then as part of these credits and in a manner at least as prominent as the credits for the other contributing authors For the avoidance of You may only use the credit required by this Section for the purpose of attribution in the manner set out above by exercising Your rights under this You may not implicitly or explicitly assert or imply any connection sponsorship or endorsement by the Original Licensor and or Attribution as of You or Your use of the without the express prior written permission of the Original Licensor and or Attribution Parties Except as otherwise agreed in writing by the Licensor or as may be otherwise permitted by applicable if You Distribute or Publicly Perform the Work either by itself or as part of any Adaptations or You must not modify or take other derogatory action in relation to the Work which would be prejudicial to the Original Author s honor or reputation Licensor agrees that in those in which any exercise of the right granted in modification or other derogatory action prejudicial to the Original Author s honor and the Licensor will waive or not as this to the fullest extent permitted by the applicable national to enable You to reasonably exercise Your right under Warranties and Disclaimer UNLESS OTHERWISE MUTUALLY AGREED TO BY THE PARTIES IN LICENSOR OFFERS THE WORK AS IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND CONCERNING THE STATUTORY OR WITHOUT WARRANTIES OF FITNESS FOR A PARTICULAR OR THE ABSENCE OF LATENT OR OTHER OR THE PRESENCE OF ABSENCE OF WHETHER OR NOT DISCOVERABLE SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF IMPLIED SO SUCH EXCLUSION MAY NOT APPLY TO YOU Limitation on Liability EXCEPT TO THE EXTENT REQUIRED BY APPLICABLE IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY LEGAL THEORY FOR ANY PUNITIVE OR EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Termination This License and the rights granted hereunder will terminate automatically upon any breach by You of the terms of this License Individuals or entities who have received Adaptations or Collections from You under this will not have their licenses terminated provided such individuals or entities remain in full compliance with those licenses and will survive any termination of this License Subject to the above terms and the license granted here is Licensor reserves the right to release the Work under different license terms or to stop distributing the Work at any time
Definition: license.txt:56
$iDate
$iDate
Definition: cron.php:130
ChWallDb
Definition: ChWallDb.php:11
ChWsbDb\getOne
getOne($sQuery, $aBindings=[], $iIndex=0)
Definition: ChWsbDb.php:263
ChWallDb\getRepostedBy
getRepostedBy($iRepostedId)
Definition: ChWallDb.php:460
CH_WALL_DIVIDER_TIMELINE
const CH_WALL_DIVIDER_TIMELINE
Definition: ChWallModule.php:37
ChWallDb\isReposted
isReposted($iRepostedId, $iOwnerId, $iAuthorId)
Definition: ChWallDb.php:465
$aModules
$aModules
Definition: constants.inc.php:29
$aUser
$aUser
Definition: profiles.inc.php:74
CH_WALL_FILTER_OTHER
const CH_WALL_FILTER_OTHER
Definition: ChWallModule.php:21
$sAction
$sAction
Definition: categories.php:274
ChWsbDb\lastId
lastId()
Definition: ChWsbDb.php:449
empty
Attr AllowedRel this is empty
Definition: Attr.AllowedRel.txt:7
ChWallDb\getSharedCategory
getSharedCategory($sType, $iId)
Definition: ChWallDb.php:384
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
ChWallDb\updateSimilarObject
updateSimilarObject($iId, &$oAlert, $sDuration='day')
Definition: ChWallDb.php:331
ChWallDb\getEventsCount
getEventsCount($iOwnerId, $sFilter, $sTimeline, $aModules)
Definition: ChWallDb.php:304
ChWsbDb\escape
escape($sText, $bReal=true)
Definition: ChWsbDb.php:624
ChWallDb\getReposted
getReposted($sType, $sAction, $iObjectId)
Definition: ChWallDb.php:420
ChWallDb\getHandlers
getHandlers($aParams=array())
Definition: ChWallDb.php:121
ChWsbDb\getColumn
getColumn($sQuery, $aBindings=[])
Definition: ChWsbDb.php:243
ChWallDb\deleteEventCommon
deleteEventCommon($aParams)
Definition: ChWallDb.php:93