23 $this->aConfSite = $aSite;
24 $this->aConfDir = $aDir;
26 parent::__construct(
'member');
47 'member_id' => $this->iMember,
48 'recipient_id' => $this->iMember,
49 'mailbox_mode' =>
'inbox_new'
55 return $oMailBox->getBlockCode_NewMessages(
false);
63 $sProfileStatusC =
_t(
'_Profile status');
64 $sPresenceC =
_t(
'_Presence');
65 $sMembershipC =
_t(
'_Membership2');
66 $sLastLoginC =
_t(
'_Last login');
67 $sRegistrationC =
_t(
'_Registration');
68 $sEmailC =
_t(
'_Email');
69 $sMembersC =
' ' .
_t(
'_Members');
70 $sProfileC =
_t(
'_Profile');
71 $sContentC =
_t(
'_Content');
74 $sProfileStatus =
_t(
"__{$this->aMemberInfo['Status']}" );
75 $sProfileStatusMess =
'';
76 switch ( $this->aMemberInfo[
'Status'] ) {
84 $sProfileStatusMess =
_t(
"_ATT_ACTIVE", $this->aMemberInfo[
'ID'],
$oTemplConfig -> popUpWindowWidth,
$oTemplConfig -> popUpWindowHeight );
97 $sLastLogin =
'never';
98 if (!
empty($this->aMemberInfo[
'DateLastLogin']) && $this->aMemberInfo[
'DateLastLogin'] !=
"0000-00-00 00:00:00") {
99 $sLastLoginTS =
$oForm->_passDateTime($this->aMemberInfo[
'DateLastLogin']);
103 $sRegistration =
'never';
104 if(!
empty($this->aMemberInfo[
'DateReg']) && $this->aMemberInfo[
'DateReg'] !=
"0000-00-00 00:00:00" ) {
105 $sRegistrationTS =
$oForm->_passDateTime($this->aMemberInfo[
'DateReg']);
110 require_once( CH_DIRECTORY_PATH_CLASSES .
'ChWsbUserStatusView.php' );
115 $aAccountCustomStatElements =
$GLOBALS[
'MySQL']->fromCache(
'sys_account_custom_stat_elements',
'getAllWithKey',
'SELECT * FROM `sys_account_custom_stat_elements`',
'ID');
116 $aPQStatisticsElements =
$GLOBALS[
'MySQL']->fromCache(
'sys_stat_member',
'getAllWithKey',
'SELECT * FROM `sys_stat_member`',
'Type');
118 $aCustomElements = array();
119 foreach($aAccountCustomStatElements
as $iID => $aMemberStats) {
120 $sUnparsedLabel = $aMemberStats[
'Label'];
121 $sUnparsedValue = $aMemberStats[
'Value'];
123 $sLabel =
_t($sUnparsedLabel);
124 $sUnparsedValue = str_replace(
'__site_url__', CH_WSB_URL_ROOT, $sUnparsedValue);
129 while(($iStartPos = strpos($sUnparsedValue, $sLblTmpl)) !==
false) {
130 $iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
131 if($iEndPos <= $iStartPos)
134 $sSubstr = substr($sUnparsedValue, $iStartPos + strlen($sLblTmpl), $iEndPos-$iStartPos - strlen($sLblTmpl));
135 $sKeyValue = mb_strtolower(
_t(
'_' . $sSubstr));
136 $sUnparsedValue = str_replace($sLblTmpl.$sSubstr.$sTmpl, $sKeyValue, $sUnparsedValue);
140 while(($iStartPos = strpos($sUnparsedValue, $sTmpl, 0)) !==
false) {
141 $iEndPos = strpos($sUnparsedValue, $sTmpl, $iStartPos + 1);
142 if($iEndPos <= $iStartPos)
148 $sCustomSQL = $aPQStatisticsElements[$sSubstr][
'SQL'];
149 $sCustomSQL = str_replace(
'__member_id__', $this->aMemberInfo[
'ID'], $sCustomSQL);
150 $sCustomSQL = str_replace(
'__profile_media_define_photo__',
_t(
'_ProfilePhotos'), $sCustomSQL);
151 $sCustomSQL = str_replace(
'__profile_media_define_music__',
_t(
'_ProfileMusic'), $sCustomSQL);
152 $sCustomSQL = str_replace(
'__profile_media_define_video__',
_t(
'_ProfileVideos'), $sCustomSQL);
154 $iCustomCnt = ($sCustomSQL!=
'') ? (
int)
db_value($sCustomSQL) :
'';
156 $sUnparsedValue = str_replace($sTmpl . $sSubstr . $sTmpl, $iCustomCnt, $sUnparsedValue);
159 $sTrimmedLabel = trim($sUnparsedLabel,
'_');
160 $aCustomElements[$sTrimmedLabel] = array(
162 'name' => $sTrimmedLabel,
163 'content' =>
'<b>' . $sLabel .
':</b> ' . $sUnparsedValue,
168 'form_attrs' => array(
173 'remove_form' =>
true,
177 'type' =>
'block_header',
178 'caption' => $sProfileC,
179 'collapsable' =>
true
190 'content' =>
'<b>' . $sProfileStatusC .
':</b> ' . $sProfileStatus .
'<br />' . $sProfileStatusMess,
196 'content' =>
'<b>' . $sEmailC .
':</b> ' . $this->aMemberInfo[
'Email'] .
'<br />' .
_t(
'_sys_txt_ac_manage_subscriptions'),
199 'Membership' => array(
201 'name' =>
'Membership',
202 'content' =>
'<b>' . $sMembershipC .
':</b> ' . $sMembStatus,
205 'LastLogin' => array(
207 'name' =>
'LastLogin',
208 'content' =>
'<b>' . $sLastLoginC .
':</b> ' . $sLastLogin,
211 'Registration' => array(
213 'name' =>
'Registration',
214 'content' =>
'<b>' . $sRegistrationC .
':</b> ' . $sRegistration,
217 'header1_end' => array(
218 'type' =>
'block_end'
221 'type' =>
'block_header',
222 'caption' => $sPresenceC,
223 'collapsable' =>
true,
226 'id' =>
'user_status_ac',
229 'UserStatus' => array(
235 'header2_end' => array(
236 'type' =>
'block_end'
242 if(!
empty($aCustomElements)) {
243 $aForm[
'inputs'] = array_merge(
245 array(
'header5' => array(
246 'type' =>
'block_header',
247 'caption' => $sContentC,
248 'collapsable' =>
true,
252 array(
'header5_end' => array(
253 'type' =>
'block_end'
259 $sContent =
$GLOBALS[
'oSysTemplate']->parseHtmlByName(
'member_account_control.html', array(
260 'content' =>
$oForm->getCode()
263 return array(
$sContent, array(), array(),
false);
278 $iPages = ceil($iCount/$iLimit);
287 $sSqlFrom = (
$iPage - 1) * $iLimit;
288 $sSqlLimit =
"LIMIT {$sSqlFrom}, {$iLimit}";
289 $aFriends =
getMyFriendsEx($this->iMember,
'',
'image', $sSqlLimit);
291 $aTmplParams[
'ch_repeat:friends'] = array();
292 foreach ($aFriends
as $iId => $aFriend)
293 $aTmplParams[
'ch_repeat:friends'][] = array(
296 $sContent =
$GLOBALS[
'oSysTemplate']->parseHtmlByName(
'member_friends.html', $aTmplParams);
299 'page_url' => CH_WSB_URL_ROOT .
'member.php',
301 'per_page' => $iLimit,
303 'on_change_page' =>
'return !loadDynamicBlock({id}, \'member.php?page={page}&per_page={per_page}\');',
305 $sPaginate = $oPaginate->getSimplePaginate($sAllFriends);
307 return array(
$sContent, array(), $sPaginate);
314 $sCodeBlock =
$oMenu->getCode();