HomeHelpTrac

source: tags/6.1/photos_gallery.php @ 10242

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

dolphin 6.1.5, initial commit

Line 
1<?php
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 . 'utils.inc.php' );
25require_once( BX_DIRECTORY_PATH_ROOT . 'profilePhotos.php' );
26require_once( BX_DIRECTORY_PATH_ROOT . "templates/tmpl_{$tmpl}/scripts/BxTemplVotingView.php" );
27
28// --------------- page variables and login
29
30$img_num = $pic_num;
31
32$_page['name_index']    = 62;
33$_page['css_name']      = 'upload_media.css';
34
35
36if ( !( $logged['admin'] = member_auth( 1, false ) ) )
37{
38    if ( !( $logged['member'] = member_auth( 0, false ) ) )
39    {
40        if ( !( $logged['aff'] = member_auth( 2, false )) )
41        {
42            $logged['moderator'] = member_auth( 3, false );
43        }
44    }
45}
46
47
48$_page['header'] = _t( "_Profile Photos" );
49//$_page['header_text'] = _t( "_PIC_GALLERY_H1" );
50
51$oVotingView = new BxTemplVotingView('media', 0, 0);
52$_page['extra_js']  = $oVotingView->getExtraJs();
53
54// --------------- GET/POST actions
55
56
57
58$_ni = $_page['name_index'];
59$_page_cont[$_ni]['page_main_code'] = getPageMainCode();
60
61// --------------- [END] page components
62
63PageCode();
64
65// --------------- page components functions
66
67
68function getPageMainCode()
69{
70    $aPhotoConf = array();
71    $aPhotoConf['profileID'] = (int)$_REQUEST['ID'];
72    $aPhotoConf['visitorID'] = (int)$_COOKIE['memberID'];
73    $aPhotoConf['isOwner'] = ( $aPhotoConf['profileID'] == $aPhotoConf['visitorID'] ) ? true : false;
74   
75    if( $aPhotoConf['isOwner'] )
76    {
77        header( "Location:upload_media.php?show=photos" );
78        exit;
79    }
80   
81    $check_res = checkAction( $aPhotoConf['visitorID'], ACTION_ID_VIEW_PHOTOS );
82    if ( $check_res[CHECK_ACTION_RESULT] != CHECK_ACTION_RESULT_ALLOWED )
83    {
84        $ret = '
85            <table width="100%" cellpadding="4" cellspacing="4" border="0">
86                <tr>
87                    <td align="center">' . $check_res[CHECK_ACTION_MESSAGE] . '</td>
88                </tr>
89            </table>';
90        return $ret;
91    }
92
93    $oPhotos = new ProfilePhotos( $aPhotoConf['profileID'] );
94    $oPhotos -> getActiveMediaArray();
95
96    $ret = '';
97    if( $_REQUEST['voteSubmit'] && $_REQUEST['photoID'] )
98    {
99        $oPhotos -> setVoting();
100        header('Location:' . $_SERVER['PHP_SELF'] . '?ID=' . $oPhotos -> iProfileID . '&photoID=' . $_REQUEST['photoID'] );
101    }
102
103    if( !$aPhotoConf['isOwner'] )
104    {
105        $ret .= ProfileDetails( $oPhotos -> iProfileID );
106        $ret .= '<div class="clear_both"></div>';
107    }
108
109
110    if( 0 < $_REQUEST['photoID'] )
111    {
112        $iPhotoID = $_REQUEST['photoID'];
113        $ret .= $oPhotos -> getMediaPage( $iPhotoID );
114    }
115    else
116    {
117        $ret .= $oPhotos -> getMediaPage();
118    }
119
120
121
122    return $ret;
123}
124?>
Note: See TracBrowser for help on using the repository browser.