Exemple #1
0
        // Get the Guest custom settings
        $query = '
SELECT ' . implode(',', $fields) . '
  FROM ' . USER_INFOS_TABLE . '
  WHERE user_id = ' . $conf['default_user_id'] . '
;';
        $result = pwg_query($query);
        $default_user = pwg_db_fetch_assoc($result);
        $userdata = array_merge($userdata, $default_user);
    }
    save_profile_from_post($userdata, $page['errors']);
    $title = l10n('Your Gallery Customization');
    $page['body_id'] = 'theProfilePage';
    $template->set_filename('profile', 'profile.tpl');
    $template->set_filename('profile_content', 'profile_content.tpl');
    load_profile_in_template(get_root_url() . 'profile.php', make_index_url(), $userdata);
    $template->assign_var_from_handle('PROFILE_CONTENT', 'profile_content');
    // include menubar
    $themeconf = $template->get_template_vars('themeconf');
    if (!isset($themeconf['hide_menu_on']) or !in_array('theProfilePage', $themeconf['hide_menu_on'])) {
        include PHPWG_ROOT_PATH . 'include/menubar.inc.php';
    }
    include PHPWG_ROOT_PATH . 'include/page_header.php';
    trigger_notify('loc_end_profile');
    flush_page_messages();
    $template->pparse('profile');
    include PHPWG_ROOT_PATH . 'include/page_tail.php';
}
//------------------------------------------------------ update & customization
function save_profile_from_post($userdata, &$errors)
{
Exemple #2
0
     $template->assign('comments', array('NB_COMMENTS_PAGE' => $conf['nb_comment_page'], 'comments_order' => $conf['comments_order'], 'comments_order_options' => $comments_order));
     foreach ($comments_checkboxes as $checkbox) {
         $template->append('comments', array($checkbox => $conf[$checkbox]), true);
     }
     break;
 case 'default':
     $edit_user = build_user($conf['guest_id'], false);
     include_once PHPWG_ROOT_PATH . 'profile.php';
     $errors = array();
     if (save_profile_from_post($edit_user, $errors)) {
         // Reload user
         $edit_user = build_user($conf['guest_id'], false);
         $page['infos'][] = l10n('Information data registered in database');
     }
     $page['errors'] = array_merge($page['errors'], $errors);
     load_profile_in_template($action, '', $edit_user, 'GUEST_');
     $template->assign('default', array());
     break;
 case 'display':
     foreach ($display_checkboxes as $checkbox) {
         $template->append('display', array($checkbox => $conf[$checkbox]), true);
     }
     $template->append('display', array('picture_informations' => unserialize($conf['picture_informations']), 'NB_CATEGORIES_PAGE' => $conf['nb_categories_page']), true);
     break;
 case 'sizes':
     // we only load the derivatives if it was not already loaded: it occurs
     // when submitting the form and an error remains
     if (!isset($page['sizes_loaded_in_tpl'])) {
         $is_gd = pwg_image::get_library() == 'gd' ? true : false;
         $template->assign('is_gd', $is_gd);
         $template->assign('sizes', array('original_resize_maxwidth' => $conf['original_resize_maxwidth'], 'original_resize_maxheight' => $conf['original_resize_maxheight'], 'original_resize_quality' => $conf['original_resize_quality']));
Exemple #3
0
// | Copyright(C) 2003-2008 PhpWebGallery Team    http://phpwebgallery.net |
// | Copyright(C) 2002-2003 Pierrick LE GALL   http://le-gall.net/pierrick |
// +-----------------------------------------------------------------------+
// | This program is free software; you can redistribute it and/or modify  |
// | it under the terms of the GNU General Public License as published by  |
// | the Free Software Foundation                                          |
// |                                                                       |
// | This program is distributed in the hope that it will be useful, but   |
// | WITHOUT ANY WARRANTY; without even the implied warranty of            |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU      |
// | General Public License for more details.                              |
// |                                                                       |
// | You should have received a copy of the GNU General Public License     |
// | along with this program; if not, write to the Free Software           |
// | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, |
// | USA.                                                                  |
// +-----------------------------------------------------------------------+
if (!defined("PHPWG_ROOT_PATH")) {
    die("Hacking attempt!");
}
$edit_user = build_user($_GET['user_id'], false);
if (!empty($_POST)) {
    check_pwg_token();
}
include_once PHPWG_ROOT_PATH . 'profile.php';
$errors = array();
save_profile_from_post($edit_user, $errors);
load_profile_in_template(get_root_url() . 'admin.php?page=profile&user_id=' . $edit_user['id'], get_root_url() . 'admin.php?page=user_list', $edit_user);
$page['errors'] = array_merge($page['errors'], $errors);
$template->set_filename('profile', 'profile.tpl');
$template->assign_var_from_handle('ADMIN_CONTENT', 'profile');