HomeHelpTrac

source: tags/6.1/profile.php @ 10242

Revision 10242, 4.1 KB checked in by Alexander Trofimov, 3 years ago (diff)

dolphin 6.1.5, initial commit

Line 
1<?
2
3/***************************************************************************
4*                            Dolphin Smart Community Builder
5*                              -----------------
6*     begin                : Mon Mar 23 2006
7*     copyright            : (C) 2006 BoonEx Group
8*     website              : http://www.boonex.com/
9* This file is part of Dolphin - Smart Community Builder
10*
11* Dolphin is free software. This work is licensed under a Creative Commons Attribution 3.0 License.
12* http://creativecommons.org/licenses/by/3.0/
13*
14* Dolphin is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
15* without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16* See the Creative Commons Attribution 3.0 License for more details.
17* You should have received a copy of the Creative Commons Attribution 3.0 License along with Dolphin,
18* see license.txt file; if not, write to marketing@boonex.com
19***************************************************************************/
20
21require_once( 'inc/header.inc.php' );
22require_once( BX_DIRECTORY_PATH_INC . 'design.inc.php' );
23require_once( BX_DIRECTORY_PATH_INC . 'profiles.inc.php' );
24require_once( BX_DIRECTORY_PATH_INC . 'members.inc.php' );
25require_once( BX_DIRECTORY_PATH_INC . 'utils.inc.php' );
26require_once( BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/scripts/BxTemplProfileView.php" );
27
28$_page['name_index']    = 7;
29$_page['css_name']      = 'profile_view.css';
30
31check_logged();
32
33$profileID = getID( $_REQUEST['ID'] );
34
35if( $logged['member'] ) {
36    $memberID = (int)$_COOKIE['memberID'];
37} else {
38    $memberID = 0;
39}
40
41if ( !$profileID ) {
42    $_page['header'] = "{$site['title']} ". _t("_Member Profile");
43    $_page['header_text'] = _t("_View profile");
44    $_page['name_index'] = 0;
45    $_page_cont[0]['page_main_code'] = MsgBox( _t("_Profile NA") );
46    PageCode();
47    exit;
48}
49
50// Check if member can view profile
51$contact_allowed = contact_allowed($memberID, $profileID);
52$check_res = checkAction( $memberID, ACTION_ID_VIEW_PROFILES, true, $profileID );
53
54if ( $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED
55    && !$logged['admin'] && !$logged['moderator'] && $memberID != $profileID && !$contact_allowed )
56{
57    $_page['header'] = "{$site['title']} "._t("_Member Profile");
58    $_page['header_text'] = "{$site['title']} "._t("_Member Profile");
59    $_page['name_index'] = 0;
60    $_page_cont[0]['page_main_code'] = '<center>'. $check_res[CHECK_ACTION_MESSAGE] .'</center><br />';
61    PageCode();
62    exit;
63}
64
65
66$oProfile = new BxTemplProfileView( $profileID );
67
68$_page['extra_js']  =
69    $oTemplConfig -> sTinyMceEditorMiniJS .
70    $oProfile->oVotingView->getExtraJs() .
71    $oProfile->oCmtsView->getExtraJs() .
72    '<script type="text/javascript">urlIconLoading = "'.getTemplateIcon('loading.gif').'";</script>';
73
74$_page['extra_css'] = $oProfile -> genProfileCSS( $profileID ) . $oProfile->oCmtsView->getExtraCss();
75$p_arr              = $oProfile -> _aProfile;
76
77if ( !($p_arr['ID'] && ($logged['admin'] || $logged['moderator'] || $oProfile -> owner || $p_arr['Status'] = 'Active') ) )
78{
79    $_page['header'] = "{$site['title']} ". _t("_Member Profile");
80    $_page['header_text'] = "{$site['title']} ". _t("_Member Profile");
81    $_page['name_index'] = 0;
82    $_page_cont[0]['page_main_code'] = '<div class="no_result"><div>' . _t("_Profile NA") .'.</div></div>';
83    PageCode();
84    exit;
85}
86
87$_page['header']      = process_line_output( $p_arr['NickName'] ) . ": ". htmlspecialchars_adv( $p_arr['Headline'] );
88//$_page['header_text'] = process_line_output( $p_arr['Headline'] );
89
90// track profile views
91if ( $track_profile_view && $memberID && !$oProfile -> owner )
92{
93    db_res( "DELETE FROM `ProfilesTrack` WHERE `Member` = {$memberID} AND `Profile` = $profileID", 0);
94    db_res( "INSERT INTO `ProfilesTrack` SET `Arrived` = NOW(), `Member` = {$memberID}, `Profile` = $profileID", 0);
95}
96
97$_ni = $_page['name_index'];
98
99//$_page_cont[$_ni]['page_main_code_headers'] = $oProfile -> genColumns(true);
100$oPPV = new BxDolProfilePageView($oProfile, $site, $dir);
101$_page_cont[$_ni]['page_main_code'] = $oPPV -> getCode();
102//$_page_cont[$_ni]['page_main_code'] = $oProfile -> genColumns();
103
104
105PageCode();
106
107?>
Note: See TracBrowser for help on using the repository browser.