Ejemplo n.º 1
0
    $data['abcode']['smileys'] = cs_abcode_smileys('users_info');
    $data['country'] = array();
    $run = 0;
    foreach ($cs_country as $short => $full) {
        $data['country'][$run]['short'] = $short;
        $data['country'][$run]['selection'] = $short == $cs_user['users_country'] ? ' selected="selected"' : '';
        $data['country'][$run]['full'] = $full;
        $run++;
    }
    echo cs_subtemplate(__FILE__, $data, 'users', 'profile');
} else {
    settype($cs_user['users_height'], 'integer');
    settype($cs_user['users_icq'], 'integer');
    $cs_user['users_hidden'] = implode(',', $hidden);
    if ($cs_user['users_nick'] != $account['users_nick']) {
        change_nick($account['users_id'], $account['users_nick']);
    }
    $users_cells = array_keys($cs_user);
    $users_save = array_values($cs_user);
    cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $account['users_id']);
    cs_cache_delete('navbirth');
    cs_cache_delete('nextbirth');
    $data['link']['continue'] = cs_url('users', 'home');
    $data['lang']['head'] = $cs_lang['profile'];
    echo cs_subtemplate(__FILE__, $data, 'users', 'done');
    if ($account['access_wizard'] == 5) {
        $wizard = cs_sql_count(__FILE__, 'options', "options_name = 'done_prfl' AND options_value = '1'");
        if (empty($wizard)) {
            $data['wizard']['show'] = cs_link($cs_lang['show'], 'wizard', 'roots');
            $data['wizard']['task_done'] = cs_link($cs_lang['task_done'], 'wizard', 'roots', 'handler=prfl&done=1');
            echo cs_subtemplate(__FILE__, $data, 'users', 'wizard');
Ejemplo n.º 2
0
        }
        // State selections
        $data['users']['state_activated'] = $cs_user['users_active'] == 1 ? $sel : '';
        $data['users']['state_deactivated'] = $cs_user['users_active'] == 0 ? $sel : '';
        // Access
        $where = "access_clansphere <= '" . $account['access_clansphere'] . "'";
        $access_data = cs_sql_select(__FILE__, 'access', 'access_name, access_id, access_clansphere', $where, 'access_name', 0, 0);
        $data['users']['access_dropdown'] = cs_dropdown('access_id', 'access_name', $access_data, $cs_user['access_id']);
        // Languages
        $languages = cs_checkdirs('lang');
        foreach ($languages as $lang) {
            $fixed_lang[]['data[users_lang]'] = $lang['name'];
        }
        $data['users']['language_dropdown'] = cs_dropdown('data[users_lang]', 'data[users_lang]', $fixed_lang, $cs_user['users_lang']);
        // Output
        echo cs_subtemplate(__FILE__, $data, 'users', 'edit');
    } else {
        $cs_user['users_hidden'] = implode(',', $hidden);
        $old_nick = cs_sql_select(__FILE__, 'users', 'users_nick', 'users_id = ' . $users_id, 0, 0, 1);
        if ($old_nick['users_nick'] != $cs_user['users_nick']) {
            change_nick($users_id, $old_nick['users_nick']);
        }
        // DB update
        $users_cells = array_keys($cs_user);
        $users_save = array_values($cs_user);
        cs_sql_update(__FILE__, 'users', $users_cells, $users_save, $users_id);
        cs_cache_delete('navbirth');
        cs_cache_delete('nextbirth');
        cs_redirect($cs_lang['changes_done'], 'users');
    }
}