Cheetah
modules
cheetah
events
classes
ChEventsPageMain.php
Go to the documentation of this file.
1
<?
php
2
8
ch_import
(
'ChWsbTwigPageMain'
);
9
10
class
ChEventsPageMain
extends
ChWsbTwigPageMain
11
{
12
function
__construct
(&$oEventsMain)
13
{
14
parent::__construct(
'ch_events_main'
, $oEventsMain);
15
$this->sSearchResultClassName =
'ChEventsSearchResult'
;
16
$this->sFilterName =
'ch_events_filter'
;
17
}
18
19
function
getBlockCode_UpcomingPhoto
()
20
{
21
$aEvent = $this->oDb->getUpcomingEvent (
getParam
(
'ch_events_main_upcoming_event_from_featured_only'
) ?
true
:
false
);
22
if
(!$aEvent)
23
return
false
;
24
25
$aAuthor =
getProfileInfo
($aEvent[
'ResponsibleID'
]);
26
27
$a = array (
'ID'
=> $aEvent[
'ResponsibleID'
],
'Avatar'
=> $aEvent[
'PrimPhoto'
]);
28
$aImage =
ChWsbService::call
(
'photos'
,
'get_image'
, array($a,
'file'
),
'Search'
);
29
30
ch_events_import
(
'Voting'
);
31
$oRating =
new
ChEventsVoting
(
'ch_events'
, (
int
)$aEvent[
'ID'
]);
32
33
$sEventUrl = CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'view/'
. $aEvent[
'EntryUri'
];
34
35
$aVars
= array (
36
'ch_if:image'
=> array (
37
'condition'
=> !$aImage[
'no_image'
] && $aImage[
'file'
],
38
'content'
=> array (
39
'image_url'
=> !$aImage[
'no_image'
] && $aImage[
'file'
] ? $aImage[
'file'
] :
''
,
40
'image_title'
=> !$aImage[
'no_image'
] && $aImage[
'title'
] ? $aImage[
'title'
] :
''
,
41
'event_url'
=> $sEventUrl,
42
),
43
),
44
'event_url'
=> $sEventUrl,
45
'event_title'
=> $aEvent[
'Title'
],
46
'event_start_in'
=> $this->oMain->_formatDateInBrowse($aEvent),
47
'author_title'
=>
_t
(
'_From'
),
48
'author_username'
=>
getNickName
($aAuthor[
'ID'
]),
49
'author_url'
=>
getProfileLink
($aAuthor[
'ID'
]),
50
51
'rating'
=> $oRating->isEnabled() ? $oRating->getJustVotingElement (
true
, $aEvent[
'ID'
]) :
''
,
52
'participants'
=> $aEvent[
'FansCount'
],
53
'country_city'
=> $this->oMain->_formatLocation($aEvent,
true
,
true
),
54
'place'
=> $aEvent[
'Place'
],
55
);
56
return
$this->oTemplate->parseHtmlByName(
'main_event'
,
$aVars
);
57
}
58
59
function
getBlockCode_UpcomingList
()
60
{
61
return
$this->
ajaxBrowse
(
'upcoming'
, $this->oDb->getParam(
'ch_events_perpage_main_upcoming'
));
62
}
63
64
function
getBlockCode_PastList
()
65
{
66
return
$this->
ajaxBrowse
(
'past'
, $this->oDb->getParam(
'ch_events_perpage_main_past'
));
67
}
68
69
function
getBlockCode_RecentlyAddedList
()
70
{
71
return
$this->
ajaxBrowse
(
'recent'
, $this->oDb->getParam(
'ch_events_perpage_main_recent'
));
72
}
73
}
ChEventsPageMain\getBlockCode_UpcomingList
getBlockCode_UpcomingList()
Definition:
ChEventsPageMain.php:59
ChEventsVoting
Definition:
ChEventsVoting.php:11
ch_import
ch_import($sClassName, $aModule=array())
Definition:
utils.inc.php:1218
php
ChWsbTwigPageMain
Definition:
ChWsbTwigPageMain.php:14
ChEventsPageMain\getBlockCode_UpcomingPhoto
getBlockCode_UpcomingPhoto()
Definition:
ChEventsPageMain.php:19
getParam
getParam($sParamName, $bUseCache=true)
Definition:
db.inc.php:130
ChEventsPageMain\__construct
__construct(&$oEventsMain)
Definition:
ChEventsPageMain.php:12
getNickName
getNickName( $ID='')
Definition:
profiles.inc.php:461
ChWsbTwigPageMain\ajaxBrowse
ajaxBrowse($sMode, $iPerPage, $aMenu=array(), $sValue='', $isDisableRss=false, $isPublicOnly=true)
Definition:
ChWsbTwigPageMain.php:34
ChEventsPageMain\getBlockCode_PastList
getBlockCode_PastList()
Definition:
ChEventsPageMain.php:64
ch_events_import
ch_events_import($sClassPostfix, $aModuleOverwright=array())
Definition:
ChEventsModule.php:8
ChEventsPageMain\getBlockCode_RecentlyAddedList
getBlockCode_RecentlyAddedList()
Definition:
ChEventsPageMain.php:69
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition:
languages.inc.php:509
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition:
profiles.inc.php:484
$aVars
$aVars
Definition:
license.php:101
ChEventsPageMain
Definition:
ChEventsPageMain.php:11
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition:
profiles.inc.php:249
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition:
ChWsbService.php:32
Generated by
1.8.20