Cheetah
modules
cheetah
groups
classes
ChGroupsPageMain.php
Go to the documentation of this file.
1
<?
php
2
8
ch_import
(
'ChWsbTwigPageMain'
);
9
10
class
ChGroupsPageMain
extends
ChWsbTwigPageMain
11
{
12
function
__construct
(&
$oMain
)
13
{
14
$this->sSearchResultClassName =
'ChGroupsSearchResult'
;
15
$this->sFilterName =
'ch_groups_filter'
;
16
parent::__construct(
'ch_groups_main'
,
$oMain
);
17
}
18
19
function
getBlockCode_LatestFeaturedGroup
()
20
{
21
$aDataEntry = $this->oDb->getLatestFeaturedItem ();
22
if
(!$aDataEntry)
23
return
false
;
24
25
$aAuthor =
getProfileInfo
($aDataEntry[
'author_id'
]);
26
27
$sImageUrl =
''
;
28
$sImageTitle =
''
;
29
$a = array (
'ID'
=> $aDataEntry[
'author_id'
],
'Avatar'
=> $aDataEntry[
'thumb'
]);
30
$aImage =
ChWsbService::call
(
'photos'
,
'get_image'
, array($a,
'file'
),
'Search'
);
31
32
ch_groups_import
(
'Voting'
);
33
$oRating =
new
ChGroupsVoting
(
'ch_groups'
, $aDataEntry[
'id'
]);
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
'group_url'
=> CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'view/'
. $aDataEntry[
'uri'
],
42
),
43
),
44
'group_url'
=> CH_WSB_URL_ROOT . $this->oConfig->getBaseUri() .
'view/'
. $aDataEntry[
'uri'
],
45
'group_title'
=> $aDataEntry[
'title'
],
46
'author_title'
=>
_t
(
'_From'
),
47
'author_username'
=>
getNickName
($aAuthor[
'ID'
]),
48
'author_url'
=>
getProfileLink
($aAuthor[
'ID'
]),
49
'rating'
=> $oRating->isEnabled() ? $oRating->getJustVotingElement (
true
, $aDataEntry[
'id'
]) :
''
,
50
'fans_count'
=> $aDataEntry[
'fans_count'
],
51
'country_city'
=> $this->oMain->_formatLocation($aDataEntry,
false
,
true
),
52
);
53
return
$this->oTemplate->parseHtmlByName(
'latest_featured_group'
,
$aVars
);
54
}
55
56
function
getBlockCode_Recent
()
57
{
58
return
$this->
ajaxBrowse
(
'recent'
, $this->oDb->getParam(
'ch_groups_perpage_main_recent'
));
59
}
60
}
ch_import
ch_import($sClassName, $aModule=array())
Definition:
utils.inc.php:1218
php
ch_groups_import
ch_groups_import($sClassPostfix, $aModuleOverwright=array())
Definition:
ChGroupsModule.php:8
ChWsbTwigPageMain
Definition:
ChWsbTwigPageMain.php:14
ChGroupsPageMain\getBlockCode_LatestFeaturedGroup
getBlockCode_LatestFeaturedGroup()
Definition:
ChGroupsPageMain.php:19
ChGroupsVoting
Definition:
ChGroupsVoting.php:11
ChGroupsPageMain
Definition:
ChGroupsPageMain.php:11
getNickName
getNickName( $ID='')
Definition:
profiles.inc.php:461
ChWsbTwigPageMain\ajaxBrowse
ajaxBrowse($sMode, $iPerPage, $aMenu=array(), $sValue='', $isDisableRss=false, $isPublicOnly=true)
Definition:
ChWsbTwigPageMain.php:34
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition:
languages.inc.php:509
getProfileLink
getProfileLink( $iID, $sLinkAdd='')
Definition:
profiles.inc.php:484
ChGroupsPageMain\getBlockCode_Recent
getBlockCode_Recent()
Definition:
ChGroupsPageMain.php:56
$aVars
$aVars
Definition:
license.php:101
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition:
profiles.inc.php:249
ChWsbTwigPageMain\$oMain
$oMain
Definition:
ChWsbTwigPageMain.php:15
ChWsbService\call
static call($mixed, $sMethod, $aParams=array(), $sClass='Module')
Definition:
ChWsbService.php:32
ChGroupsPageMain\__construct
__construct(&$oMain)
Definition:
ChGroupsPageMain.php:12
Generated by
1.8.20