11 require_once(
'ChSitesCmts.php');
22 parent::__construct(
'ch_sites_view', $oSites, $aSite);
24 $this->_oSites = &$oSites;
25 $this->_aSite = $aSite;
27 $this->_oTemplate = $oSites->_oTemplate;
28 $this->_oConfig = $oSites->_oConfig;
35 if ($this->_oSites->iOwnerId || $this->_oSites->isAdmin()) {
39 'iViewer' => $this->_oSites->iOwnerId,
40 'ownerID' => (
int)$this->_aSite[
'ownerid'],
41 'ID' => (
int)$this->_aSite[
'id'],
42 'TitleEdit' => $this->_oSites->isAllowedEdit($this->_aSite) ?
_t(
'_ch_sites_action_title_edit') :
'',
43 'TitleDelete' => $this->_oSites->isAllowedDelete($this->_aSite) ?
_t(
'_ch_sites_action_title_delete') :
'',
44 'TitleShare' => $this->_oSites->isAllowedShare($this->_aSite) ?
_t(
'_Share') :
'',
45 'AddToFeatured' => ($this->_oSites->isAllowedMarkAsFeatured($this->_aSite) && (
int)$this->_aSite[
'allowView'] ==
CH_WSB_PG_ALL) ?
46 ((
int)$this->_aSite[
'featured'] == 1 ?
_t(
'_ch_sites_action_remove_from_featured') :
_t(
'_ch_sites_action_add_to_featured')) :
''
50 $aButton =
$oSubscription->getButton($this->_oSites->iOwnerId,
'ch_sites',
'', $this->_aSite[
'id']);
53 $aInfo[
'sbs_sites_title'] = $aButton[
'title'];
54 $aInfo[
'sbs_sites_script'] = $aButton[
'script'];
59 if (
$aInfo[
'TitleShare']) {
60 $sUrlSharePopup = CH_WSB_URL_ROOT . $this->_oSites->_oConfig->getBaseUri() .
"share_popup/" . $this->_aSite[
'id'];
62 <script
type=
"text/javascript">
63 function ch_site_show_share_popup ()
65 if (!$(
'#ch_sites_share_popup').length) {
66 $(
'<div id="ch_sites_share_popup" style="display: none;"></div>').prependTo(
'body');
69 $(
'#ch_sites_share_popup').
load(
85 $aInfo[
'repostScript'] =
ChWsbService::call(
'wall',
'get_repost_js_click', array($this->_oSites->iOwnerId,
'ch_sites',
'add', (
int)$this->_aSite[
'id']));
89 if(
empty($aCodeActions))
92 return $sCode . $aCodeActions;
100 $sContent = $this->_oTemplate->blockInformation($this->_aSite);
101 return array(
$sContent, array(), array(),
false);
106 $sSiteUrl = $this->_aSite[
'url'];
108 $aFile =
ChWsbService::call(
'photos',
'get_photo_array', array($this->_aSite[
'photo'],
'file'),
'Search');
109 $sImage = $aFile[
'no_image'] ?
'' : $aFile[
'file'];
112 if (
getParam(
'ch_sites_account_type') !=
'No Automated Screenshots') {
114 $aSTWOptions = array(
125 if (strncasecmp($sSiteUrl,
'http://', 7) !== 0 && strncasecmp($sSiteUrl,
'https://', 8) !== 0)
126 $sSiteUrl =
'http://' . $sSiteUrl;
128 if ($this->_oConfig->isVotesAllowed() &&
129 $this->_oSites->oPrivacy->check(
'rate',
130 $this->_aSite[
'id'], $this->_oSites->iOwnerId))
135 if ($oVotingView->isEnabled())
136 $sVote = $oVotingView->getBigVoting();
139 $sContent = $this->_oTemplate->parseHtmlByName(
'view_image.html', array(
140 'title' => $this->_aSite[
'title'],
141 'site_url' => $sSiteUrl,
142 'site_url_view' => $this->_aSite[
'url'],
144 'ch_if:is_image' => array(
145 'condition' => $sThumbHTML ==
false,
146 'content' => array(
'image' => $sImage ? $sImage : $this->_oTemplate->getImageUrl(
'no-image-thumb.png'))
148 'ch_if:is_thumbhtml' => array(
149 'condition' => $sThumbHTML !=
'',
150 'content' => array(
'thumbhtml' => $sThumbHTML)
154 'view_count' => $this->_aSite[
'views']
157 return array(
$sContent, array(), array(),
false);
162 $sContent = $this->_oTemplate->parseHtmlByName(
'view_description.html', array(
163 'description' => $this->_aSite[
'description']
166 return array(
$sContent, array(), array(),
false);
171 if ($this->_oConfig->isCommentsAllowed() && $this->_oSites->oPrivacy->check(
'comments', $this->_aSite[
'id'], $this->_oSites->iOwnerId)) {
175 return $o->getCommentsFirst();