Zeile 1 | Zeile 1 |
---|
<?php /** * MyBB 1.4
|
<?php /** * MyBB 1.4
|
* Copyright � 2008 MyBB Group, All Rights Reserved
| * Copyright � 2008 MyBB Group, All Rights Reserved
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* * Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: usercp.php 4184 2008-09-10 04:40:17Z Tikitiki $
| * $Id: usercp.php 4620 2009-12-20 07:29:15Z dennis $
|
*/
define("IN_MYBB", 1);
| */
define("IN_MYBB", 1);
|
Zeile 73 | Zeile 73 |
---|
} else if($mybb->settings['siglength'] > 0) {
|
} else if($mybb->settings['siglength'] > 0) {
|
if($mybb->settings['sigcountmycode'] == 1)
| if($mybb->settings['sigcountmycode'] == 0)
|
{ $parsed_sig = $parser->text_parse_message($mybb->input['signature']); }
| { $parsed_sig = $parser->text_parse_message($mybb->input['signature']); }
|
Zeile 173 | Zeile 173 |
---|
$awaydate = TIME_NOW; if($mybb->input['awayday']) {
|
$awaydate = TIME_NOW; if($mybb->input['awayday']) {
|
| // If the user has indicated that they will return on a specific day, but not month or year, assume it is current month and year
|
if(!$mybb->input['awaymonth']) { $mybb->input['awaymonth'] = my_date('n', $awaydate); }
|
if(!$mybb->input['awaymonth']) { $mybb->input['awaymonth'] = my_date('n', $awaydate); }
|
| |
if(!$mybb->input['awayyear']) { $mybb->input['awayyear'] = my_date('Y', $awaydate);
|
if(!$mybb->input['awayyear']) { $mybb->input['awayyear'] = my_date('Y', $awaydate);
|
}
| } $return_month = intval(substr($mybb->input['awaymonth'], 0, 2)); $return_day = intval(substr($mybb->input['awayday'], 0, 2)); $return_year = intval(substr($mybb->input['awayyear'], 0, 4));
|
|
|
$returntimestamp = gmmktime(0, 0, 0, $mybb->input['awaymonth'], $mybb->input['awayday'], $mybb->input['awayyear']);
| // Check if return date is after the away date. $returntimestamp = gmmktime(0, 0, 0, $return_month, $return_day, $return_year);
|
$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));
|
$awaytimestamp = gmmktime(0, 0, 0, my_date('n', $awaydate), my_date('j', $awaydate), my_date('Y', $awaydate));
|
if ($returntimestamp < $awaytimestamp && $mybb->input['awayyear'] < my_date("Y"))
| if ($returntimestamp < $awaytimestamp)
|
{ error($lang->error_usercp_return_date_past); }
|
{ error($lang->error_usercp_return_date_past); }
|
$returndate = intval($mybb->input['awayday'])."-".intval($mybb->input['awaymonth'])."-".intval($mybb->input['awayyear']);
| $returndate = "{$return_day}-{$return_month}-{$return_year}";
|
} else {
| } else {
|
Zeile 199 | Zeile 205 |
---|
"away" => 1, "date" => $awaydate, "returndate" => $returndate,
|
"away" => 1, "date" => $awaydate, "returndate" => $returndate,
|
"awayreason" => $db->escape_string($mybb->input['awayreason'])
| "awayreason" => $mybb->input['awayreason']
|
); } else
| ); } else
|
Zeile 211 | Zeile 217 |
---|
"awayreason" => '' ); }
|
"awayreason" => '' ); }
|
|
|
$bday = array( "day" => $mybb->input['bday1'], "month" => $mybb->input['bday2'], "year" => $mybb->input['bday3']
|
$bday = array( "day" => $mybb->input['bday1'], "month" => $mybb->input['bday2'], "year" => $mybb->input['bday3']
|
);
| );
|
// Set up user handler. require_once "inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
| // Set up user handler. require_once "inc/datahandlers/user.php"; $userhandler = new UserDataHandler("update");
|
Zeile 236 | Zeile 242 |
---|
);
if($mybb->usergroup['cancustomtitle'] == 1)
|
);
if($mybb->usergroup['cancustomtitle'] == 1)
|
{
| {
|
if($mybb->input['usertitle'] != '') { $user['usertitle'] = $mybb->input['usertitle'];
| if($mybb->input['usertitle'] != '') { $user['usertitle'] = $mybb->input['usertitle'];
|
Zeile 253 | Zeile 259 |
---|
$errors = $userhandler->get_friendly_errors(); $errors = inline_error($errors); $mybb->input['action'] = "profile";
|
$errors = $userhandler->get_friendly_errors(); $errors = inline_error($errors); $mybb->input['action'] = "profile";
|
} else
| } else
|
{ $userhandler->update_user();
| { $userhandler->update_user();
|
Zeile 327 | Zeile 333 |
---|
if($user['icq'] != "0") { $user['icq'] = intval($user['icq']);
|
if($user['icq'] != "0") { $user['icq'] = intval($user['icq']);
|
}
| }
|
if($user['icq'] == 0) { $user['icq'] = "";
| if($user['icq'] == 0) { $user['icq'] = "";
|
Zeile 341 | Zeile 347 |
---|
if($mybb->settings['allowaway'] != 0) { if($errors)
|
if($mybb->settings['allowaway'] != 0) { if($errors)
|
{
| {
|
if($user['away'] == 1) { $awaycheck[1] = "checked=\"checked\"";
| if($user['away'] == 1) { $awaycheck[1] = "checked=\"checked\"";
|
Zeile 364 | Zeile 370 |
---|
$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']); $awaycheck[1] = "checked=\"checked\""; $awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
|
$awaydate = my_date($mybb->settings['dateformat'], $mybb->user['awaydate']); $awaycheck[1] = "checked=\"checked\""; $awaynotice = $lang->sprintf($lang->away_notice_away, $awaydate);
|
}
| }
|
else { $awaynotice = $lang->away_notice;
| else { $awaynotice = $lang->away_notice;
|
Zeile 437 | Zeile 443 |
---|
$sel = ""; if($val == $seloptions[$val])
|
$sel = ""; if($val == $seloptions[$val])
|
{
| {
|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>\n";
|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>\n";
|
} if(!$profilefield['length'])
| } if(!$profilefield['length'])
|
{ $profilefield['length'] = 3; }
| { $profilefield['length'] = 3; }
|
Zeile 455 | Zeile 461 |
---|
if(is_array($expoptions)) { foreach($expoptions as $key => $val)
|
if(is_array($expoptions)) { foreach($expoptions as $key => $val)
|
{
| {
|
$val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
| $val = trim($val); $val = str_replace("\n", "\\n", $val); $sel = "";
|
Zeile 464 | Zeile 470 |
---|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>";
|
$sel = " selected=\"selected\""; } $select .= "<option value=\"$val\"$sel>$val</option>";
|
}
| }
|
if(!$profilefield['length']) { $profilefield['length'] = 1;
| if(!$profilefield['length']) { $profilefield['length'] = 1;
|
Zeile 473 | Zeile 479 |
---|
} } elseif($type == "radio")
|
} } elseif($type == "radio")
|
{
| {
|
$expoptions = explode("\n", $options); if(is_array($expoptions)) {
| $expoptions = explode("\n", $options); if(is_array($expoptions)) {
|
Zeile 485 | Zeile 491 |
---|
$checked = " checked=\"checked\""; } $code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";
|
$checked = " checked=\"checked\""; } $code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />";
|
} } }
| } } }
|
elseif($type == "checkbox") { if($errors) { $useropts = $userfield;
|
elseif($type == "checkbox") { if($errors) { $useropts = $userfield;
|
}
| }
|
else { $useropts = explode("\n", $userfield);
| else { $useropts = explode("\n", $userfield);
|
Zeile 520 | Zeile 526 |
---|
} } elseif($type == "textarea")
|
} } elseif($type == "textarea")
|
{ $value = htmlspecialchars_uni($userfield);
| { $value = htmlspecialchars_uni($userfield);
|
$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>"; } else { $value = htmlspecialchars_uni($userfield);
|
$code = "<textarea name=\"profile_fields[$field]\" rows=\"6\" cols=\"30\" style=\"width: 95%\">$value</textarea>"; } else { $value = htmlspecialchars_uni($userfield);
|
$code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\" maxlength=\"{$profilefield['maxlength']}\" value=\"$value\" />";
| $maxlength = ""; if($profilefield['maxlength'] > 0) { $maxlength = " maxlength=\"{$profilefield['maxlength']}\""; } $code = "<input type=\"text\" name=\"profile_fields[$field]\" class=\"textbox\" size=\"{$profilefield['length']}\"{$maxlength} value=\"$value\" />";
|
} if($profilefield['required'] == 1) {
| } if($profilefield['required'] == 1) {
|
Zeile 1292 | Zeile 1303 |
---|
} }
|
} }
|
| $icon_cache = $cache->read("posticons");
|
// Now we can build our subscription list foreach($subscriptions as $thread) { $bgcolor = alt_trow();
|
// Now we can build our subscription list foreach($subscriptions as $thread) { $bgcolor = alt_trow();
|
$folder = '';
| $folder = '';
|
$prefix = '';
// Sanitize
| $prefix = '';
// Sanitize
|
Zeile 1317 | Zeile 1330 |
---|
else { $icon = " ";
|
else { $icon = " ";
|
}
| }
|
// Determine the folder $folder = ''; $folder_label = '';
| // Determine the folder $folder = ''; $folder_label = '';
|
Zeile 1349 | Zeile 1362 |
---|
$forum_read = $forumsread[$thread['fid']]; }
|
$forum_read = $forumsread[$thread['fid']]; }
|
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read) { $cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; }
| if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read) { $cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; }
|
if($thread['lastpost'] > $cutoff) { if($thread['lastpost'] > $cutoff)
| if($thread['lastpost'] > $cutoff) { if($thread['lastpost'] > $cutoff)
|
Zeile 1366 | Zeile 1379 |
---|
{ $lastread = 1; }
|
{ $lastread = 1; }
|
} }
| } }
|
if(!$lastread) {
| if(!$lastread) {
|
Zeile 1390 | Zeile 1403 |
---|
$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; $new_class = "";
|
else { $folder_label .= $lang->icon_no_new; $new_class = "";
|
}
| }
|
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews']) {
| if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews']) {
|
Zeile 1404 | Zeile 1417 |
---|
}
if($thread['closed'] == 1)
|
}
if($thread['closed'] == 1)
|
{
| {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
|
}
| }
|
$folder .= "folder";
// Build last post info
| $folder .= "folder";
// Build last post info
|
Zeile 1426 | Zeile 1439 |
---|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
}
| }
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
| $thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
|
Zeile 1462 | Zeile 1475 |
---|
} if($mybb->user['uid'] == 0)
|
} if($mybb->user['uid'] == 0)
|
{
| {
|
// Build a forum cache. $query = $db->query(" SELECT fid
| // Build a forum cache. $query = $db->query(" SELECT fid
|
Zeile 1571 | Zeile 1584 |
---|
$db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'"); } elseif($mybb->input['updateposts'] == "disable")
|
$db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'"); } elseif($mybb->input['updateposts'] == "disable")
|
{
| {
|
$update_signature = array( "includesig" => 0 ); $db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
|
$update_signature = array( "includesig" => 0 ); $db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
|
}
| }
|
$new_signature = array( "signature" => $db->escape_string($mybb->input['signature']) );
| $new_signature = array( "signature" => $db->escape_string($mybb->input['signature']) );
|
Zeile 1594 | Zeile 1607 |
---|
{ $sig = $mybb->input['signature']; $template = "usercp_editsig_preview";
|
{ $sig = $mybb->input['signature']; $template = "usercp_editsig_preview";
|
}
| }
|
elseif(!$error) { $sig = $mybb->user['signature'];
| elseif(!$error) { $sig = $mybb->user['signature'];
|
Zeile 1607 | Zeile 1620 |
---|
}
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 1623 | Zeile 1636 |
---|
{ $sigsmilies = $lang->on; $smilieinserter = build_clickable_smilies();
|
{ $sigsmilies = $lang->on; $smilieinserter = build_clickable_smilies();
|
} else {
| } else {
|
$sigsmilies = $lang->off; } if($mybb->settings['sigmycode'] == 1)
| $sigsmilies = $lang->off; } if($mybb->settings['sigmycode'] == 1)
|
Zeile 1643 | Zeile 1656 |
---|
else { $sightml = $lang->off;
|
else { $sightml = $lang->off;
|
}
| }
|
if($mybb->settings['sigimgcode'] == 1) { $sigimgcode = $lang->on;
| if($mybb->settings['sigimgcode'] == 1) { $sigimgcode = $lang->on;
|
Zeile 1778 | Zeile 1791 |
---|
{ if($width && $height && $mybb->settings['maxavatardims'] != "") {
|
{ if($width && $height && $mybb->settings['maxavatardims'] != "") {
|
list($maxwidth, $maxheight) = explode("x", $mybb->settings['maxavatardims']);
| list($maxwidth, $maxheight) = explode("x", my_strtolower($mybb->settings['maxavatardims']));
|
if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight)) { $lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
| if(($maxwidth && $width > $maxwidth) || ($maxheight && $height > $maxheight)) { $lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
|
Zeile 1937 | Zeile 1950 |
---|
} if($mybb->settings['maxavatardims'] != "") {
|
} if($mybb->settings['maxavatardims'] != "") {
|
list($maxwidth, $maxheight) = explode("x", $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'])
| $lang->avatar_note .= "<br />".$lang->sprintf($lang->avatar_note_dimensions, $maxwidth, $maxheight); } if($mybb->settings['avatarsize'])
|
Zeile 2223 | Zeile 2236 |
---|
while($user = $db->fetch_array($query)) { $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
|
while($user = $db->fetch_array($query)) { $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
|
if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $user['lastvisit'] != $user['lastactive'])
| if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
|
{ $status = "online"; }
| { $status = "online"; }
|
Zeile 2251 | Zeile 2264 |
---|
while($user = $db->fetch_array($query)) { $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
|
while($user = $db->fetch_array($query)) { $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']);
|
if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->user['usergroup'] == 4) && $user['lastvisit'] != $user['lastactive'])
| if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
|
{ $status = "online"; }
| { $status = "online"; }
|
Zeile 2524 | Zeile 2537 |
---|
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid)) LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid) WHERE l.uid='".$mybb->user['uid']."'
|
LEFT JOIN ".TABLE_PREFIX."users u ON(((','|| u.additionalgroups|| ',' LIKE '%,'|| g.gid|| ',%') OR u.usergroup = g.gid)) LEFT JOIN ".TABLE_PREFIX."joinrequests j ON(j.gid=g.gid) WHERE l.uid='".$mybb->user['uid']."'
|
GROUP BY l.gid
| GROUP BY g.gid, g.title, g.type, l.canmanagerequests, l.canmanagemembers
|
"); break; default:
| "); break; default:
|
Zeile 2598 | Zeile 2611 |
---|
} 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>";
| $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']) {
| } if($usergroup['description']) {
|