2004-09-04 23:37:49 +00:00
< ? php
2008-08-05 22:43:14 +00:00
// This file is part of BOINC.
// http://boinc.berkeley.edu
// Copyright (C) 2008 University of California
//
// BOINC is free software; you can redistribute it and/or modify it
// under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation,
// either version 3 of the License, or (at your option) any later version.
//
// BOINC is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
// See the GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
2004-09-04 23:37:49 +00:00
2007-11-13 17:18:34 +00:00
// This provides the form from which the user can edit his or her
// forum preferences. It relies upon edit_forum_preferences_action.php
// to do anything.
2004-09-04 23:37:49 +00:00
2011-02-09 22:11:34 +00:00
require_once ( " ../inc/util.inc " );
2007-11-13 17:18:34 +00:00
require_once ( " ../inc/forum.inc " );
2006-08-22 09:25:30 +00:00
2011-02-09 22:11:34 +00:00
check_get_args ( array ());
2007-11-13 17:18:34 +00:00
$user = get_logged_in_user ();
BoincForumPrefs :: lookup ( $user );
2004-09-04 23:37:49 +00:00
2011-08-25 22:12:48 +00:00
page_head ( tra ( " Community preferences " ));
2007-11-20 19:23:26 +00:00
2014-08-11 22:45:13 +00:00
text_counter_script ();
2004-09-04 23:37:49 +00:00
2009-02-17 17:39:57 +00:00
start_table ();
2009-03-01 23:32:15 +00:00
echo " <form method= \" post \" action= \" edit_forum_preferences_action.php \" enctype= \" multipart/form-data \" > " ;
2007-11-26 03:05:27 +00:00
2007-12-30 22:02:16 +00:00
// ------------ Notification -----------
2011-08-25 22:12:48 +00:00
row1 ( tra ( " Notifications " ));
2007-12-30 22:02:16 +00:00
$ch0 = $user -> prefs -> pm_notification == 0 ? " checked " : " " ;
$ch1 = $user -> prefs -> pm_notification == 1 ? " checked " : " " ;
$ch2 = $user -> prefs -> pm_notification == 2 ? " checked " : " " ;
row2 (
2011-08-25 22:12:48 +00:00
tra ( " How should we notify you of new private messages, friend requests, posts in subscribed threads, and other events? " ),
" <input type=radio name=pm_notification value=0 $ch0 > " . tra ( " On my Account page (no email) " ) . "
< br >< input type = radio name = pm_notification value = 1 $ch1 > " .tra( " Immediately , by email " ). "
< br >< input type = radio name = pm_notification value = 2 $ch2 > " .tra( " In a single daily email " ). "
2007-12-30 22:02:16 +00:00
"
);
2014-04-18 22:54:28 +00:00
if ( ! DISABLE_FORUMS ) {
2007-12-30 22:02:16 +00:00
// ------------ Forum identity -----------
2008-07-19 17:31:10 +00:00
$select_0 = $select_1 = $select_2 = " " ;
2007-11-13 17:18:34 +00:00
if ( strlen ( $user -> prefs -> avatar )){
2008-07-19 17:31:10 +00:00
if ( substr ( $user -> prefs -> avatar , 0 , 4 ) == 'http' ) { // Gravatar
$select_1 = " checked= \" true \" " ;
} else {
$select_2 = " checked= \" true \" " ;
}
2006-08-22 09:25:30 +00:00
} else {
2008-07-19 17:31:10 +00:00
$select_0 = " checked= \" true \" " ;
2004-09-04 23:37:49 +00:00
}
2011-08-25 22:12:48 +00:00
row1 ( tra ( " Message-board identity " ));
row2 ( tra ( " Avatar " ) . "
2014-10-02 19:15:54 +00:00
< br >< p class = \ " text-muted \" > " . tra ( " An image representing you on the message boards. " ) . "
< br > " .tra( " Format : JPG or PNG . Size : at most 4 KB , 100 x100 pixels " ). " </ p > " ,
2008-07-19 17:31:10 +00:00
" <input type= \" radio \" id= \" avatar_select_0 \" name= \" avatar_select \" value= \" 0 \" " . $select_0 . " >
2011-08-25 22:12:48 +00:00
< label for = \ " avatar_select_0 \" > " . tra ( " Don't use an avatar " ) . " </label><br>
2008-07-19 17:31:10 +00:00
< input type = \ " radio \" id= \" avatar_select_1 \" name= \" avatar_select \" value= \" 1 \" " . $select_1 . " >
2011-08-25 22:12:48 +00:00
< label for = \ " avatar_select_1 \" > " . tra ( " Use a Globally Recognized Avatar provided by %1 " , " <a href= \" http://gravatar.com \" >Gravatar.com</a> " ) . " </label><br>
2008-07-19 17:31:10 +00:00
< input type = \ " radio \" id= \" avatar_select_2 \" name= \" avatar_select \" value= \" 2 \" " . $select_2 . " >
2011-08-25 22:12:48 +00:00
< label for = \ " avatar_select_2 \" > " . tra ( " Use this uploaded avatar: " ) . " </label> <input type= \" file \" name= \" picture \" > "
2004-09-04 23:37:49 +00:00
);
2007-11-13 17:18:34 +00:00
if ( strlen ( $user -> prefs -> avatar )){
2014-10-02 19:15:54 +00:00
row2 ( tra ( " Avatar preview " ) . " <br><p class= \" text-muted \" > " . tra ( " This is how your avatar will look " ) . " </p> " ,
2007-11-13 17:18:34 +00:00
" <img src= \" " . $user -> prefs -> avatar . " \" width= \" 100 \" height= \" 100 \" > " );
2004-09-14 21:29:52 +00:00
}
2011-08-25 22:12:48 +00:00
$signature_by_default = $user -> prefs -> no_signature_by_default == false ? " checked= \" checked \" " : " " ;
2008-06-05 20:32:21 +00:00
$signature = $user -> prefs -> signature ;
2007-11-26 00:51:00 +00:00
$maxlen = 250 ;
row2 (
2011-08-25 22:12:48 +00:00
tra ( " Signature for message board posts " )
2009-03-01 19:00:40 +00:00
. html_info ()
2011-08-25 22:12:48 +00:00
. " <br><br> "
. tra ( " Check out %1various free services%2
< br > providing dynamic 'signature images'
< br > showing your latest credit info , project news , etc . " , " < a href = http :// boinc . berkeley . edu / links . php #sigs>", "</a>"),
2014-08-11 22:45:13 +00:00
textarea_with_counter ( " signature " , 250 , $signature )
. " <br><input type= \" checkbox \" name= \" signature_by_default \" " . $signature_by_default . " > " . tra ( " Attach signature by default " )
2007-11-26 00:51:00 +00:00
);
if ( $user -> prefs -> signature != " " ){
2011-08-25 22:12:48 +00:00
row2 ( tra ( " Signature preview " ) .
2014-10-02 19:15:54 +00:00
" <br><p class= \" text-muted \" > " . tra ( " This is how your signature will look in the forums " ) . " </p> " ,
2007-11-26 00:51:00 +00:00
output_transform ( $user -> prefs -> signature )
);
}
2007-12-30 22:02:16 +00:00
// ------------ Message display -----------
2007-11-26 00:51:00 +00:00
2011-08-25 22:12:48 +00:00
$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 \" " : " " ;
2004-09-04 23:37:49 +00:00
2007-11-20 19:23:26 +00:00
$forum_minimum_wrap_postcount = intval ( $user -> prefs -> minimum_wrap_postcount );
$forum_display_wrap_postcount = intval ( $user -> prefs -> display_wrap_postcount );
2005-11-24 16:36:12 +00:00
2011-08-25 22:12:48 +00:00
row1 ( tra ( " Message display " ));
2006-08-22 09:25:30 +00:00
row2 (
2011-08-25 22:12:48 +00:00
tra ( " What to display " ),
" <input type= \" checkbox \" name= \" forum_hide_avatars \" " . $forum_hide_avatars . " > " . tra ( " Hide avatar images " ) . " <br>
< input type = \ " checkbox \" name= \" forum_hide_signatures \" " . $forum_hide_signatures . " > " . tra ( " Hide signatures " ) . " <br>
< input type = \ " checkbox \" name= \" forum_images_as_links \" " . $forum_image_as_link . " > " . tra ( " Show images as links " ) . " <br>
< input type = \ " checkbox \" name= \" forum_link_popup \" " . $forum_link_popup . " > " . tra ( " Open links in new window/tab " ) . " <br>
< input type = \ " checkbox \" name= \" forum_highlight_special \" " . $forum_highlight_special . " > " . tra ( " Highlight special users " ) . " <br>
2012-07-11 05:27:31 +00:00
< input type = \ " text \" name= \" forum_display_wrap_postcount \" size=3 value= \" " . $forum_display_wrap_postcount . " \" > " . tra ( " Display this many messages per page " ) . " <br />
2007-11-29 16:47:56 +00:00
"
);
2011-08-25 22:12:48 +00:00
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>
< input type = \ " checkbox \" name= \" forum_jump_to_unread \" " . $forum_jump_to_unread . " > " . tra ( " Jump to first new post in thread automatically " ) . " <br>
2012-07-11 05:27:31 +00:00
< input type = \ " checkbox \" name= \" forum_ignore_sticky_posts \" " . $forum_ignore_sticky_posts . " > " . tra ( " Don't move sticky posts to top " ) . " <br>
2007-11-26 00:51:00 +00:00
"
2004-09-04 23:37:49 +00:00
);
2014-04-18 22:54:28 +00:00
} // DISABLE_FORUMS
2004-09-04 23:37:49 +00:00
2007-12-30 22:02:16 +00:00
// ------------ Message filtering -----------
2011-08-25 22:12:48 +00:00
row1 ( tra ( " Message filtering " ));
2007-11-26 00:51:00 +00:00
2007-11-13 17:18:34 +00:00
$filtered_userlist = get_ignored_list ( $user );
2007-11-26 03:05:27 +00:00
$forum_filtered_userlist = " " ;
2007-11-13 17:18:34 +00:00
for ( $i = 0 ; $i < sizeof ( $filtered_userlist ); $i ++ ){
2007-11-23 00:19:48 +00:00
$id = ( int ) $filtered_userlist [ $i ];
if ( $id ) {
$filtered_user = BoincUser :: lookup_id ( $id );
if ( ! $filtered_user ) {
echo " Missing user $id " ;
2007-11-13 17:18:34 +00:00
continue ;
}
2014-10-02 19:15:54 +00:00
$forum_filtered_userlist .= " <input class= \" btn btn-default \" type= \" submit \" name= \" remove " . $filtered_user -> id . " \" value= \" " . tra ( " Remove " ) . " \" > " . $filtered_user -> id . " - " . user_links ( $filtered_user ) . " <br> " ;
2006-08-22 09:25:30 +00:00
}
2005-01-06 11:47:44 +00:00
}
2010-09-20 23:59:25 +00:00
2011-08-25 22:12:48 +00:00
row2 ( tra ( " Filtered users " ) .
2014-10-02 19:15:54 +00:00
" <br><p class= \" text-muted \" > " . tra ( " Ignore message board posts and private messages from these users. " ) . " </p> " ,
2007-11-14 23:22:01 +00:00
" $forum_filtered_userlist
2011-08-25 22:12:48 +00:00
< input type = \ " text \" name= \" forum_filter_user \" size=12> " . tra ( " User ID (For instance: 123456789) " ) . "
2014-10-02 19:15:54 +00:00
< br >< input class = \ " btn btn-default \" type= \" submit \" name= \" add_user_to_filter \" value= \" " . tra ( " Add user to filter " ) . " \" >
2005-01-06 11:47:44 +00:00
"
);
2011-08-25 22:12:48 +00:00
row1 ( tra ( " Update " ));
2014-10-02 19:15:54 +00:00
row2 ( tra ( " Click here to update preferences " ), " <input class= \" btn btn-primary \" type=submit value= \" " . tra ( " Update " ) . " \" > " );
2009-03-01 23:32:15 +00:00
echo " </form> \n " ;
2011-08-25 22:12:48 +00:00
row1 ( tra ( " Reset " ));
row2 ( tra ( " Or click here to reset preferences to the defaults " ),
2014-10-02 19:15:54 +00:00
" <form method= \" post \" action= \" edit_forum_preferences_action.php \" ><input class= \" btn btn-warning \" type= \" submit \" value= \" " . tra ( " Reset " ) . " \" ><input type= \" hidden \" name= \" action \" value= \" reset_confirm \" ></form> "
2007-11-26 00:51:00 +00:00
);
2004-12-14 02:54:29 +00:00
end_table ();
2004-09-04 23:37:49 +00:00
page_tail ();
2007-11-13 17:18:34 +00:00
$cvs_version_tracker [] = " \$ Id $ " ; //Generated automatically - do not edit
2005-01-30 20:15:18 +00:00
?>