Esempio n. 1
0
function echo_general_tab()
{
    global $uid, $pguser, $userP;
    global $u_n;
    $options = get_locale_translation_selection_options();
    $u_intlang_options[""] = BROWSER_DEFAULT_STR;
    $u_intlang_options = array_merge($u_intlang_options, $options);
    $i_stats_privacy = array(PRIVACY_PUBLIC => _("Public"), PRIVACY_ANONYMOUS => _("Anonymous"), PRIVACY_PRIVATE => _("Private"));
    $user = new User($pguser);
    echo "<tr>\n";
    show_preference(_('Name'), 'real_name', 'name', $user->real_name, 'textfield', array('20', ''));
    show_blank();
    echo "</tr>\n";
    // Check for DP/forum email mismatch, warn user if not the same
    $bb_user_info = get_forum_user_details($pguser);
    $email_warning = '';
    if ($bb_user_info["email"] != $user->email) {
        $edit_url = get_url_to_edit_profile();
        $email_warning = "<p><b>" . sprintf(_("Warning: The email in your <a href='%s'>forum profile</a> is different."), $edit_url) . "</b><br>";
        $email_warning .= _("Please update if necessary to ensure you receive messages as intended.") . "</p>\n";
    }
    echo "<tr>\n";
    show_preference(_('E-mail'), 'email', 'email', $user->email, 'textfield', array('26', $email_warning));
    show_preference(_('Interface Language'), 'u_intlang', 'intlang', $userP['u_intlang'], 'dropdown', $u_intlang_options);
    echo "</tr>\n";
    echo "<tr>\n";
    show_preference(_('E-mail Updates'), 'email_updates', 'updates', $userP['email_updates'], 'radio_group', array(1 => _("Yes"), 0 => _("No")));
    $theme_options = array();
    $result = mysql_query("SELECT * FROM themes");
    while ($row = mysql_fetch_array($result)) {
        $option_value = $row['unixname'];
        $option_label = $row['name'];
        $theme_options[$option_value] = $option_label;
    }
    show_preference(_('Theme'), 'i_theme', 'theme', $userP['i_theme'], 'dropdown', $theme_options);
    echo "</tr>\n";
    echo "<tr>\n";
    show_link_as_if_preference(_('Password'), 'password', get_reset_password_url(), _("Reset Password"));
    show_preference(_('Statistics Bar Alignment'), 'u_align', 'align', $userP['u_align'], 'radio_group', array(1 => _("Left"), 0 => _("Right")));
    echo "</tr>\n";
    echo "<tr>\n";
    show_preference(_('Statistics'), 'u_privacy', 'privacy', $userP['u_privacy'], 'dropdown', $i_stats_privacy);
    show_preference(_('Show Rank Neighbors'), 'u_neigh', 'neighbors', $userP['u_neigh'], 'dropdown', $u_n);
    echo "</tr>\n";
    echo "<tr>\n";
    show_preference(_('Credits Wanted'), NULL, 'creditswanted', NULL, 'credits_wanted_adhoc', NULL);
    show_blank();
    echo "</tr>\n";
    echo "<tr>\n";
    show_preference(_('Credit Name'), NULL, 'creditname', NULL, 'credit_name_adhoc', NULL);
    show_blank();
    echo "</tr>\n";
    echo_bottom_button_row();
}
Esempio n. 2
0
<?php

$relPath = "./../../pinc/";
include_once $relPath . 'base.inc';
include_once $relPath . 'prefs_options.inc';
// PRIVACY_*
include_once $relPath . 'misc.inc';
// xmlencode()
include_once $relPath . 'page_tally.inc';
include_once $relPath . 'forum_interface.inc';
include_once $relPath . 'User.inc';
include_once '../includes/team.inc';
include_once '../includes/member.inc';
$username = @$_GET['username'];
$user = new User($username);
$forum_profile = get_forum_user_details($username);
//Try our best to make sure no browser caches the page
header("Content-Type: text/xml");
header("Expires: Sat, 1 Jan 2000 05:00:00 GMT");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Pragma: no-cache");
echo "<?xml version=\"1.0\" encoding=\"{$charset}\" ?>\n";
echo "<memberstats xmlns:xsi=\"http://www.w3.org/2000/10/XMLSchema-instance\" xsi:noNamespaceSchemaLocation=\"memberstats.xsd\">\n";
$now = time();
$daysInExistence = floor(($now - $user->date_created) / 86400);
//User info
if ($user->u_privacy == PRIVACY_PUBLIC) {
    echo "\n        <userinfo id='{$user->u_id}'>\n            <username>" . xmlencode($user->username) . "</username>\n            <datejoined>" . date("m/d/Y", $user->date_created) . "</datejoined>\n            <lastlogin>" . date("m/d/Y", $user->last_login) . "</lastlogin>\n            <location>" . xmlencode($forum_profile['from']) . "</location>\n            <occupation>" . xmlencode($forum_profile['occ']) . "</occupation>\n            <interests>" . xmlencode($forum_profile['interests']) . "</interests>\n            <website>" . xmlencode($forum_profile['website']) . "</website>";
    foreach ($page_tally_names as $tally_name => $tally_title) {
        $tallyboard = new TallyBoard($tally_name, 'U');