Esempio n. 1
0
function do_read($logged_in_user)
{
    $id = get_int("id");
    $message = BoincPrivateMessage::lookup_id($id);
    if (!$message || $message->userid != $logged_in_user->id) {
        error_page(tra("no such message"));
    }
    page_head(tra("Private messages") . " : " . $message->subject);
    pm_header();
    $sender = BoincUser::lookup_id($message->senderid);
    start_table();
    echo "<tr><th>" . tra("Subject") . "</th><td>" . $message->subject . "</td></tr>";
    echo "<tr><th>" . tra("Sender") . "</th><td>" . user_links($sender, BADGE_HEIGHT_SMALL);
    show_block_link($message->senderid);
    echo "</td></tr>";
    echo "<tr><th>" . tra("Date") . "</th><td>" . time_str($message->date) . "</td></tr>";
    echo "<tr><th>" . tra("Message") . "</th><td>" . output_transform($message->content, $options) . "</td></tr>";
    echo "<tr><td class=\"pm_footer\"></td><td>\n";
    echo "<a href=\"pm.php?action=new&amp;replyto={$id}\">" . tra("Reply") . "</a>\n";
    echo " &middot; <a href=\"pm.php?action=delete&amp;id={$id}\">" . tra("Delete") . "</a>\n";
    echo " &middot; <a href=\"pm.php?action=inbox\">" . tra("Inbox") . "</a>\n";
    end_table();
    if ($message->opened == 0) {
        $message->update("opened=1");
    }
}
            $select_2 = "checked=\"true\"";
        }
    } else {
        $select_0 = "checked=\"true\"";
    }
    row1(tra("Message-board identity"));
    row2(tra("Avatar") . "\n    <br><p class=\"text-muted\">" . tra("An image representing you on the message boards.") . "\n    <br>" . tra("Format: JPG or PNG. Size: at most 4 KB, 100x100 pixels") . "</p>", "<input type=\"radio\" id=\"avatar_select_0\" name=\"avatar_select\" value=\"0\" " . $select_0 . ">\n        <label for=\"avatar_select_0\">" . tra("Don't use an avatar") . "</label><br>\n    <input type=\"radio\" id=\"avatar_select_1\" name=\"avatar_select\" value=\"1\" " . $select_1 . ">\n        <label for=\"avatar_select_1\">" . tra("Use a Globally Recognized Avatar provided by %1", "<a href=\"http://gravatar.com\">Gravatar.com</a>") . "</label><br>\n    <input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" " . $select_2 . ">\n        <label for=\"avatar_select_2\">" . tra("Use this uploaded avatar:") . "</label> <input type=\"file\" name=\"picture\">");
    if (strlen($user->prefs->avatar)) {
        row2(tra("Avatar preview") . "<br><p class=\"text-muted\">" . tra("This is how your avatar will look") . "</p>", "<img src=\"" . $user->prefs->avatar . "\" width=\"100\" height=\"100\">");
    }
    $signature_by_default = $user->prefs->no_signature_by_default == false ? "checked=\"checked\"" : "";
    $signature = $user->prefs->signature;
    $maxlen = 250;
    row2(tra("Signature for message board posts") . html_info() . "<br><br>" . tra("Check out %1various free services%2\n<br> providing dynamic 'signature images'\n<br> showing your latest credit info, project news, etc.", "<a href=https://boinc.berkeley.edu/links.php#sigs>", "</a>"), textarea_with_counter("signature", 250, $signature) . "<br><input type=\"checkbox\" name=\"signature_by_default\" " . $signature_by_default . "> " . tra("Attach signature by default"));
    if ($user->prefs->signature != "") {
        row2(tra("Signature preview") . "<br><p class=\"text-muted\">" . tra("This is how your signature will look in the forums") . "</p>", output_transform($user->prefs->signature));
    }
    // ------------ Message display  -----------
    $forum_hide_avatars = $user->prefs->hide_avatars ? "checked=\"checked\"" : "";
    $forum_hide_signatures = $user->prefs->hide_signatures ? "checked=\"checked\"" : "";
    $forum_link_popup = $user->prefs->link_popup ? "checked=\"checked\"" : "";
    $forum_image_as_link = $user->prefs->images_as_links ? "checked=\"checked\"" : "";
    $forum_jump_to_unread = $user->prefs->jump_to_unread ? "checked=\"checked\"" : "";
    $forum_ignore_sticky_posts = $user->prefs->ignore_sticky_posts ? "checked=\"checked\"" : "";
    $forum_highlight_special = $user->prefs->highlight_special ? "checked=\"checked\"" : "";
    $forum_minimum_wrap_postcount = intval($user->prefs->minimum_wrap_postcount);
    $forum_display_wrap_postcount = intval($user->prefs->display_wrap_postcount);
    row1(tra("Message display"));
    row2(tra("What to display"), "<input type=\"checkbox\" name=\"forum_hide_avatars\" " . $forum_hide_avatars . "> " . tra("Hide avatar images") . "<br>\n    <input type=\"checkbox\" name=\"forum_hide_signatures\" " . $forum_hide_signatures . "> " . tra("Hide signatures") . "<br>\n    <input type=\"checkbox\" name=\"forum_images_as_links\" " . $forum_image_as_link . "> " . tra("Show images as links") . "<br>\n    <input type=\"checkbox\" name=\"forum_link_popup\" " . $forum_link_popup . "> " . tra("Open links in new window/tab") . "<br>\n    <input type=\"checkbox\" name=\"forum_highlight_special\" " . $forum_highlight_special . "> " . tra("Highlight special users") . "<br>\n    <input type=\"text\" name=\"forum_display_wrap_postcount\" size=3 value=\"" . $forum_display_wrap_postcount . "\"> " . tra("Display this many messages per page") . "<br />\n    ");
    row2(tra("How to sort"), tra("Threads:") . " " . select_from_array("forum_sort", $forum_sort_styles, $user->prefs->forum_sorting) . "<br>" . tra("Posts:") . " " . select_from_array("thread_sort", $thread_sort_styles, $user->prefs->thread_sorting) . "<br>\n    <input type=\"checkbox\" name=\"forum_jump_to_unread\" " . $forum_jump_to_unread . "> " . tra("Jump to first new post in thread automatically") . "<br>\n    <input type=\"checkbox\" name=\"forum_ignore_sticky_posts\" " . $forum_ignore_sticky_posts . ">" . tra("Don't move sticky posts to top") . "<br>\n    ");
}
Esempio n. 3
0
show_forum_header($logged_in_user);
switch ($forum->parent_type) {
    case 0:
        $category = BoincCategory::lookup_id($forum->category);
        show_forum_title($category, $forum, $thread);
        break;
    case 1:
        show_team_forum_title($forum, $thread);
        break;
}
echo "<p>";
if ($preview == tra("Preview")) {
    $options = new output_options();
    echo "<div id=\"preview\">\n";
    echo "<div class=\"header\">" . tra("Preview") . "</div>\n";
    echo output_transform($content, $options);
    echo "</div>\n";
}
start_forum_table(array(tra("Author"), tra("Message")));
show_message_row($thread, $parent_post);
show_posts($thread, $forum, $sort_style, $filter, $logged_in_user, true);
end_table();
page_tail();
function show_message_row($thread, $parent_post)
{
    global $g_logged_in_user;
    global $content;
    global $preview;
    $x1 = "Message:" . html_info() . post_warning();
    $x2 = "";
    if ($parent_post) {
Esempio n. 4
0
    select_profile($option);
    exit;
}
page_head(tra("Profiles"));
echo "\n    <p>" . tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT) . " " . tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.") . "\n    <p>" . tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
start_table_noborder();
$today = getdate(time());
$UOTD_heading = tra("User of the Day") . " -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
row1($UOTD_heading);
echo "<tr><td>";
$profile = get_current_uotd();
if ($profile) {
    $user = BoincUser::lookup_id($profile->userid);
    echo uotd_thumbnail($profile, $user);
    echo user_links($user) . "<br>";
    $resp = output_transform($profile->response1);
    $resp = sanitize_tags($resp);
    echo sub_sentence($resp, ' ', 150, true);
}
echo "</td></tr>";
row1(tra("User Profile Explorer"));
echo "<tr><td>\n    <ul>\n    <li>" . tra("View the %1User Picture Gallery%2.", "<a href=\"" . URL_BASE . "user_profile/user_gallery_1.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1by country%2.", "<a href=\"" . URL_BASE . "user_profile/profile_country.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&amp;pic=-1\">", "</a>", "<a href=\"?cmd=rand&amp;pic=1\">", "<a href=\"?cmd=rand&amp;pic=0\">") . "</li>\n";
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
    echo "<li>" . tra("Alphabetical profile listings:") . "<br>";
    include PROFILE_PATH . "profile_alpha.html";
}
echo "</ul></td></tr>";
row1(tra("Search profile text"));
rowify("\n    <form action=\"profile_search_action.php\" method=\"GET\">\n    <input type=\"text\" name=\"search_string\">\n    <input type=\"submit\" value=\"" . tra("Search") . "\">\n    </form>\n");
end_table();
page_tail();
Esempio n. 5
0
    echo "<span class=error>{$warning}</span><p>";
}
switch ($forum->parent_type) {
    case 0:
        $category = BoincCategory::lookup_id($forum->category);
        show_forum_title($category, $forum, $thread);
        break;
    case 1:
        show_team_forum_title($forum, $thread);
        break;
}
echo "<p>";
if ($preview == tra("Preview")) {
    $options = new output_options();
    echo "<h2>" . tra("Preview") . "</h2>\n";
    echo "<div class=\"pm_preview\">" . output_transform($content, $options) . "</div>\n";
}
start_table();
show_message_row($thread, $parent_post);
end_table();
if ($parent_post) {
    start_forum_table(array(tra("Author"), tra("Message")));
    show_post($parent_post, $thread, $forum, $logged_in_user, 0, 0, false, false);
    end_table();
} else {
    show_posts($thread, $forum, 0, 0, CREATE_TIME_NEW, 0, $logged_in_user);
}
end_table();
page_tail();
function show_message_row($thread, $parent_post)
{
}
row1("Message-board identity");
row2("Avatar\r\n\t<br><span class=\"note\">An image representing you on the message boards.\r\n\t<br>Format: JPG or PNG. Size: at most 4 KB, 100x100 pixels</span>", "<input type=\"radio\" id=\"avatar_select_0\" name=\"avatar_select\" value=\"0\" " . $select_0 . ">\r\n\t\t<label for=\"avatar_select_0\">Don't use an avatar</label><br>\r\n\t<input type=\"radio\" id=\"avatar_select_1\" name=\"avatar_select\" value=\"1\" " . $select_1 . ">\r\n\t\t<label for=\"avatar_select_1\">Use a Globally Recognized Avatar provided by <a href=\"http://gravatar.com\">Gravatar.com</a></label><br>\r\n\t<input type=\"radio\" id=\"avatar_select_2\" name=\"avatar_select\" value=\"2\" " . $select_2 . ">\r\n\t\t<label for=\"avatar_select_2\">Use this uploaded avatar:</label> <input type=\"file\" name=\"picture\">");
if (strlen($user->prefs->avatar)) {
    row2("Avatar preview<br><span class=\"note\">This is how your avatar will look</span>", "<img src=\"" . $user->prefs->avatar . "\" width=\"100\" height=\"100\">");
}
if (!$user->prefs->no_signature_by_default) {
    $signature_by_default = "checked=\"checked\"";
} else {
    $signature_by_default = "";
}
$signature = $user->prefs->signature;
$maxlen = 250;
row2("Signature for message board posts" . html_info() . "<br><br>Check out <a href=http://boinc.berkeley.edu/links.php#sigs>various free services</a>\r\n\t<br> providing dynamic 'signature images'\r\n\t<br> showing your latest credit info, project news, etc.", "<textarea name=\"signature\" rows=4 cols=50 id=\"signature\" onkeydown=\"textCounter(this.form.signature, this.form.remLen,{$maxlen});\"\r\n\tonkeyup=\"textCounter(this.form.signature, this.form.remLen,250);\">" . $signature . "</textarea>\r\n\t<br><input name=\"remLen\" type=\"text\" id=\"remLen\" value=\"" . ($maxlen - strlen($signature)) . "\" size=\"3\" maxlength=\"3\" readonly> chars remaining\r\n\t<br><input type=\"checkbox\" name=\"signature_by_default\" " . $signature_by_default . "> Attach signature by default ");
if ($user->prefs->signature != "") {
    row2("Signature preview" . "<br><span class=note>This is how your signature will look in the forums</span>", output_transform($user->prefs->signature));
}
// ------------ Message display  -----------
if ($user->prefs->hide_avatars) {
    $forum_hide_avatars = "checked=\"checked\"";
} else {
    $forum_hide_avatars = "";
}
if ($user->prefs->hide_signatures) {
    $forum_hide_signatures = "checked=\"checked\"";
} else {
    $forum_hide_signatures = "";
}
if ($user->prefs->link_popup) {
    $forum_link_popup = "checked=\"checked\"";
} else {
Esempio n. 7
0
    select_profile($option);
    exit;
}
page_head(tra("Profiles"));
echo "\n    <p>" . tra("%1Profiles%2 let individuals share backgrounds and opinions with the %3 community.", "<b>", "</b>", PROJECT) . " " . tra("Explore the diversity of your fellow volunteers, and contribute your own views for others to enjoy.") . "\n    <p>" . tra("If you haven't already, you can %1create your own user profile%2 for others to see!", "<a href=\"create_profile.php\">", "</a>");
start_table_noborder();
$today = getdate(time());
$UOTD_heading = tra("User of the Day") . " -- " . $today['month'] . " " . $today['mday'] . ", " . $today['year'];
row1($UOTD_heading);
echo "<tr><td>";
$profile = get_current_uotd();
if ($profile) {
    $user = lookup_user_id($profile->userid);
    echo uotd_thumbnail($profile, $user);
    echo user_links($user) . "<br>";
    echo sub_sentence(output_transform(sanitize_tags($profile->response1)), ' ', 150, true);
}
echo "</td></tr>";
row1(tra("User Profile Explorer"));
echo "<tr><td>\n    <ul>\n    <li>" . tra("View the %1User Picture Gallery%2.", "<a href=\"" . URL_BASE . "user_profile/user_gallery_1.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1by country%2.", "<a href=\"" . URL_BASE . "user_profile/profile_country.html\">", "</a>") . "</li>\n    <li>" . tra("Browse profiles %1at random%2, %3at random with pictures%2, or %4at random without pictures%2.", "<a href=\"?cmd=rand&amp;pic=-1\">", "</a>", "<a href=\"?cmd=rand&amp;pic=1\">", "<a href=\"?cmd=rand&amp;pic=0\">") . "</li>\n";
if (file_exists(PROFILE_PATH . "profile_alpha.html")) {
    echo "<li>" . tra("Alphabetical profile listings:") . "<br>";
    include PROFILE_PATH . "profile_alpha.html";
}
echo "</ul></td></tr>";
row1(tra("Search profile text"));
rowify("\n    <form action=\"profile_search_action.php\" method=\"GET\">\n    <input type=\"text\" name=\"search_string\">\n    <input type=\"submit\" value=\"" . tra("Search") . "\">\n    </form>\n");
end_table();
page_tail();
function select_profile($cmd)
{