20 parent::__construct($oConfig);
22 $this->_sTableMain =
'main';
23 $this->_sTableShoutbox =
'shoutbox';
24 $this->_sTableMediaPrefix =
'';
25 $this->_sFieldId =
'ID';
26 $this->_sFieldAuthorId =
'ResponsibleID';
27 $this->_sFieldUri =
'EntryUri';
28 $this->_sFieldTitle =
'Title';
29 $this->_sFieldDescription =
'Description';
30 $this->_sFieldTags =
'Tags';
31 $this->_sFieldThumb =
'PrimPhoto';
32 $this->_sFieldStatus =
'Status';
33 $this->_sFieldFeatured =
'Featured';
34 $this->_sFieldCreated =
'Date';
35 $this->_sFieldJoinConfirmation =
'JoinConfirmation';
36 $this->_sFieldFansCount =
'FansCount';
37 $this->_sTableFans =
'participants';
38 $this->_sTableAdmins =
'admins';
39 $this->_sFieldAllowViewTo =
'allow_view_event_to';
40 $this->_sFieldCommentCount =
'CommentsCount';
47 $sWhere =
" AND `{$this->_sFieldFeatured}` = '1' ";
48 return $this->
getRow(
"SELECT * FROM `" . $this->_sPrefix .
"main`
49 WHERE `EventEnd` > ? AND `Status` = ? AND `{$this->_sFieldAllowViewTo}` = ? $sWhere ORDER BY `Featured` DESC, `EventStart` ASC LIMIT 1", [
time(),
'approved',
CH_WSB_PG_ALL]);
55 $iDays = cal_days_in_month(CAL_GREGORIAN, $iMonth, $iYear);
56 for ($iDay=1 ; $iDay <= $iDays ; ++$iDay) {
57 $a = $this->
getAll (
"SELECT *, $iDay AS `Day`
58 FROM `" . $this->_sPrefix .
"main`
59 WHERE ((`EventEnd` >= UNIX_TIMESTAMP('$iYear-$iMonth-$iDay 00:00:00')) AND (`EventStart` <= UNIX_TIMESTAMP('$iYear-$iMonth-$iDay 23:59:59')))
60 AND `Status` = 'approved'");
62 $aEvents = array_merge($aEvents, $a);
69 if ($iRet = parent::deleteEntryByIdAndOwner (
$iId, $iOwner, $isAdmin)) {
70 $this->
query (
"DELETE FROM `" . $this->_sPrefix .
"participants` WHERE `id_entry` = $iId");