Example #1
0
        $globals['noindex'] = true;
        break;
    case 'profile':
    case 'subs':
        $globals['noindex'] = false;
        break;
    default:
        do_error(_('opción inexistente'), 404);
        break;
}
// Add canonical address
$globals['extra_head'] = '<link rel="canonical" href="http://' . get_server_name() . get_user_uri($user->username) . '" />' . "\n";
if (!empty($user->names)) {
    do_header("{$login} ({$user->names})", 'profile', User::get_menu_items($view, $login));
} else {
    do_header($login, 'profile', User::get_menu_items($view, $login));
}
// Used to show the user the number of unread answers to her comments
if ($current_user->user_id == $user->id) {
    $globals['extra_comment_conversation'] = ' [' . Comment::get_unread_conversations($user->id) . ']';
} else {
    $globals['extra_comment_conversation'] = '';
}
echo '<div id="singlewrap">' . "\n";
$url_login = urlencode($login);
switch ($view) {
    case 'subs':
        do_subs();
        break;
    case 'history':
        do_history();
Example #2
0
// do_user_ad: 0 = noad, > 0: probability n/100
// 100 if the user is the current one
if ($current_user->user_id == $user->id && $globals['external_user_ads'] && !empty($user->adcode)) {
    $globals['user_adcode'] = $user->adcode;
    $globals['user_adchannel'] = $user->adchannel;
    $globals['do_user_ad'] = 100;
}
if (isset($_POST['process'])) {
    $messages = save_profile();
} else {
    //$globals['secure_page'] = False;
    // This allows to send the user back to the original cross domain authentication and ssl_server
    //setcookie('return_site', get_server_name(), 0, $globals['base_url'], UserAuth::domain());
    $messages = array();
}
do_header(_('edición del perfil del usuario') . ': ' . $user->username, 'profile', User::get_menu_items('profile', $login));
//echo $save_messages; // We do it later because teh profile could change header's info
//show_profile();
$form = new stdClass();
$form->hash = md5($site_key . $user->id . $current_user->user_id);
$form->admin_mode = $admin_mode;
$form->auth_link = get_auth_link();
$form->user_levels = $user_levels;
$form->avatars_enabled = is_avatars_enabled();
$form->bio_max = $bio_max;
$form->bio_left = $form->bio_max - mb_strlen(html_entity_decode($user->bio, ENT_COMPAT, 'UTF-8'), 'UTF-8');
Haanga::Load('profile.html', compact('user', 'form', 'messages'));
do_footer();
function save_profile()
{
    global $db, $user, $current_user, $globals, $admin_mode, $site_key, $bio_max;