Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: usercp.php 5142 2010-07-29 23:36:56Z RyanGordon $
| * $Id: usercp.php 5616 2011-09-20 13:24:59Z Tomm $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 402 | Zeile 402 |
---|
$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder')); while($profilefield = $db->fetch_array($query)) {
|
$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder')); while($profilefield = $db->fetch_array($query)) {
|
| // Does this field have a minimum post count? if($profilefield['postnum'] && $profilefield['postnum'] > $user['postnum']) { continue; }
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
|
| $profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
|
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']); $thing = explode("\n", $profilefield['type'], "2"); $type = $thing[0];
| $profilefield['description'] = htmlspecialchars_uni($profilefield['description']); $thing = explode("\n", $profilefield['type'], "2"); $type = $thing[0];
|
Zeile 410 | Zeile 417 |
---|
$field = "fid{$profilefield['fid']}"; $select = ''; if($errors)
|
$field = "fid{$profilefield['fid']}"; $select = ''; if($errors)
|
{
| {
|
$userfield = $mybb->input['profile_fields'][$field];
|
$userfield = $mybb->input['profile_fields'][$field];
|
}
| }
|
else { $userfield = $user[$field]; } if($type == "multiselect")
|
else { $userfield = $user[$field]; } if($type == "multiselect")
|
{ if($errors) { $useropts = $userfield; } else {
| { if($errors) { $useropts = $userfield; } else {
|
$useropts = explode("\n", $userfield);
|
$useropts = explode("\n", $userfield);
|
}
| }
|
if(is_array($useropts))
|
if(is_array($useropts))
|
{
| {
|
foreach($useropts as $key => $val)
|
foreach($useropts as $key => $val)
|
{
| {
|
$val = htmlspecialchars_uni($val);
|
$val = htmlspecialchars_uni($val);
|
$seloptions[$val] = $val; } } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if($val == $seloptions[$val]) {
| $seloptions[$val] = $val; } } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if($val == $seloptions[$val]) {
|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>\n"; } if(!$profilefield['length'])
|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>\n"; } if(!$profilefield['length'])
|
{
| {
|
$profilefield['length'] = 3; } $code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";
| $profilefield['length'] = 3; } $code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";
|
Zeile 467 | Zeile 474 |
---|
$val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
|
$val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
|
if($val == htmlspecialchars_uni($userfield))
| if($val == htmlspecialchars_uni($userfield))
|
{ $sel = " selected=\"selected\""; }
| { $sel = " selected=\"selected\""; }
|
Zeile 509 | Zeile 516 |
---|
if(is_array($useropts)) { foreach($useropts as $key => $val)
|
if(is_array($useropts)) { foreach($useropts as $key => $val)
|
{ $seloptions[$val] = $val;
| { $seloptions[$val] = $val;
|
} } $expoptions = explode("\n", $options);
| } } $expoptions = explode("\n", $options);
|
Zeile 531 | Zeile 538 |
---|
{ $value = htmlspecialchars_uni($userfield); $code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";
|
{ $value = htmlspecialchars_uni($userfield); $code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>";
|
} else
| } else
|
{ $value = htmlspecialchars_uni($userfield); $maxlength = "";
| { $value = htmlspecialchars_uni($userfield); $maxlength = "";
|
Zeile 576 | Zeile 583 |
---|
{ $defaulttitle = $mybb->usergroup['usertitle']; }
|
{ $defaulttitle = $mybb->usergroup['usertitle']; }
|
if(empty($user['usertitle']))
| if(trim($user['usertitle']) == '')
|
{ $lang->current_custom_usertitle = ''; }
| { $lang->current_custom_usertitle = ''; }
|
Zeile 1176 | Zeile 1184 |
---|
if($mybb->input['action'] == "subscriptions") { $plugins->run_hooks("usercp_subscriptions_start");
|
if($mybb->input['action'] == "subscriptions") { $plugins->run_hooks("usercp_subscriptions_start");
|
| // Thread visiblity $visible = "AND t.visible != 0"; if(is_moderator() == true) { $visible = ''; }
|
// Do Multi Pages
|
// Do Multi Pages
|
$query = $db->simple_select("threadsubscriptions", "COUNT(tid) AS threads", "uid='".$mybb->user['uid']."'");
| $query = $db->query(" SELECT COUNT(ts.tid) as threads FROM ".TABLE_PREFIX."threadsubscriptions ts LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = ts.tid) WHERE ts.uid = '".$mybb->user['uid']."' {$visible} ");
|
$threadcount = $db->fetch_field($query, "threads");
if(!$mybb->settings['threadsperpage'])
| $threadcount = $db->fetch_field($query, "threads");
if(!$mybb->settings['threadsperpage'])
|
Zeile 1214 | Zeile 1234 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
|
WHERE s.uid='".$mybb->user['uid']."'
| WHERE s.uid='".$mybb->user['uid']."' {$visible}
|
ORDER BY t.lastpost DESC LIMIT $start, $perpage "); while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
ORDER BY t.lastpost DESC LIMIT $start, $perpage "); while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
// Only keep if we're allowed to view them if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0) { $subscriptions[$subscription['tid']] = $subscription;
| if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { // Hmm, you don't have permission to view this thread - unsubscribe! $del_subscriptions[] = $subscription['tid'];
|
}
|
}
|
// Hmm, you don't have permission to view - unsubscribe!
| |
else if($subscription['tid']) {
|
else if($subscription['tid']) {
|
$del_subscriptions[] = $subscription['tid'];
| $subscriptions[$subscription['tid']] = $subscription;
|
} }
| } }
|
Zeile 1334 | Zeile 1354 |
---|
else { $icon = " ";
|
else { $icon = " ";
|
}
| }
|
// Determine the folder $folder = ''; $folder_label = '';
if($thread['doticon'])
|
// Determine the folder $folder = ''; $folder_label = '';
if($thread['doticon'])
|
{
| {
|
$folder = "dot_"; $folder_label .= $lang->icon_dot;
|
$folder = "dot_"; $folder_label .= $lang->icon_dot;
|
}
| }
|
$gotounread = ''; $isnew = 0; $donenew = 0; $lastread = 0;
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
|
$gotounread = ''; $isnew = 0; $donenew = 0; $lastread = 0;
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid'])
|
{
| {
|
$forum_read = $readforums[$thread['fid']]; $read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
| $forum_read = $readforums[$thread['fid']]; $read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
|
Zeile 1360 | Zeile 1380 |
---|
{ $forum_read = $read_cutoff; }
|
{ $forum_read = $read_cutoff; }
|
}
| }
|
else { $forum_read = $forumsread[$thread['fid']];
|
else { $forum_read = $forumsread[$thread['fid']];
|
}
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read) {
| }
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read) {
|
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
|
$cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
|
}
| }
|
if($thread['lastpost'] > $cutoff)
|
if($thread['lastpost'] > $cutoff)
|
{ if($thread['lastpost'] > $cutoff) { if($thread['lastread']) { $lastread = $thread['lastread']; } else { $lastread = 1; } }
| { if($thread['lastread']) { $lastread = $thread['lastread']; } else { $lastread = 1; }
|
}
if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']); if($readcookie > $forum_read)
|
}
if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']); if($readcookie > $forum_read)
|
{
| {
|
$lastread = $readcookie; } else { $lastread = $forum_read; }
|
$lastread = $readcookie; } else { $lastread = $forum_read; }
|
}
if($thread['lastpost'] > $lastread && $lastread)
| }
if($lastread && $lastread < $thread['lastpost'])
|
{ $folder .= "new"; $folder_label .= $lang->icon_new;
| { $folder .= "new"; $folder_label .= $lang->icon_new;
|
Zeile 1407 | Zeile 1424 |
---|
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
}
| }
|
else { $folder_label .= $lang->icon_no_new;
| else { $folder_label .= $lang->icon_no_new;
|
Zeile 1418 | Zeile 1435 |
---|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
}
| }
|
if($thread['closed'] == 1) {
| if($thread['closed'] == 1) {
|
Zeile 1427 | Zeile 1444 |
---|
}
$folder .= "folder";
|
}
$folder .= "folder";
|
| if($thread['visible'] == 0) { $bgcolor = "trow_shaded"; }
|
// Build last post info
|
// Build last post info
|
| |
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter'];
| $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter'];
|
Zeile 1632 | Zeile 1653 |
---|
$template = false; }
|
$template = false; }
|
if(!$mybb->user['signature'] && ($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW))
| if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
|
{ // User currently has no signature and they're suspended
|
{ // User currently has no signature and they're suspended
|
| error($lang->sig_suspended); }
if($mybb->usergroup['canusesig'] != 1) { // Usergroup has no permission to use this facility
|
error_no_permission();
|
error_no_permission();
|
| } else if($mybb->usergroup['canusesig'] == 1 && $mybb->usergroup['canusesigxposts'] > 0 && $mybb->user['postnum'] < $mybb->usergroup['canusesigxposts']) { // Usergroup can use this facility, but only after x posts error($lang->sprintf($lang->sig_suspended_posts, $mybb->usergroup['canusesigxposts']));
|
}
if($sig && $template)
|
}
if($sig && $template)
|
{
| {
|
$sig_parser = array( "allow_html" => $mybb->settings['sightml'], "allow_mycode" => $mybb->settings['sigmycode'],
| $sig_parser = array( "allow_html" => $mybb->settings['sightml'], "allow_mycode" => $mybb->settings['sigmycode'],
|
Zeile 1647 | Zeile 1679 |
---|
"allow_imgcode" => $mybb->settings['sigimgcode'], "me_username" => $mybb->user['username'], );
|
"allow_imgcode" => $mybb->settings['sigimgcode'], "me_username" => $mybb->user['username'], );
|
|
|
$sigpreview = $parser->parse_message($sig, $sig_parser); eval("\$signature = \"".$templates->get($template)."\";"); }
| $sigpreview = $parser->parse_message($sig, $sig_parser); eval("\$signature = \"".$templates->get($template)."\";"); }
|
Zeile 1667 | Zeile 1699 |
---|
{ $sigsmilies = $lang->on; $smilieinserter = build_clickable_smilies();
|
{ $sigsmilies = $lang->on; $smilieinserter = build_clickable_smilies();
|
}
| }
|
else { $sigsmilies = $lang->off;
| else { $sigsmilies = $lang->off;
|
Zeile 1675 | Zeile 1707 |
---|
if($mybb->settings['sigmycode'] == 1) { $sigmycode = $lang->on;
|
if($mybb->settings['sigmycode'] == 1) { $sigmycode = $lang->on;
|
} else
| } else
|
{ $sigmycode = $lang->off; } if($mybb->settings['sightml'] == 1) { $sightml = $lang->on;
|
{ $sigmycode = $lang->off; } if($mybb->settings['sightml'] == 1) { $sightml = $lang->on;
|
} else
| } else
|
{ $sightml = $lang->off; }
| { $sightml = $lang->off; }
|
Zeile 1700 | Zeile 1732 |
---|
$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
if($mybb->settings['bbcodeinserter'] != 0 || $mybb->user['showcodebuttons'] != 0)
|
$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
if($mybb->settings['bbcodeinserter'] != 0 || $mybb->user['showcodebuttons'] != 0)
|
{
| {
|
$codebuttons = build_mycode_inserter("signature"); }
| $codebuttons = build_mycode_inserter("signature"); }
|
Zeile 1763 | Zeile 1795 |
---|
"avatartype" => "gallery" ); $db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
|
"avatartype" => "gallery" ); $db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
|
} remove_avatars($mybb->user['uid']); }
| } remove_avatars($mybb->user['uid']); }
|
} elseif($_FILES['avatarupload']['name']) // upload avatar {
| } elseif($_FILES['avatarupload']['name']) // upload avatar {
|
Zeile 1895 | Zeile 1927 |
---|
// Check to see if we're in a gallery or not if($activegallery)
|
// Check to see if we're in a gallery or not if($activegallery)
|
{
| {
|
$gallery = str_replace("..", "", $mybb->input['gallery']); $lang->avatars_in_gallery = $lang->sprintf($lang->avatars_in_gallery, $activegallery); // Get a listing of avatars in this gallery
| $gallery = str_replace("..", "", $mybb->input['gallery']); $lang->avatars_in_gallery = $lang->sprintf($lang->avatars_in_gallery, $activegallery); // Get a listing of avatars in this gallery
|
Zeile 1988 | Zeile 2020 |
---|
$colspan = 2; } if($mybb->settings['maxavatardims'] != "")
|
$colspan = 2; } if($mybb->settings['maxavatardims'] != "")
|
{
| {
|
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims'])); $lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight); } if($mybb->settings['avatarsize'])
|
list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims'])); $lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight); } if($mybb->settings['avatarsize'])
|
{
| {
|
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024); $lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_size, $maxsize); } if($mybb->settings['avatarresizing'] == "auto")
|
$maxsize = get_friendly_size($mybb->settings['avatarsize']*1024); $lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_size, $maxsize); } if($mybb->settings['avatarresizing'] == "auto")
|
{
| {
|
$auto_resize = "<br /><span class=\"smalltext\">{$lang->avatar_auto_resize_note}</span>\n";
|
$auto_resize = "<br /><span class=\"smalltext\">{$lang->avatar_auto_resize_note}</span>\n";
|
}
| }
|
else if($mybb->settings['avatarresizing'] == "user") { $auto_resize = "<br /><span class=\"smalltext\"><input type=\"checkbox\" name=\"auto_resize\" value=\"1\" checked=\"checked\" id=\"auto_resize\" /> <label for=\"auto_resize\">{$lang->avatar_auto_resize_option}</label></span>";
|
else if($mybb->settings['avatarresizing'] == "user") { $auto_resize = "<br /><span class=\"smalltext\"><input type=\"checkbox\" name=\"auto_resize\" value=\"1\" checked=\"checked\" id=\"auto_resize\" /> <label for=\"auto_resize\">{$lang->avatar_auto_resize_option}</label></span>";
|
}
| }
|
$plugins->run_hooks("usercp_avatar_end");
| $plugins->run_hooks("usercp_avatar_end");
|
Zeile 2032 | Zeile 2064 |
---|
if($mybb->user['buddylist']) { // Create a list of buddies...
|
if($mybb->user['buddylist']) { // Create a list of buddies...
|
$selected_list = explode(",", $mybb->user['buddylist']); } } else
| $selected_list = explode(",", $mybb->user['buddylist']); } } else
|
{ if($mybb->user['buddylist']) {
| { if($mybb->user['buddylist']) {
|
Zeile 2127 | Zeile 2159 |
---|
}
if($adding_self == true)
|
}
if($adding_self == true)
|
{
| {
|
if($mybb->input['manage'] == "ignored") { $error_message = $lang->cant_add_self_to_ignore_list;
|
if($mybb->input['manage'] == "ignored") { $error_message = $lang->cant_add_self_to_ignore_list;
|
} else
| } else
|
{ $error_message = $lang->cant_add_self_to_buddy_list; }
| { $error_message = $lang->cant_add_self_to_buddy_list; }
|
Zeile 2148 | Zeile 2180 |
---|
if($error_message) { $error_message .= "<br />";
|
if($error_message) { $error_message .= "<br />";
|
}
| }
|
$error_message .= $lang->invalid_user_selected; } }
| $error_message .= $lang->invalid_user_selected; } }
|
Zeile 2166 | Zeile 2198 |
---|
if($mybb->input['manage'] == "ignored") { $message = $lang->removed_from_ignore_list;
|
if($mybb->input['manage'] == "ignored") { $message = $lang->removed_from_ignore_list;
|
}
| }
|
else { $message = $lang->removed_from_buddy_list; } $message = $lang->sprintf($message, $user['username']);
|
else { $message = $lang->removed_from_buddy_list; } $message = $lang->sprintf($message, $user['username']);
|
} }
| } }
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $existing_users);
| // Now we have the new list, so throw it all back together $new_list = implode(",", $existing_users);
|
Zeile 2266 | Zeile 2298 |
---|
}
if($mybb->input['action'] == "editlists")
|
}
if($mybb->input['action'] == "editlists")
|
{
| {
|
$plugins->run_hooks("usercp_editlists_start");
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];
| $plugins->run_hooks("usercp_editlists_start");
$timecut = TIME_NOW - $mybb->settings['wolcutoff'];
|
Zeile 2406 | Zeile 2438 |
---|
} if($mybb->input['action'] == "do_drafts" && $mybb->request_method == "post")
|
} if($mybb->input['action'] == "do_drafts" && $mybb->request_method == "post")
|
{
| {
|
// Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
| // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
Zeile 2545 | Zeile 2577 |
---|
$plugins->run_hooks("usercp_usergroups_join_group_request"); redirect("usercp.php?action=usergroups", $lang->group_join_requestsent); exit;
|
$plugins->run_hooks("usercp_usergroups_join_group_request"); redirect("usercp.php?action=usergroups", $lang->group_join_requestsent); exit;
|
}
| }
|
elseif($usergroup['type'] == 4) { $joingroup = $mybb->input['joingroup'];
| elseif($usergroup['type'] == 4) { $joingroup = $mybb->input['joingroup'];
|
Zeile 2638 | Zeile 2670 |
---|
elseif($usergroup['candisplaygroup'] == 1) { $displaycode = " (<a href=\"usercp.php?action=usergroups&displaygroup={$usergroup['gid']}&my_post_key={$mybb->post_code}\">{$lang->set_as_display_group}</a>)";
|
elseif($usergroup['candisplaygroup'] == 1) { $displaycode = " (<a href=\"usercp.php?action=usergroups&displaygroup={$usergroup['gid']}&my_post_key={$mybb->post_code}\">{$lang->set_as_display_group}</a>)";
|
}
| }
|
else { $displaycode = '';
| else { $displaycode = '';
|
Zeile 2656 | Zeile 2688 |
---|
if($groupleader[$usergroup['gid']]) { $leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">$lang->usergroup_leave_leader</span></div>";
|
if($groupleader[$usergroup['gid']]) { $leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">$lang->usergroup_leave_leader</span></div>";
|
}
| }
|
elseif($usergroup['type'] != 4 && $usergroup['type'] != 3)
|
elseif($usergroup['type'] != 4 && $usergroup['type'] != 3)
|
{
| {
|
$leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">{$lang->usergroup_cannot_leave}</span></div>";
|
$leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">{$lang->usergroup_cannot_leave}</span></div>";
|
} else {
| } else {
|
$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."&my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>"; } if($usergroup['description']) { $description = "<br /><span class=\"smalltext\">".$usergroup['description']."</span>";
|
$leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."&my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>"; } if($usergroup['description']) { $description = "<br /><span class=\"smalltext\">".$usergroup['description']."</span>";
|
}
| }
|
else { $description = ''; } if(!$usergroup['usertitle'])
|
else { $description = ''; } if(!$usergroup['usertitle'])
|
{
| {
|
// fetch title here } $trow = alt_trow();
| // fetch title here } $trow = alt_trow();
|
Zeile 2685 | Zeile 2717 |
---|
elseif($usergroup['candisplaygroup'] == 1) { $displaycode = "(<a href=\"usercp.php?action=usergroups&displaygroup={$usergroup['gid']}&my_post_key={$mybb->post_code}\">{$lang->set_as_display_group}</a>)";
|
elseif($usergroup['candisplaygroup'] == 1) { $displaycode = "(<a href=\"usercp.php?action=usergroups&displaygroup={$usergroup['gid']}&my_post_key={$mybb->post_code}\">{$lang->set_as_display_group}</a>)";
|
}
| }
|
else { $displaycode = ''; } eval("\$memberoflist .= \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");
|
else { $displaycode = ''; } eval("\$memberoflist .= \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";");
|
}
| }
|
} eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");
| } eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");
|
Zeile 2708 | Zeile 2740 |
---|
{ $existinggroups .= ",".$mybb->user['additionalgroups']; }
|
{ $existinggroups .= ",".$mybb->user['additionalgroups']; }
|
|
|
$joinablegroups = ''; $query = $db->simple_select("usergroups", "*", "(type='3' OR type='4') AND gid NOT IN ($existinggroups)", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
| $joinablegroups = ''; $query = $db->simple_select("usergroups", "*", "(type='3' OR type='4') AND gid NOT IN ($existinggroups)", array('order_by' => 'title')); while($usergroup = $db->fetch_array($query))
|
Zeile 2731 | Zeile 2763 |
---|
else { $conditions = $lang->usergroup_joins_anyone;
|
else { $conditions = $lang->usergroup_joins_anyone;
|
}
| }
|
if($appliedjoin[$usergroup['gid']]) {
| if($appliedjoin[$usergroup['gid']]) {
|
Zeile 2742 | Zeile 2774 |
---|
else { $joinlink = "<a href=\"usercp.php?action=usergroups&joingroup={$usergroup['gid']}&my_post_key={$mybb->post_code}\">{$lang->join_group}</a>";
|
else { $joinlink = "<a href=\"usercp.php?action=usergroups&joingroup={$usergroup['gid']}&my_post_key={$mybb->post_code}\">{$lang->join_group}</a>";
|
}
| }
|
$usergroupleaders = ''; if($groupleaders[$usergroup['gid']])
| $usergroupleaders = ''; if($groupleaders[$usergroup['gid']])
|
Zeile 2777 | Zeile 2809 |
---|
if($mybb->input['action'] == "attachments") { $plugins->run_hooks("usercp_attachments_start");
|
if($mybb->input['action'] == "attachments") { $plugins->run_hooks("usercp_attachments_start");
|
require_once MYBB_ROOT."inc/functions_upload.php";
| require_once MYBB_ROOT."inc/functions_upload.php";
|
$attachments = '';
|
$attachments = '';
|
$query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount']; $friendlyusage = get_friendly_size($totalusage); if($mybb->usergroup['attachquota']) { $percent = round(($totalusage/($mybb->usergroup['attachquota']*1024))*100)."%"; $attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024); $usagenote = $lang->sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $percent, $totalattachments); } else { $percent = $lang->unlimited; $attachquota = $lang->unlimited; $usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments); }
|
|
// Pagination if(!$mybb->settings['threadsperpage'])
|
// Pagination if(!$mybb->settings['threadsperpage'])
|
{
| {
|
$mybb->settings['threadsperpage'] = 20;
|
$mybb->settings['threadsperpage'] = 20;
|
}
| }
|
$perpage = $mybb->settings['threadsperpage']; $page = intval($mybb->input['page']);
|
$perpage = $mybb->settings['threadsperpage']; $page = intval($mybb->input['page']);
|
|
|
if(intval($mybb->input['page']) > 0) { $start = ($page-1) *$perpage; } else
|
if(intval($mybb->input['page']) > 0) { $start = ($page-1) *$perpage; } else
|
{
| {
|
$start = 0; $page = 1;
|
$start = 0; $page = 1;
|
}
| }
|
$end = $start + $perpage; $lower = $start+1;
|
$end = $start + $perpage; $lower = $start+1;
|
if($end > $totalattachments) { $upper = $totalattachments; } $multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
| |
$query = $db->query(" SELECT a.*, p.subject, p.dateline, t.tid, t.subject AS threadsubject FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
$query = $db->query(" SELECT a.*, p.subject, p.dateline, t.tid, t.subject AS threadsubject FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
WHERE a.uid='".$mybb->user['uid']."' AND a.pid!='0'
| WHERE a.uid='".$mybb->user['uid']."'
|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage} ");
|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage} ");
|
|
|
$bandwidth = $totaldownloads = 0; while($attachment = $db->fetch_array($query)) { if($attachment['dateline'] && $attachment['tid'])
|
$bandwidth = $totaldownloads = 0; while($attachment = $db->fetch_array($query)) { if($attachment['dateline'] && $attachment['tid'])
|
{
| {
|
$attachment['subject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['subject'])); $attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']);
| $attachment['subject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['subject'])); $attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']);
|
Zeile 2853 | Zeile 2863 |
---|
// Add to bandwidth total $bandwidth += ($attachment['filesize'] * $attachment['downloads']); $totaldownloads += $attachment['downloads'];
|
// Add to bandwidth total $bandwidth += ($attachment['filesize'] * $attachment['downloads']); $totaldownloads += $attachment['downloads'];
|
}
| }
|
else { // This little thing delets attachments without a thread/post remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']); } }
|
else { // This little thing delets attachments without a thread/post remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']); } }
|
| $query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount']; $friendlyusage = get_friendly_size($totalusage); if($mybb->usergroup['attachquota']) { $percent = round(($totalusage/($mybb->usergroup['attachquota']*1024))*100)."%"; $attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024); $usagenote = $lang->sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $percent, $totalattachments); } else { $percent = $lang->unlimited; $attachquota = $lang->unlimited; $usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments); }
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
|
$bandwidth = get_friendly_size($bandwidth);
if(!$attachments)
| $bandwidth = get_friendly_size($bandwidth);
if(!$attachments)
|
Zeile 2872 | Zeile 2902 |
---|
eval("\$manageattachments = \"".$templates->get("usercp_attachments")."\";"); output_page($manageattachments);
|
eval("\$manageattachments = \"".$templates->get("usercp_attachments")."\";"); output_page($manageattachments);
|
}
| }
|
if($mybb->input['action'] == "do_attachments" && $mybb->request_method == "post") { // Verify incoming POST request
| if($mybb->input['action'] == "do_attachments" && $mybb->request_method == "post") { // Verify incoming POST request
|
Zeile 2910 | Zeile 2940 |
---|
{ // Get posts per day $daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);
|
{ // Get posts per day $daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);
|
| if($daysreg < 1) { $daysreg = 1; }
|
$perday = $mybb->user['postnum'] / $daysreg; $perday = round($perday, 2); if($perday > $mybb->user['postnum'])
| $perday = $mybb->user['postnum'] / $daysreg; $perday = round($perday, 2); if($perday > $mybb->user['postnum'])
|
Zeile 2920 | Zeile 2956 |
---|
$stats = $cache->read("stats"); $posts = $stats['numposts']; if($posts == 0)
|
$stats = $cache->read("stats"); $posts = $stats['numposts']; if($posts == 0)
|
{
| {
|
$percent = "0"; } else
| $percent = "0"; } else
|
Zeile 2943 | Zeile 2979 |
---|
$mybb->user['avatar'] = htmlspecialchars($mybb->user['avatar']); eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";"); $colspan = 2;
|
$mybb->user['avatar'] = htmlspecialchars($mybb->user['avatar']); eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";"); $colspan = 2;
|
}
| }
|
else { $avatar = ''; } $regdate = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $mybb->user['regdate']);
|
else { $avatar = ''; } $regdate = my_date($mybb->settings['dateformat'].", ".$mybb->settings['timeformat'], $mybb->user['regdate']);
|
|
|
if($mybb->user['usergroup'] == 5 && $mybb->settings['regtype'] != "admin") { $usergroup .= "<br />(<a href=\"member.php?action=resendactivation\">$lang->resend_activation</a>)";
| if($mybb->user['usergroup'] == 5 && $mybb->settings['regtype'] != "admin") { $usergroup .= "<br />(<a href=\"member.php?action=resendactivation\">$lang->resend_activation</a>)";
|
Zeile 2966 | Zeile 3002 |
---|
{ $warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100)
|
{ $warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100)
|
{
| {
|
$warning_level = 100; }
| $warning_level = 100; }
|
Zeile 2995 | Zeile 3031 |
---|
{ $post_link = ""; if($warning['post_subject'])
|
{ $post_link = ""; if($warning['post_subject'])
|
{
| {
|
$warning['post_subject'] = $parser->parse_badwords($warning['post_subject']); $warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']); $post_link = "<br /><small>{$lang->warning_for_post} <a href=\"".get_post_link($warning['pid'])."\">{$warning['post_subject']}</a></small>";
| $warning['post_subject'] = $parser->parse_badwords($warning['post_subject']); $warning['post_subject'] = htmlspecialchars_uni($warning['post_subject']); $post_link = "<br /><small>{$lang->warning_for_post} <a href=\"".get_post_link($warning['pid'])."\">{$warning['post_subject']}</a></small>";
|
Zeile 3012 | Zeile 3048 |
---|
} $warning_type = htmlspecialchars_uni($warning_type); if($warning['points'] > 0)
|
} $warning_type = htmlspecialchars_uni($warning_type); if($warning['points'] > 0)
|
{
| {
|
$warning['points'] = "+{$warning['points']}"; } $points = $lang->sprintf($lang->warning_points, $warning['points']);
| $warning['points'] = "+{$warning['points']}"; } $points = $lang->sprintf($lang->warning_points, $warning['points']);
|
Zeile 3069 | Zeile 3105 |
---|
$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1)); if($db->num_rows($query)) {
|
$query = $db->simple_select("threadsubscriptions", "sid", "uid = '".$mybb->user['uid']."'", array("limit" => 1)); if($db->num_rows($query)) {
|
| $visible = "AND t.visible != 0"; if(is_moderator() == true) { $visible = ''; }
|
$query = $db->query(" SELECT s.*, t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
$query = $db->query(" SELECT s.*, t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE s.uid='".$mybb->user['uid']."'
| WHERE s.uid='".$mybb->user['uid']."' {$visible}
|
ORDER BY t.lastpost DESC LIMIT 0, 10 ");
| ORDER BY t.lastpost DESC LIMIT 0, 10 ");
|
Zeile 3106 | Zeile 3148 |
---|
else { $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
else { $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
}
| }
|
} }
| } }
|
Zeile 3125 | Zeile 3167 |
---|
foreach($subscriptions as $thread) {
|
foreach($subscriptions as $thread) {
|
| $folder = ''; $folder_label = ''; $gotounread = '';
|
if($thread['tid']) { $bgcolor = alt_trow();
| if($thread['tid']) { $bgcolor = alt_trow();
|
Zeile 3151 | Zeile 3197 |
---|
{ $icon = $icon_cache[$thread['icon']]; $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
{ $icon = $icon_cache[$thread['icon']]; $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
} else {
| } else {
|
$icon = " "; }
| $icon = " "; }
|
Zeile 3165 | Zeile 3211 |
---|
// Check to see which icon we display if($thread['lastread'] && $thread['lastread'] < $thread['lastpost'])
|
// Check to see which icon we display if($thread['lastread'] && $thread['lastread'] < $thread['lastpost'])
|
{
| {
|
$folder .= "new"; $folder_label .= $lang->icon_new; $new_class = "subject_new"; $thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
|
$folder .= "new"; $folder_label .= $lang->icon_new; $new_class = "subject_new"; $thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
|
}
| }
|
else { $folder_label .= $lang->icon_no_new; $new_class = "subject_old";
|
else { $folder_label .= $lang->icon_no_new; $new_class = "subject_old";
|
}
| }
|
$folder .= "folder";
|
$folder .= "folder";
|
| if($thread['visible'] == 0) { $bgcolor = "trow_shaded"; }
|
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
| $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
|
Zeile 3188 | Zeile 3239 |
---|
if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
}
| }
|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
| else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
Zeile 3199 | Zeile 3250 |
---|
$thread['author'] = build_profile_link($thread['username'], $thread['uid']); eval("\$latest_subscribed_threads .= \"".$templates->get("usercp_latest_subscribed_threads")."\";");
|
$thread['author'] = build_profile_link($thread['username'], $thread['uid']); eval("\$latest_subscribed_threads .= \"".$templates->get("usercp_latest_subscribed_threads")."\";");
|
}
| }
|
} eval("\$latest_subscribed = \"".$templates->get("usercp_latest_subscribed")."\";"); } }
|
} eval("\$latest_subscribed = \"".$templates->get("usercp_latest_subscribed")."\";"); } }
|
}
| }
|
// User's Latest Threads
// Get unviewable forums $unviewable_forums = get_unviewable_forums(); if($unviewable_forums)
|
// User's Latest Threads
// Get unviewable forums $unviewable_forums = get_unviewable_forums(); if($unviewable_forums)
|
{
| {
|
$f_perm_sql = "AND t.fid NOT IN (".$unviewable_forums.")";
|
$f_perm_sql = "AND t.fid NOT IN (".$unviewable_forums.")";
|
| }
$visible = " AND t.visible != 0"; if(is_moderator() == true) { $visible = '';
|
}
$query = $db->query(" SELECT t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
}
$query = $db->query(" SELECT t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE t.uid='".$mybb->user['uid']."' {$f_perm_sql}
| WHERE t.uid='".$mybb->user['uid']."' AND t.firstpost != 0 AND t.visible != '-2' {$visible} {$f_perm_sql}
|
ORDER BY t.lastpost DESC LIMIT 0, 5 ");
| ORDER BY t.lastpost DESC LIMIT 0, 5 ");
|
Zeile 3386 | Zeile 3443 |
---|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
| }
// Is our thread visible? if($thread['visible'] == 0) { $bgcolor = 'trow_shaded';
|
}
if($thread['closed'] == 1)
| }
if($thread['closed'] == 1)
|