$template->assign('main', array('CONF_GALLERY_TITLE' => htmlspecialchars($conf['gallery_title']), 'CONF_PAGE_BANNER' => htmlspecialchars($conf['page_banner']), 'week_starts_on_options' => array('sunday' => $lang['day'][0], 'monday' => $lang['day'][1]), 'week_starts_on_options_selected' => $conf['week_starts_on'], 'mail_theme' => $conf['mail_theme'], 'mail_theme_options' => $mail_themes, 'order_by' => $order_by, 'order_by_options' => $sort_fields)); foreach ($main_checkboxes as $checkbox) { $template->append('main', array($checkbox => $conf[$checkbox]), true); } break; case 'comments': $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':
$userdata = $user; trigger_notify('loc_begin_profile'); // Reset to default (Guest) custom settings if (isset($_POST['reset_to_default'])) { $fields = array('nb_image_page', 'expand', 'show_nb_comments', 'show_nb_hits', 'recent_period', 'show_nb_hits'); // 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');