Cheetah
ChBaseProfileView.php
Go to the documentation of this file.
1 <?php
2 
8 ch_import('ChWsbProfileFields');
9 ch_import('ChWsbPageView');
10 
12 {
14 
16  var $aConfDir;
17 
18  function __construct(&$oPr, &$aSite, &$aDir)
19  {
20  $this->oProfileGen = &$oPr;
21  $this->aConfSite = $aSite;
22  $this->aConfDir = $aDir;
23  parent::__construct('profile');
24 
25  ch_import('ChWsbMemberInfo');
26  $o = ChWsbMemberInfo::getObjectInstance(getParam('sys_member_info_thumb'));
27  $sThumbUrl = $o ? $o->get($oPr->_aProfile) : '';
28 
29  $GLOBALS['oSysTemplate']->setOpenGraphInfo(array(
30  'title' => getNickName($oPr->_aProfile['ID']),
31  'type' => 'profile',
32  ));
33  if ($sThumbUrl)
34  $GLOBALS['oSysTemplate']->setOpenGraphInfo(array('image' => $sThumbUrl));
35 
36  }
37 
38  function genBlock( $iBlockID, $aBlock, $bStatic = true, $sDynamicType = 'tab' )
39  {
40  //--- Privacy for Profile page ---//
41  $oPrivacy = new ChWsbPrivacy('sys_page_compose_privacy', 'id', 'user_id');
42 
43  $iPrivacyId = (int)$GLOBALS['MySQL']->getOne("SELECT `id` FROM `sys_page_compose_privacy` WHERE `user_id`='" . $this->oProfileGen->_iProfileID . "' AND `block_id`='" . $iBlockID . "' LIMIT 1");
44  if($iPrivacyId != 0 && !$oPrivacy->check('view_block', $iPrivacyId, $this->iMemberID))
45  return false;
46  //--- Privacy for Profile page ---//
47 
48  return parent::genBlock($iBlockID, $aBlock, $bStatic, $sDynamicType);
49  }
50  function getBlockCode_Cover()
51  {
52  return $this->oProfileGen->showBlockCover('', true);
53  }
55  {
56  return $this->oProfileGen->showBlockActionsMenu('', true);
57  }
59  {
60  return $this->oProfileGen->showBlockFriendRequest('', $this, true);
61  }
62  function getBlockCode_PFBlock( $iBlockID, $sContent )
63  {
64  return $this->oProfileGen->showBlockPFBlock($iBlockID, '', $sContent, true);
65  }
67  {
68  return $this->oProfileGen->showBlockRateProfile('', true);
69  }
71  {
72  return $this->oProfileGen->showBlockFriends('', $this, true);
73  }
75  {
76  return $this->oProfileGen->showBlockMutualFriends('', true);
77  }
79  {
80  return $this->oProfileGen->showBlockComments('', true);
81  }
82 
83  function getBlockCode_Cmts ()
84  {
85  return $this->oProfileGen->showBlockCmts();
86  }
87 
89  {
91  $sName = 'DescriptionMe';
92 
93  $oPF = new ChWsbProfileFields(2);
94  if( !$oPF->aBlocks)
95  return '';
96 
97  $aItem = false;
98  foreach ($oPF->aBlocks as $aBlock) {
99  foreach ($aBlock['Items'] as $a) {
100  if ($sName == $a['Name']) {
101  $aItem = $a;
102  break 2;
103  }
104  }
105  }
106 
107  $aProfileInfo = getProfileInfo($this -> oProfileGen -> _iProfileID);
108  if(!trim($aProfileInfo[$sName]))
109  return MsgBox(_t('_Empty'));
110 
111  return array ($aItem ? $oPF->getViewableValue($aItem, $aProfileInfo[$sName]) : htmlspecialchars_adv($aProfileInfo[$sName]));
112  }
113 
114  function _getBlockCaptionCode($iBlockID, $aBlock, $aBlockCode, $bStatic = true, $sDynamicType = 'tab')
115  {
116  //--- Privacy for Profile page ---//
117  $sCode = "";
118  if($this->iMemberID == $this->oProfileGen->_iProfileID) {
119  $sAlt = "";
120  $sCode = $GLOBALS['oSysTemplate']->parseHtmlByName('ps_page_chooser.html', array(
121  'alt' => $sAlt,
122  'page_name' => $this->sPageName,
123  'profile_id' => $this->oProfileGen->_iProfileID,
124  'block_id' => $iBlockID
125  ));
126  }
127  //--- Privacy for Profile page ---//
128 
129  return $sCode . parent::_getBlockCaptionCode($iBlockID, $aBlock, $aBlockCode, $bStatic, $sDynamicType);
130  }
131 }
ChWsbMemberInfo\getObjectInstance
static getObjectInstance($sObject)
Definition: ChWsbMemberInfo.php:39
ChBaseProfileView\_getBlockCaptionCode
_getBlockCaptionCode($iBlockID, $aBlock, $aBlockCode, $bStatic=true, $sDynamicType='tab')
Definition: ChBaseProfileView.php:114
ChWsbProfileFields
Definition: ChWsbProfileFields.php:13
MsgBox
MsgBox($sText, $iTimer=0)
Definition: design.inc.php:175
ChWsbPageView
Definition: ChWsbPageView.php:99
ChBaseProfileView\getBlockCode_FriendRequest
getBlockCode_FriendRequest()
Definition: ChBaseProfileView.php:58
ch_import
ch_import($sClassName, $aModule=array())
Definition: utils.inc.php:1218
ChBaseProfileView\$aConfDir
$aConfDir
Definition: ChBaseProfileView.php:16
ChBaseProfileView\getBlockCode_Friends
getBlockCode_Friends()
Definition: ChBaseProfileView.php:70
php
ChBaseProfileView\getBlockCode_MutualFriends
getBlockCode_MutualFriends()
Definition: ChBaseProfileView.php:74
ChBaseProfileView\$oProfileGen
$oProfileGen
Definition: ChBaseProfileView.php:13
ChBaseProfileView\getBlockCode_Cmts
getBlockCode_Cmts()
Definition: ChBaseProfileView.php:83
ChBaseProfileView
Definition: ChBaseProfileView.php:12
ChBaseProfileView\$aConfSite
$aConfSite
Definition: ChBaseProfileView.php:15
ChBaseProfileView\getBlockCode_Description
getBlockCode_Description()
Definition: ChBaseProfileView.php:88
ChBaseProfileView\getBlockCode_ActionsMenu
getBlockCode_ActionsMenu()
Definition: ChBaseProfileView.php:54
getParam
getParam($sParamName, $bUseCache=true)
Definition: db.inc.php:130
getNickName
getNickName( $ID='')
Definition: profiles.inc.php:461
ChBaseProfileView\__construct
__construct(&$oPr, &$aSite, &$aDir)
Definition: ChBaseProfileView.php:18
htmlspecialchars_adv
htmlspecialchars_adv($string)
Definition: utils.inc.php:302
ChBaseProfileView\getBlockCode_PFBlock
getBlockCode_PFBlock( $iBlockID, $sContent)
Definition: ChBaseProfileView.php:62
ChBaseProfileView\getBlockCode_RateProfile
getBlockCode_RateProfile()
Definition: ChBaseProfileView.php:66
global
if(!defined("GLOBAL_MODULE")) define("GLOBAL_MODULE" global
Definition: header.inc.php:25
$sContent
$sContent
Definition: bottom_menu_compose.php:169
_t
_t($key, $arg0="", $arg1="", $arg2="")
Definition: languages.inc.php:509
ChBaseProfileView\genBlock
genBlock( $iBlockID, $aBlock, $bStatic=true, $sDynamicType='tab')
Definition: ChBaseProfileView.php:38
$aProfileInfo
$aProfileInfo
Definition: short_profile_info.php:23
ChBaseProfileView\getBlockCode_Comments
getBlockCode_Comments()
Definition: ChBaseProfileView.php:78
getProfileInfo
getProfileInfo($iProfileID=0, $checkActiveStatus=false, $forceCache=false)
Definition: profiles.inc.php:249
ChBaseProfileView\getBlockCode_Cover
getBlockCode_Cover()
Definition: ChBaseProfileView.php:50
ChWsbPrivacy
Definition: ChWsbPrivacy.php:60
$oSysTemplate
$oSysTemplate
Definition: params.inc.php:22
$o
$o
Definition: cmd.php:193
as
as
Definition: Filter.ExtractStyleBlocks.Escaping.txt:10
$sName
$sName
Definition: ChWsbAdminTools.php:853
ChWsbPageView\$sCode
$sCode
Definition: ChWsbPageView.php:102
$GLOBALS
$GLOBALS['iAdminPage']
Definition: advanced_settings.php:10