Cheetah
ChAdsPageView.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbPageView');
9 
11 {
12  var $oAds;
13  var $iAdId;
14 
15  function __construct(&$oAd, $iAdId)
16  {
17  $this->iAdId = $iAdId;
18  $this->oAds = &$oAd;
19  parent::__construct('ads');
20  }
21 
23  {
24  return $this->oAds->sTAPhotosContent;
25  }
26 
28  {
29  return $this->oAds->sTAActionsContent;
30  }
31 
33  {
34  return $this->oAds->sTACommentsContent;
35  }
36 
38  {
39  return array($this->oAds->sTAInfoContent);
40  }
41 
43  {
44  return $this->oAds->sTAOtherListingContent;
45  }
46 
47  function getBlockCode_Rate()
48  {
49  return $this->oAds->sTARateContent;
50  }
51 
53  {
54  return $this->oAds->sTADescription;
55  }
56 
58  {
59  $sContent = $this->oAds->sTAOtherInfo;
60  return array($sContent, array(), array(), false);
61  }
62 
64  {
65  $aAd = $this->oAds->_oDb->getAdInfo($this->iAdId);
66  if (!$aAd || !$this->oAds->isAllowedShare($aAd))
67  return '';
68 
69  $sUrl = $this->oAds->genUrl($this->iAdId, $aAd['EntryUri'], 'entry');
70  $sTitle = $aAd['title'];
71  $sImgUrl = false;
72  $aCustomParams = false;
73  if ($aAd['Media'] && ($sImgUrl = $this->oAds->getAdCover($aAd['Media'], 'big_thumb', false))) {
74  $aCustomParams = array (
75  'img_url' => $sImgUrl,
76  'img_url_encoded' => rawurlencode($sImgUrl)
77  );
78  }
79 
80  ch_import('ChTemplSocialSharing');
81  $sCode = ChTemplSocialSharing::getInstance()->getCode($sUrl, $sTitle, $aCustomParams);
82  return array($sCode, array(), array(), false);
83  }
84 }
ChWsbSocialSharing\getInstance
static getInstance()
Definition: ChWsbSocialSharing.php:50
ChAdsPageView\getBlockCode_SocialSharing
getBlockCode_SocialSharing()
Definition: ChAdsPageView.php:63
ChWsbPageView
Definition: ChWsbPageView.php:99
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
$sUrl
$sUrl
Definition: cart.php:15
php
ChAdsPageView\getBlockCode_Rate
getBlockCode_Rate()
Definition: ChAdsPageView.php:47
ChAdsPageView\getBlockCode_AdCustomInfo
getBlockCode_AdCustomInfo()
Definition: ChAdsPageView.php:57
$sTitle
$sTitle
Definition: actions.inc.php:13
ChAdsPageView\__construct
__construct(&$oAd, $iAdId)
Definition: ChAdsPageView.php:15
ChAdsPageView\getBlockCode_AdInfo
getBlockCode_AdInfo()
Definition: ChAdsPageView.php:37
ChAdsPageView\getBlockCode_UserOtherAds
getBlockCode_UserOtherAds()
Definition: ChAdsPageView.php:42
ChAdsPageView\$iAdId
$iAdId
Definition: ChAdsPageView.php:13
$sContent
$sContent
Definition: bottom_menu_compose.php:169
ChAdsPageView\$oAds
$oAds
Definition: ChAdsPageView.php:12
ChAdsPageView\getBlockCode_ViewComments
getBlockCode_ViewComments()
Definition: ChAdsPageView.php:32
ChAdsPageView\getBlockCode_AdDescription
getBlockCode_AdDescription()
Definition: ChAdsPageView.php:52
ChAdsPageView\getBlockCode_AdPhotos
getBlockCode_AdPhotos()
Definition: ChAdsPageView.php:22
ChAdsPageView\getBlockCode_ActionList
getBlockCode_ActionList()
Definition: ChAdsPageView.php:27
ChAdsPageView
Definition: ChAdsPageView.php:11
ChWsbPageView\$sCode
$sCode
Definition: ChWsbPageView.php:102