root/trunk/inc/new/profile.inc.php

Revision 15, 3.7 KB (checked in by alexx, 7 years ago)
  • fix last bug in communities (see [14])
  • execute a "conversion smarty style" script ;) : for i in find . -type f | grep "\.php$" | grep -v "\.svn"; do perl -pi -e "s/\\\$smarty->assign\((.*),(.*)\);/\\\$_SMARTY\[\$1\] = \$2;/" $i; done
Line 
1<?php
2/****************************************************** Open .node ***
3 * Description:   
4 * Status:        Stable.
5 * Author:        Alexandre Dath <alexandre@dotnode.com>
6 * $Id$
7 *
8 * Copyright (C) 2005 Alexandre Dath <alexandre@dotnode.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software Foundation,
22 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 ******************** http://opensource.ikse.net/projects/dotnode ***/
24
25include(INCLUDESPATH.'/countries_list.inc.php');
26
27unset($labels['profile']['country']['(null)']);
28
29
30if(!$_SESSION['my_login'])
31{
32    header('Location: /new');
33    exit();
34}
35
36if($_SESSION['my_login'] && $_SESSION['my_status']=='ok')
37{
38        header('Location: /my/profile/general');
39        exit();
40}
41
42
43$_SMARTY['Title'] =  'Profile creation';
44
45$step = array(
46    _('You'),
47    _('Contact'),
48    _('Job'),
49    _('Interests'),
50    _('Personal'),
51    _('Photo'),
52    _('Finish'));
53
54$t_name = 'user_general';
55$my['general'] =& $db->getRow('SELECT relationship_status ,birthday ,here_for ,children ,gender ,fashion ,smoking ,drinking ,living ,web ,description FROM ! WHERE id=?', array($t_name, $_SESSION['my_id']));
56$my['general']['here_for'] = split(',', $my['general']['here_for']);
57$my['general']['fashion'] = split(',', $my['general']['fashion']);
58$my['general']['living'] = split(',', $my['general']['living']);
59
60if( DB::isError( $my['general'] ) )
61        error_log($_SERVER['HTTP_HOST'].' | Erreyr SQL dans '.__FILE__.': '.$my['general']->getMessage());
62$access_list[$t_name] = get_access_list($_SESSION['my_id'], $t_name );
63
64
65
66$t_name = 'user_contact';
67$t_fields = implode(',', array_keys($table_fields[$t_name]));
68$my['contact'] =& $db->getRow('SELECT ! FROM ! WHERE id=?', array($t_fields, $t_name, $_SESSION['my_id']));
69
70if( DB::isError($user_contact) )
71        error_log($_SERVER['HTTP_HOST'].' | Erreyr SQL dans '.__FILE__.': '.$user_contact->getMessage());
72$access_list[$t_name] = get_access_list($_SESSION['my_id'], $t_name );
73
74
75$t_name = 'user_professional';
76$my['professional'] =& $db->getRow('SELECT occupation, industry, company, web, title, description, email, phone FROM ! WHERE id=?', array($t_name, $_SESSION['my_id']));
77if( DB::isError($my['professional']) )
78        error_log($_SERVER['HTTP_HOST'].' | Erreyr SQL dans '.__FILE__.': '.$my['professional']->getMessage());
79$access_list[$t_name] = get_access_list($_SESSION['my_id'], $t_name );
80
81
82$t_name = 'user_interests';
83$t_fields = implode(',', array_keys($table_fields[$t_name]));
84$my['interests'] =& $db->getRow('SELECT ! FROM ! WHERE id=?', array($t_fields, $t_name, $_SESSION['my_id']));
85if( DB::isError($user_interests) )
86        error_log($_SERVER['HTTP_HOST'].' | Erreyr SQL dans '.__FILE__.': '.$user_interests->getMessage());
87
88
89$my['personal'] =& $db->getRow('SELECT headline ,notice ,size , eye ,hair ,body_art ,best_feature ,things_i_cant_live_without ,ideal_match FROM user_personal WHERE id=?', array($_SESSION['my_id']));
90$my['personal']['body_art'] = split(',', $my['personal']['body_art']);
91if( DB::isError($user_personal) )
92        error_log($_SERVER['HTTP_HOST'].' | Erreyr SQL dans '.__FILE__.': '.$user_personal->getMessage());
93
94
95$_SMARTY['access_list'] = $access_list;
96$_SMARTY['my'] =  $my;
97
98$_SMARTY['step'] =  $step;
99
100?>
Note: See TracBrowser for help on using the browser.