Zeile 32 | Zeile 32 |
---|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
| require_once MYBB_ROOT."inc/functions_search.php";
|
require_once MYBB_ROOT."inc/functions_user.php"; require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
| require_once MYBB_ROOT."inc/functions_user.php"; require_once MYBB_ROOT."inc/class_parser.php"; $parser = new postParser;
|
Zeile 280 | Zeile 281 |
---|
$raw_errors = $userhandler->get_errors();
// Set to stored value if invalid
|
$raw_errors = $userhandler->get_errors();
// Set to stored value if invalid
|
if(array_key_exists("invalid_birthday_privacy", $raw_errors))
| if(array_key_exists("invalid_birthday_privacy", $raw_errors) || array_key_exists("conflicted_birthday_privacy", $raw_errors))
|
{ $mybb->input['birthdayprivacy'] = $mybb->user['birthdayprivacy'];
|
{ $mybb->input['birthdayprivacy'] = $mybb->user['birthdayprivacy'];
|
| $bday = explode("-", $mybb->user['birthday']);
if(isset($bday[2])) { $mybb->input['bday3'] = $bday[2]; }
|
}
$errors = inline_error($errors); $mybb->input['action'] = "profile";
|
}
$errors = inline_error($errors); $mybb->input['action'] = "profile";
|
}
| }
|
else { $userhandler->update_user();
|
else { $userhandler->update_user();
|
|
|
$plugins->run_hooks("usercp_do_profile_end"); redirect("usercp.php?action=profile", $lang->redirect_profileupdated); }
| $plugins->run_hooks("usercp_do_profile_end"); redirect("usercp.php?action=profile", $lang->redirect_profileupdated); }
|
Zeile 308 | Zeile 315 |
---|
$bday[2] = $mybb->get_input('bday3', MyBB::INPUT_INT); } else
|
$bday[2] = $mybb->get_input('bday3', MyBB::INPUT_INT); } else
|
{
| {
|
$user = $mybb->user; $bday = explode("-", $user['birthday']); if(!isset($bday[1])) { $bday[1] = 0; }
|
$user = $mybb->user; $bday = explode("-", $user['birthday']); if(!isset($bday[1])) { $bday[1] = 0; }
|
if(!isset($bday[2])) { $bday[2] = ''; }
| } if(!isset($bday[2]) || $bday[2] == 0) { $bday[2] = '';
|
}
$plugins->run_hooks("usercp_profile_start");
| }
$plugins->run_hooks("usercp_profile_start");
|
Zeile 414 | Zeile 421 |
---|
if($cfieldsshow) { eval('$contactfields = "'.$templates->get('usercp_profile_contact_fields').'";');
|
if($cfieldsshow) { eval('$contactfields = "'.$templates->get('usercp_profile_contact_fields').'";');
|
}
| }
|
if($mybb->settings['allowaway'] != 0) { $awaycheck = array('', '');
| if($mybb->settings['allowaway'] != 0) { $awaycheck = array('', '');
|
Zeile 543 | Zeile 550 |
---|
foreach($useropts as $key => $val) { $val = htmlspecialchars_uni($val);
|
foreach($useropts as $key => $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(isset($seloptions[$val]) && $val == $seloptions[$val]) { $sel = " selected=\"selected\""; }
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
| $seloptions[$val] = $val;
|
}
|
}
|
if(!$profilefield['length'])
| } $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val) { $val = trim($val); $val = str_replace("\n", "\\n", $val);
$sel = ""; if(isset($seloptions[$val]) && $val == $seloptions[$val]) { $sel = " selected=\"selected\""; }
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";"); } if(!$profilefield['length'])
|
{ $profilefield['length'] = 3; }
| { $profilefield['length'] = 3; }
|
Zeile 586 | Zeile 593 |
---|
}
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
|
}
eval("\$select .= \"".$templates->get("usercp_profile_profilefields_select_option")."\";");
|
}
| }
|
if(!$profilefield['length']) { $profilefield['length'] = 1;
| if(!$profilefield['length']) { $profilefield['length'] = 1;
|
Zeile 610 | Zeile 617 |
---|
}
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");
|
}
eval("\$code .= \"".$templates->get("usercp_profile_profilefields_radio")."\";");
|
}
| }
|
} } elseif($type == "checkbox")
| } } elseif($type == "checkbox")
|
Zeile 739 | Zeile 746 |
---|
else { $customtitle = "";
|
else { $customtitle = "";
|
}
| }
|
if($mybb->usergroup['canchangewebsite'] == 1) { eval("\$website = \"".$templates->get("usercp_profile_website")."\";");
| if($mybb->usergroup['canchangewebsite'] == 1) { eval("\$website = \"".$templates->get("usercp_profile_website")."\";");
|
Zeile 804 | Zeile 811 |
---|
if($mybb->settings['usertppoptions']) { $user['options']['tpp'] = $mybb->get_input('tpp', MyBB::INPUT_INT);
|
if($mybb->settings['usertppoptions']) { $user['options']['tpp'] = $mybb->get_input('tpp', MyBB::INPUT_INT);
|
}
| }
|
if($mybb->settings['userpppoptions']) { $user['options']['ppp'] = $mybb->get_input('ppp', MyBB::INPUT_INT); }
|
if($mybb->settings['userpppoptions']) { $user['options']['ppp'] = $mybb->get_input('ppp', MyBB::INPUT_INT); }
|
|
|
$userhandler->set_data($user);
if(!$userhandler->validate_user())
|
$userhandler->set_data($user);
if(!$userhandler->validate_user())
|
{
| {
|
$errors = $userhandler->get_friendly_errors(); $errors = inline_error($errors); $mybb->input['action'] = "options";
| $errors = $userhandler->get_friendly_errors(); $errors = inline_error($errors); $mybb->input['action'] = "options";
|
Zeile 832 | Zeile 839 |
---|
if($mybb->input['action'] == "options") { if($errors != '')
|
if($mybb->input['action'] == "options") { if($errors != '')
|
{
| {
|
$user = $mybb->input;
|
$user = $mybb->input;
|
}
| }
|
else { $user = $mybb->user;
|
else { $user = $mybb->user;
|
}
$plugins->run_hooks("usercp_options_start");
| }
$plugins->run_hooks("usercp_options_start");
|
$languages = $lang->get_languages(); $board_language = $langoptions = '';
| $languages = $lang->get_languages(); $board_language = $langoptions = '';
|
Zeile 849 | Zeile 856 |
---|
foreach($languages as $name => $language) { $language = htmlspecialchars_uni($language);
|
foreach($languages as $name => $language) { $language = htmlspecialchars_uni($language);
|
|
|
$sel = ''; if(isset($user['language']) && $user['language'] == $name) { $sel = " selected=\"selected\""; }
|
$sel = ''; if(isset($user['language']) && $user['language'] == $name) { $sel = " selected=\"selected\""; }
|
|
|
eval('$langoptions .= "'.$templates->get('usercp_options_language_option').'";');
|
eval('$langoptions .= "'.$templates->get('usercp_options_language_option').'";');
|
}
| }
|
eval('$board_language = "'.$templates->get('usercp_options_language').'";'); }
| eval('$board_language = "'.$templates->get('usercp_options_language').'";'); }
|
Zeile 872 | Zeile 879 |
---|
$allownoticescheck = ""; }
|
$allownoticescheck = ""; }
|
if(isset($user['invisible']) && $user['invisible'] == 1)
| $canbeinvisible = '';
// Check usergroup permission before showing invisible check box if($mybb->usergroup['canbeinvisible'] == 1)
|
{
|
{
|
$invisiblecheck = "checked=\"checked\""; } else { $invisiblecheck = "";
| if(isset($user['invisible']) && $user['invisible'] == 1) { $invisiblecheck = "checked=\"checked\""; } else { $invisiblecheck = ""; } eval('$canbeinvisible = "'.$templates->get("usercp_options_invisible")."\";");
|
}
if(isset($user['hideemail']) && $user['hideemail'] == 1)
| }
if(isset($user['hideemail']) && $user['hideemail'] == 1)
|
Zeile 1507 | Zeile 1521 |
---|
$plugins->run_hooks("usercp_subscriptions_start");
// Thread visiblity
|
$plugins->run_hooks("usercp_subscriptions_start");
// Thread visiblity
|
$visible = "AND t.visible != 0"; if(is_moderator() == true)
| $where = array( "s.uid={$mybb->user['uid']}", get_visible_where('t') );
if($unviewable_forums = get_unviewable_forums(true)) { $where[] = "t.fid NOT IN ({$unviewable_forums})"; }
if($inactive_forums = get_inactive_forums())
|
{
|
{
|
$visible = '';
| $where[] = "t.fid NOT IN ({$inactive_forums})";
|
}
|
}
|
| $where = implode(' AND ', $where);
|
// Do Multi Pages $query = $db->query("
|
// Do Multi Pages $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']."' AND t.visible >= 0 {$visible}
| SELECT COUNT(s.tid) as threads FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = s.tid) WHERE {$where}
|
"); $threadcount = $db->fetch_field($query, "threads");
| "); $threadcount = $db->fetch_field($query, "threads");
|
Zeile 1562 | Zeile 1587 |
---|
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)
|
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']."' and t.visible >= 0 {$visible}
| WHERE {$where}
|
ORDER BY t.lastpost DESC LIMIT $start, $perpage ");
| ORDER BY t.lastpost DESC LIMIT $start, $perpage ");
|
Zeile 1570 | Zeile 1595 |
---|
{ $forumpermissions = $fpermissions[$subscription['fid']];
|
{ $forumpermissions = $fpermissions[$subscription['fid']];
|
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || (isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))
| if(isset($forumpermissions['canonlyviewownthreads']) && $forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid'])
|
{ // Hmm, you don't have permission to view this thread - unsubscribe! $del_subscriptions[] = $subscription['sid'];
| { // Hmm, you don't have permission to view this thread - unsubscribe! $del_subscriptions[] = $subscription['sid'];
|
Zeile 1687 | Zeile 1712 |
---|
{ $folder = "dot_"; $folder_label .= $lang->icon_dot;
|
{ $folder = "dot_"; $folder_label .= $lang->icon_dot;
|
}
| }
|
$gotounread = ''; $isnew = 0;
| $gotounread = ''; $isnew = 0;
|
Zeile 1696 | Zeile 1721 |
---|
if($mybb->settings['threadreadcut'] > 0) {
|
if($mybb->settings['threadreadcut'] > 0) {
|
$forum_read = $readforums[$thread['fid']];
| |
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24;
|
if($forum_read == 0 || $forum_read < $read_cutoff) {
| if(empty($readforums[$thread['fid']]) || $readforums[$thread['fid']] < $read_cutoff) {
|
$forum_read = $read_cutoff;
|
$forum_read = $read_cutoff;
|
| } else { $forum_read = $readforums[$thread['fid']];
|
} }
| } }
|
Zeile 1713 | Zeile 1740 |
---|
if($thread['lastpost'] > $cutoff) {
|
if($thread['lastpost'] > $cutoff) {
|
if($thread['lastread'])
| if(!empty($thread['lastread']))
|
{ $lastread = $thread['lastread']; }
| { $lastread = $thread['lastread']; }
|
Zeile 1772 | Zeile 1799 |
---|
// Build last post info $lastpostdate = my_date('relative', $thread['lastpost']);
|
// Build last post info $lastpostdate = my_date('relative', $thread['lastpost']);
|
| $lastposteruid = $thread['lastposteruid'];
|
if(!$lastposteruid && !$thread['lastposter']) { $lastposter = htmlspecialchars_uni($lang->guest);
|
if(!$lastposteruid && !$thread['lastposter']) { $lastposter = htmlspecialchars_uni($lang->guest);
|
} else
| } else
|
{ $lastposter = htmlspecialchars_uni($thread['lastposter']);
|
{ $lastposter = htmlspecialchars_uni($thread['lastposter']);
|
} $lastposteruid = $thread['lastposteruid'];
| }
|
// Don't link to guest's profiles (they have no profile). if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
// Don't link to guest's profiles (they have no profile). if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
}
| }
|
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 1807 | Zeile 1834 |
---|
default: // No notification $notification_type = $lang->no_notification; }
|
default: // No notification $notification_type = $lang->no_notification; }
|
|
|
eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";"); }
| eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";"); }
|
Zeile 1818 | Zeile 1845 |
---|
{ $remove_options = ''; eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
|
{ $remove_options = ''; eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
|
}
| }
|
$plugins->run_hooks("usercp_subscriptions_end");
eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";"); output_page($subscriptions); }
|
$plugins->run_hooks("usercp_subscriptions_end");
eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";"); output_page($subscriptions); }
|
|
|
if($mybb->input['action'] == "forumsubscriptions") { $plugins->run_hooks("usercp_forumsubscriptions_start");
| if($mybb->input['action'] == "forumsubscriptions") { $plugins->run_hooks("usercp_forumsubscriptions_start");
|
Zeile 1846 | Zeile 1873 |
---|
$fpermissions = forum_permissions(); require_once MYBB_ROOT."inc/functions_forumlist.php";
|
$fpermissions = forum_permissions(); require_once MYBB_ROOT."inc/functions_forumlist.php";
|
|
|
$query = $db->query(" SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread FROM ".TABLE_PREFIX."forumsubscriptions fs
| $query = $db->query(" SELECT fs.*, f.*, t.subject AS lastpostsubject, fr.dateline AS lastread FROM ".TABLE_PREFIX."forumsubscriptions fs
|
Zeile 1862 | Zeile 1889 |
---|
{ $forum_url = get_forum_link($forum['fid']); $forumpermissions = $fpermissions[$forum['fid']];
|
{ $forum_url = get_forum_link($forum['fid']); $forumpermissions = $fpermissions[$forum['fid']];
|
|
|
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { continue;
| if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { continue;
|
Zeile 2420 | Zeile 2447 |
---|
{ $sigimgcode = $lang->off; }
|
{ $sigimgcode = $lang->off; }
|
| if($mybb->settings['siglength'] == 0) { $siglength = $lang->unlimited; } else { $siglength = $mybb->settings['siglength']; }
|
$sig = htmlspecialchars_uni($sig);
|
$sig = htmlspecialchars_uni($sig);
|
$lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $mybb->settings['siglength']);
| $lang->edit_sig_note2 = $lang->sprintf($lang->edit_sig_note2, $sigsmilies, $sigmycode, $sigimgcode, $sightml, $siglength);
|
if($mybb->settings['sigmycode'] != 0 && $mybb->settings['bbcodeinserter'] != 0 && $mybb->user['showcodebuttons'] != 0) {
| if($mybb->settings['sigmycode'] != 0 && $mybb->settings['bbcodeinserter'] != 0 && $mybb->user['showcodebuttons'] != 0) {
|
Zeile 2443 | Zeile 2480 |
---|
$plugins->run_hooks("usercp_do_avatar_start"); require_once MYBB_ROOT."inc/functions_upload.php";
|
$plugins->run_hooks("usercp_do_avatar_start"); require_once MYBB_ROOT."inc/functions_upload.php";
|
|
|
$avatar_error = "";
if(!empty($mybb->input['remove'])) // remove avatar
| $avatar_error = "";
if(!empty($mybb->input['remove'])) // remove avatar
|
Zeile 2459 | Zeile 2496 |
---|
elseif($_FILES['avatarupload']['name']) // upload avatar { if($mybb->usergroup['canuploadavatars'] == 0)
|
elseif($_FILES['avatarupload']['name']) // upload avatar { if($mybb->usergroup['canuploadavatars'] == 0)
|
{
| {
|
error_no_permission(); } $avatar = upload_avatar();
|
error_no_permission(); } $avatar = upload_avatar();
|
if($avatar['error'])
| if(!empty($avatar['error']))
|
{ $avatar_error = $avatar['error']; }
| { $avatar_error = $avatar['error']; }
|
Zeile 2481 | Zeile 2518 |
---|
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'"); } }
|
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'"); } }
|
elseif($mybb->settings['allowremoteavatars']) // remote avatar
| elseif(!$mybb->settings['allowremoteavatars'] && !$_FILES['avatarupload']['name']) // missing avatar image { $avatar_error = $lang->error_avatarimagemissing; } elseif($mybb->settings['allowremoteavatars']) // remote avatar
|
{ $mybb->input['avatarurl'] = trim($mybb->get_input('avatarurl')); if(validate_email_format($mybb->input['avatarurl']) != false)
| { $mybb->input['avatarurl'] = trim($mybb->get_input('avatarurl')); if(validate_email_format($mybb->input['avatarurl']) != false)
|
Zeile 2602 | Zeile 2643 |
---|
{ $mybb->input['action'] = "avatar"; $avatar_error = inline_error($avatar_error);
|
{ $mybb->input['action'] = "avatar"; $avatar_error = inline_error($avatar_error);
|
} }
| } }
|
if($mybb->input['action'] == "avatar") {
| if($mybb->input['action'] == "avatar") {
|
Zeile 2709 | Zeile 2750 |
---|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
|
// And clean it up a little to ensure there is no possibility of bad values $new_list = preg_replace("#,{2,}#", ",", $new_list); $new_list = preg_replace("#[^0-9,]#", "", $new_list);
if(my_substr($new_list, 0, 1) == ",") { $new_list = my_substr($new_list, 1); } if(my_substr($new_list, -1) == ",") { $new_list = my_substr($new_list, 0, my_strlen($new_list)-2); }
$user['buddylist'] = $db->escape_string($new_list);
| // And clean it up a little to ensure there is no possibility of bad values $new_list = preg_replace("#,{2,}#", ",", $new_list); $new_list = preg_replace("#[^0-9,]#", "", $new_list);
if(my_substr($new_list, 0, 1) == ",") { $new_list = my_substr($new_list, 1); } if(my_substr($new_list, -1) == ",") { $new_list = my_substr($new_list, 0, my_strlen($new_list)-2); }
$user['buddylist'] = $db->escape_string($new_list);
|
$db->update_query("users", array('buddylist' => $user['buddylist']), "uid='".(int)$user['uid']."'");
|
$db->update_query("users", array('buddylist' => $user['buddylist']), "uid='".(int)$user['uid']."'");
|
|
|
// We want to add the user to our buddy list if($mybb->user['buddylist'] != '') { $mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']);
|
// We want to add the user to our buddy list if($mybb->user['buddylist'] != '') { $mybb->user['buddylist'] = explode(',', $mybb->user['buddylist']);
|
}
| }
|
else { $mybb->user['buddylist'] = array();
|
else { $mybb->user['buddylist'] = array();
|
}
$mybb->user['buddylist'][] = (int)$request['uid'];
| }
$mybb->user['buddylist'][] = (int)$request['uid'];
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $mybb->user['buddylist']);
| // Now we have the new list, so throw it all back together $new_list = implode(",", $mybb->user['buddylist']);
|
Zeile 2769 | Zeile 2810 |
---|
);
send_pm($pm, $mybb->user['uid'], true);
|
);
send_pm($pm, $mybb->user['uid'], true);
|
|
|
$db->delete_query('buddyrequests', 'id='.(int)$request['id']); } else
| $db->delete_query('buddyrequests', 'id='.(int)$request['id']); } else
|
Zeile 2783 | Zeile 2824 |
---|
}
elseif($mybb->input['action'] == "declinerequest")
|
}
elseif($mybb->input['action'] == "declinerequest")
|
{ // Verify incoming POST request
| { // Verify incoming POST request
|
verify_post_check($mybb->get_input('my_post_key'));
// Validate request $query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']);
|
verify_post_check($mybb->get_input('my_post_key'));
// Validate request $query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND touid='.(int)$mybb->user['uid']);
|
$request = $db->fetch_array($query); if(empty($request)) { error($lang->invalid_request);
| $request = $db->fetch_array($query); if(empty($request)) { error($lang->invalid_request);
|
}
|
}
|
|
|
$plugins->run_hooks("usercp_declinerequest_start");
$user = get_user($request['uid']);
|
$plugins->run_hooks("usercp_declinerequest_start");
$user = get_user($request['uid']);
|
if(!empty($user)) { $db->delete_query('buddyrequests', 'id='.(int)$request['id']);
| if(!empty($user)) { $db->delete_query('buddyrequests', 'id='.(int)$request['id']);
|
} else { error($lang->user_doesnt_exist);
|
} else { error($lang->user_doesnt_exist);
|
}
$plugins->run_hooks("usercp_declinerequest_end");
| }
$plugins->run_hooks("usercp_declinerequest_end");
|
redirect("usercp.php?action=editlists", $lang->buddyrequest_declined); }
elseif($mybb->input['action'] == "cancelrequest")
|
redirect("usercp.php?action=editlists", $lang->buddyrequest_declined); }
elseif($mybb->input['action'] == "cancelrequest")
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
| { // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
// Validate request $query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND uid='.(int)$mybb->user['uid']);
| // Validate request $query = $db->simple_select('buddyrequests', '*', 'id='.$mybb->get_input('id', MyBB::INPUT_INT).' AND uid='.(int)$mybb->user['uid']);
|
Zeile 2830 | Zeile 2871 |
---|
$db->delete_query('buddyrequests', 'id='.(int)$request['id']);
$plugins->run_hooks("usercp_cancelrequest_end");
|
$db->delete_query('buddyrequests', 'id='.(int)$request['id']);
$plugins->run_hooks("usercp_cancelrequest_end");
|
|
|
redirect("usercp.php?action=editlists", $lang->buddyrequest_cancelled); }
| redirect("usercp.php?action=editlists", $lang->buddyrequest_cancelled); }
|
Zeile 2838 | Zeile 2879 |
---|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
{ // Verify incoming POST request verify_post_check($mybb->get_input('my_post_key'));
|
|
|
$plugins->run_hooks("usercp_do_editlists_start");
$existing_users = array(); $selected_list = array(); if($mybb->get_input('manage') == "ignored")
|
$plugins->run_hooks("usercp_do_editlists_start");
$existing_users = array(); $selected_list = array(); if($mybb->get_input('manage') == "ignored")
|
{ if($mybb->user['ignorelist'])
| { if($mybb->user['ignorelist'])
|
{ $existing_users = explode(",", $mybb->user['ignorelist']); }
| { $existing_users = explode(",", $mybb->user['ignorelist']); }
|
Zeile 2883 | Zeile 2924 |
---|
$users = array_map("trim", $users); $users = array_unique($users); foreach($users as $key => $username)
|
$users = array_map("trim", $users); $users = array_unique($users); foreach($users as $key => $username)
|
{
| {
|
if(empty($username)) { unset($users[$key]);
| if(empty($username)) { unset($users[$key]);
|
Zeile 2905 | Zeile 2946 |
---|
while($req = $db->fetch_array($query)) { $requests[$req['touid']] = true;
|
while($req = $db->fetch_array($query)) { $requests[$req['touid']] = true;
|
}
| }
|
// Get the requests we have received that are still pending $query = $db->simple_select('buddyrequests', 'uid', 'touid='.(int)$mybb->user['uid']);
| // Get the requests we have received that are still pending $query = $db->simple_select('buddyrequests', 'uid', 'touid='.(int)$mybb->user['uid']);
|
Zeile 2952 | Zeile 2993 |
---|
if(in_array($user['uid'], $selected_list)) { $string .= "_alt";
|
if(in_array($user['uid'], $selected_list)) { $string .= "_alt";
|
}
| }
|
$error_message = $lang->$string; array_pop($users); // To maintain a proper count when we call count($users)
| $error_message = $lang->$string; array_pop($users); // To maintain a proper count when we call count($users)
|
Zeile 2968 | Zeile 3009 |
---|
elseif($mybb->get_input('manage') == "ignored") { $error_message = $lang->users_already_sent_request_alt;
|
elseif($mybb->get_input('manage') == "ignored") { $error_message = $lang->users_already_sent_request_alt;
|
}
array_pop($users); // To maintain a proper count when we call count($users) continue;
| }
array_pop($users); // To maintain a proper count when we call count($users) continue;
|
}
if(isset($requests_rec[$user['uid']]))
| }
if(isset($requests_rec[$user['uid']]))
|
Zeile 2987 | Zeile 3028 |
---|
array_pop($users); // To maintain a proper count when we call count($users) continue;
|
array_pop($users); // To maintain a proper count when we call count($users) continue;
|
}
| }
|
// Do we have auto approval set to On? if($user['buddyrequestsauto'] == 1 && $mybb->get_input('manage') != "ignored") {
| // Do we have auto approval set to On? if($user['buddyrequestsauto'] == 1 && $mybb->get_input('manage') != "ignored") {
|
Zeile 2997 | Zeile 3038 |
---|
$pm = array( 'subject' => 'buddyrequest_new_buddy', 'message' => 'buddyrequest_new_buddy_message',
|
$pm = array( 'subject' => 'buddyrequest_new_buddy', 'message' => 'buddyrequest_new_buddy_message',
|
'touid' => $user['uid'], 'receivepms' => (int)$user['buddyrequestspm'], 'language' => $user['language'], 'language_file' => 'usercp' );
send_pm($pm); }
| 'touid' => $user['uid'], 'receivepms' => (int)$user['buddyrequestspm'], 'language' => $user['language'], 'language_file' => 'usercp' );
send_pm($pm); }
|
elseif($user['buddyrequestsauto'] != 1 && $mybb->get_input('manage') != "ignored") { // Send request
| elseif($user['buddyrequestsauto'] != 1 && $mybb->get_input('manage') != "ignored") { // Send request
|
Zeile 3020 | Zeile 3061 |
---|
);
send_pm($pm);
|
);
send_pm($pm);
|
|
|
$sent = true; } elseif($mybb->get_input('manage') == "ignored")
| $sent = true; } elseif($mybb->get_input('manage') == "ignored")
|
Zeile 3035 | Zeile 3076 |
---|
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 3045 | Zeile 3086 |
---|
if($mybb->get_input('manage') == "ignored") { $message = $lang->users_added_to_ignore_list;
|
if($mybb->get_input('manage') == "ignored") { $message = $lang->users_added_to_ignore_list;
|
}
| }
|
else { $message = $lang->users_added_to_buddy_list;
| else { $message = $lang->users_added_to_buddy_list;
|
Zeile 3053 | Zeile 3094 |
---|
}
if($adding_self == true)
|
}
if($adding_self == true)
|
{
| {
|
if($mybb->get_input('manage') == "ignored")
|
if($mybb->get_input('manage') == "ignored")
|
{
| {
|
$error_message = $lang->cant_add_self_to_ignore_list; } else { $error_message = $lang->cant_add_self_to_buddy_list;
|
$error_message = $lang->cant_add_self_to_ignore_list; } else { $error_message = $lang->cant_add_self_to_buddy_list;
|
}
| }
|
}
|
}
|
|
|
if(count($existing_users) == 0) { $message = "";
if($sent === true)
|
if(count($existing_users) == 0) { $message = "";
if($sent === true)
|
{
| {
|
$message = $lang->buddyrequests_sent_success; } }
| $message = $lang->buddyrequests_sent_success; } }
|
Zeile 3101 | Zeile 3142 |
---|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
|
// Now we have the new list, so throw it all back together $new_list = implode(",", $user['buddylist']);
|
|
|
// And clean it up a little to ensure there is no possibility of bad values $new_list = preg_replace("#,{2,}#", ",", $new_list); $new_list = preg_replace("#[^0-9,]#", "", $new_list);
| // And clean it up a little to ensure there is no possibility of bad values $new_list = preg_replace("#,{2,}#", ",", $new_list); $new_list = preg_replace("#[^0-9,]#", "", $new_list);
|
Zeile 3197 | Zeile 3238 |
---|
{ echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n"; echo "\$(\"#buddylink\").remove();\n";
|
{ echo "\$(\"#".$mybb->get_input('manage')."_count\").html(\"0\");\n"; echo "\$(\"#buddylink\").remove();\n";
|
|
|
if($mybb->get_input('manage') == "ignored") { echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";
| if($mybb->get_input('manage') == "ignored") { echo "\$(\"#ignore_list\").html(\"<li>{$lang->ignore_list_empty}</li>\");\n";
|
Zeile 3326 | Zeile 3367 |
---|
eval("\$sent_requests = \"".$templates->get("usercp_editlists_sent_requests", 1, 0)."\";");
|
eval("\$sent_requests = \"".$templates->get("usercp_editlists_sent_requests", 1, 0)."\";");
|
echo $sentrequests;
| |
echo $sent_requests."<script type=\"text/javascript\">{$message_js}</script>"; } else
| echo $sent_requests."<script type=\"text/javascript\">{$message_js}</script>"; } else
|
Zeile 3338 | Zeile 3378 |
---|
exit; }
|
exit; }
|
$received_rows = '';
| $received_rows = $bgcolor = '';
|
$query = $db->query(" SELECT r.*, u.username FROM ".TABLE_PREFIX."buddyrequests r
| $query = $db->query(" SELECT r.*, u.username FROM ".TABLE_PREFIX."buddyrequests r
|
Zeile 3360 | Zeile 3400 |
---|
eval("\$received_requests = \"".$templates->get("usercp_editlists_received_requests")."\";");
|
eval("\$received_requests = \"".$templates->get("usercp_editlists_received_requests")."\";");
|
$sent_rows = '';
| $sent_rows = $bgcolor = '';
|
$query = $db->query(" SELECT r.*, u.username FROM ".TABLE_PREFIX."buddyrequests r
| $query = $db->query(" SELECT r.*, u.username FROM ".TABLE_PREFIX."buddyrequests r
|
Zeile 3407 | Zeile 3447 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid) WHERE p.uid = '{$mybb->user['uid']}' AND p.visible = '-2'
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid) LEFT JOIN ".TABLE_PREFIX."forums f ON (f.fid=t.fid) WHERE p.uid = '{$mybb->user['uid']}' AND p.visible = '-2'
|
ORDER BY p.dateline DESC
| ORDER BY p.dateline DESC, p.pid DESC
|
");
while($draft = $db->fetch_array($query))
| ");
while($draft = $db->fetch_array($query))
|
Zeile 3431 | Zeile 3471 |
---|
$editurl = "newthread.php?action=editdraft&tid={$draft['tid']}"; $id = $draft['tid']; $type = "thread";
|
$editurl = "newthread.php?action=editdraft&tid={$draft['tid']}"; $id = $draft['tid']; $type = "thread";
|
}
| }
|
$draft['subject'] = htmlspecialchars_uni($draft['subject']); $savedate = my_date('relative', $draft['dateline']); eval("\$drafts .= \"".$templates->get("usercp_drafts_draft")."\";");
|
$draft['subject'] = htmlspecialchars_uni($draft['subject']); $savedate = my_date('relative', $draft['dateline']); eval("\$drafts .= \"".$templates->get("usercp_drafts_draft")."\";");
|
} } else
| } } else
|
{ $disable_delete_drafts = 'disabled="disabled"'; eval("\$drafts = \"".$templates->get("usercp_drafts_none")."\";");
| { $disable_delete_drafts = 'disabled="disabled"'; eval("\$drafts = \"".$templates->get("usercp_drafts_none")."\";");
|
Zeile 3469 | Zeile 3509 |
---|
foreach($mybb->input['deletedraft'] as $id => $val) { if($val == "post")
|
foreach($mybb->input['deletedraft'] as $id => $val) { if($val == "post")
|
{
| {
|
$pidin[] = "'".(int)$id."'"; } elseif($val == "thread")
| $pidin[] = "'".(int)$id."'"; } elseif($val == "thread")
|
Zeile 3482 | Zeile 3522 |
---|
$tidin = implode(",", $tidin); $db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'"); $tidinp = "OR tid IN ($tidin)";
|
$tidin = implode(",", $tidin); $db->delete_query("threads", "tid IN ($tidin) AND visible='-2' AND uid='".$mybb->user['uid']."'"); $tidinp = "OR tid IN ($tidin)";
|
| } else { $tidinp = '';
|
} if($pidin || $tidinp) {
| } if($pidin || $tidinp) {
|
Zeile 3606 | Zeile 3650 |
---|
if($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4) { $reasonlength = my_strlen($mybb->get_input('reason'));
|
if($mybb->get_input('do') == "joingroup" && $usergroup['type'] == 4) { $reasonlength = my_strlen($mybb->get_input('reason'));
|
|
|
if($reasonlength > 250) // Reason field is varchar(250) in database { error($lang->sprintf($lang->joinreason_too_long, ($reasonlength - 250)));
| if($reasonlength > 250) // Reason field is varchar(250) in database { error($lang->sprintf($lang->joinreason_too_long, ($reasonlength - 250)));
|
Zeile 3745 | Zeile 3789 |
---|
$usergroup = $usergroups[$mybb->user['usergroup']]; $usergroup['title'] = htmlspecialchars_uni($usergroup['title']); $usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);
|
$usergroup = $usergroups[$mybb->user['usergroup']]; $usergroup['title'] = htmlspecialchars_uni($usergroup['title']); $usergroup['usertitle'] = htmlspecialchars_uni($usergroup['usertitle']);
|
$usergroup['description'] = htmlspecialchars_uni($usergroup['description']);
| if($usergroup['description']) { $usergroup['description'] = htmlspecialchars_uni($usergroup['description']); eval("\$description = \"".$templates->get("usercp_usergroups_memberof_usergroup_description")."\";"); }
|
eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveprimary")."\";"); $trow = alt_trow(); if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])
|
eval("\$leavelink = \"".$templates->get("usercp_usergroups_memberof_usergroup_leaveprimary")."\";"); $trow = alt_trow(); if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])
|
{
| {
|
eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_display")."\";");
|
eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_display")."\";");
|
}
| }
|
elseif($usergroup['candisplaygroup'] == 1) { eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");
| elseif($usergroup['candisplaygroup'] == 1) { eval("\$displaycode = \"".$templates->get("usercp_usergroups_memberof_usergroup_setdisplay")."\";");
|
Zeile 3759 | Zeile 3807 |
---|
else { $displaycode = '';
|
else { $displaycode = '';
|
}
| }
|
eval("\$memberoflist = \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";"); $showmemberof = false;
| eval("\$memberoflist = \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";"); $showmemberof = false;
|
Zeile 3952 | Zeile 4000 |
---|
if($page > 0) { $start = ($page-1) * $perpage;
|
if($page > 0) { $start = ($page-1) * $perpage;
|
} else {
| } else {
|
$start = 0; $page = 1; }
| $start = 0; $page = 1; }
|
Zeile 3968 | Zeile 4016 |
---|
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']."' {$f_perm_sql}
|
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']."' {$f_perm_sql}
|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage}
| ORDER BY p.dateline DESC, p.pid DESC LIMIT {$start}, {$perpage}
|
");
$bandwidth = $totaldownloads = $totalusage = $totalattachments = $processedattachments = 0;
| ");
$bandwidth = $totaldownloads = $totalusage = $totalattachments = $processedattachments = 0;
|
Zeile 4005 | Zeile 4053 |
---|
++$processedattachments; }
|
++$processedattachments; }
|
| $multipage = '';
|
if($processedattachments >= $perpage || $page > 1) { $query = $db->query("
| if($processedattachments >= $perpage || $page > 1) { $query = $db->query("
|
Zeile 4017 | Zeile 4066 |
---|
$usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount'];
|
$usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount'];
|
|
|
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
|
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
|
}
| }
|
$friendlyusage = get_friendly_size((int)$totalusage); if($mybb->usergroup['attachquota'])
| $friendlyusage = get_friendly_size((int)$totalusage); if($mybb->usergroup['attachquota'])
|
Zeile 4028 | Zeile 4077 |
---|
$friendlyusage .= $lang->sprintf($lang->attachments_usage_percent, $percent); $attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024); $usagenote = $lang->sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $totalattachments);
|
$friendlyusage .= $lang->sprintf($lang->attachments_usage_percent, $percent); $attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024); $usagenote = $lang->sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $totalattachments);
|
}
| }
|
else { $attachquota = $lang->unlimited;
| else { $attachquota = $lang->unlimited;
|
Zeile 4036 | Zeile 4085 |
---|
}
$bandwidth = get_friendly_size($bandwidth);
|
}
$bandwidth = get_friendly_size($bandwidth);
|
| eval("\$delete_button = \"".$templates->get("delete_attachments_button")."\";");
|
if(!$attachments) { eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";"); $usagenote = '';
|
if(!$attachments) { eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";"); $usagenote = '';
|
| $delete_button = '';
|
}
$plugins->run_hooks("usercp_attachments_end");
| }
$plugins->run_hooks("usercp_attachments_end");
|
Zeile 4261 | Zeile 4313 |
---|
$mybb->user['posts'] = my_number_format($mybb->user['postnum']);
// Build referral link
|
$mybb->user['posts'] = my_number_format($mybb->user['postnum']);
// Build referral link
|
| $referral_info = '';
|
if($mybb->settings['usereferrals'] == 1) { $referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);
| if($mybb->settings['usereferrals'] == 1) { $referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']);
|
Zeile 4286 | Zeile 4339 |
---|
$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)
| $where = array( "s.uid={$mybb->user['uid']}", "t.lastposteruid!={$mybb->user['uid']}", get_visible_where('t') );
if($unviewable_forums = get_unviewable_forums(true)) { $where[] = "t.fid NOT IN ({$unviewable_forums})"; } if($inactive_forums = get_inactive_forums())
|
{
|
{
|
$visible = '';
| $where[] = "t.fid NOT IN ({$inactive_forums})";
|
}
|
}
|
| $where = implode(' AND ', $where);
|
$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']."' {$visible}
| WHERE {$where}
|
ORDER BY t.lastpost DESC LIMIT 0, 10 ");
|
ORDER BY t.lastpost DESC LIMIT 0, 10 ");
|
|
|
$fpermissions = forum_permissions();
|
$fpermissions = forum_permissions();
|
|
|
while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
if($forumpermissions['canview'] != 0 && $forumpermissions['canviewthreads'] != 0 && ($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid']))
| if($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid'])
|
{ $subscriptions[$subscription['tid']] = $subscription; }
| { $subscriptions[$subscription['tid']] = $subscription; }
|
Zeile 4346 | Zeile 4413 |
---|
$icon_cache = $cache->read("posticons"); $threadprefixes = build_prefixes();
|
$icon_cache = $cache->read("posticons"); $threadprefixes = build_prefixes();
|
| $latest_subscribed_threads = '';
|
foreach($subscriptions as $thread) {
| foreach($subscriptions as $thread) {
|
Zeile 4386 | Zeile 4454 |
---|
$icon = " "; }
|
$icon = " "; }
|
if($thread['doticon'])
| if(!isset($thread['doticon']))
|
{ $folder = "dot_"; $folder_label .= $lang->icon_dot; }
// Check to see which icon we display
|
{ $folder = "dot_"; $folder_label .= $lang->icon_dot; }
// Check to see which icon we display
|
if($thread['lastread'] && $thread['lastread'] < $thread['lastpost'])
| if(!empty($thread['lastread']) && $thread['lastread'] < $thread['lastpost'])
|
{ $folder .= "new"; $folder_label .= $lang->icon_new;
| { $folder .= "new"; $folder_label .= $lang->icon_new;
|
Zeile 4405 | Zeile 4473 |
---|
{ $folder_label .= $lang->icon_no_new; $new_class = "subject_old";
|
{ $folder_label .= $lang->icon_no_new; $new_class = "subject_old";
|
}
$folder .= "folder";
| }
$folder .= "folder";
|
if($thread['visible'] == 0) { $bgcolor = "trow_shaded";
|
if($thread['visible'] == 0) { $bgcolor = "trow_shaded";
|
}
| }
|
$lastpostdate = my_date('relative', $thread['lastpost']); $lastposteruid = $thread['lastposteruid']; if(!$lastposteruid && !$thread['lastposter'])
|
$lastpostdate = my_date('relative', $thread['lastpost']); $lastposteruid = $thread['lastposteruid']; if(!$lastposteruid && !$thread['lastposter'])
|
{
| {
|
$lastposter = htmlspecialchars_uni($lang->guest);
|
$lastposter = htmlspecialchars_uni($lang->guest);
|
} else {
| } else {
|
$lastposter = htmlspecialchars_uni($thread['lastposter']); }
| $lastposter = htmlspecialchars_uni($thread['lastposter']); }
|
Zeile 4444 | Zeile 4512 |
---|
} eval("\$latest_subscribed = \"".$templates->get("usercp_latest_subscribed")."\";"); }
|
} eval("\$latest_subscribed = \"".$templates->get("usercp_latest_subscribed")."\";"); }
|
} }
| } }
|
// User's Latest Threads
|
// User's Latest Threads
|
| $where = array( "t.uid={$mybb->user['uid']}", get_visible_where('t') );
|
|
|
// Get unviewable forums $f_perm_sql = ''; $unviewable_forums = get_unviewable_forums(); $inactiveforums = get_inactive_forums(); if($unviewable_forums) { $f_perm_sql = " AND t.fid NOT IN ($unviewable_forums)"; } if($inactiveforums)
| if($unviewable_forums = get_unviewable_forums(true))
|
{
|
{
|
$f_perm_sql .= " AND t.fid NOT IN ($inactiveforums)";
| $where[] = "t.fid NOT IN ({$unviewable_forums})";
|
}
|
}
|
$visible = " AND t.visible != 0"; if(is_moderator() == true)
| if($inactive_forums = get_inactive_forums())
|
{
|
{
|
$visible = '';
| $where[] = "t.fid NOT IN ({$inactive_forums})";
|
}
|
}
|
| $where = implode(' AND ', $where);
|
$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']."' AND t.firstpost != 0 AND t.visible >= 0 {$visible}{$f_perm_sql}
| WHERE {$where}
|
ORDER BY t.lastpost DESC LIMIT 0, 5 ");
| ORDER BY t.lastpost DESC LIMIT 0, 5 ");
|
Zeile 4482 | Zeile 4547 |
---|
$fpermissions = forum_permissions(); while($thread = $db->fetch_array($query)) {
|
$fpermissions = forum_permissions(); while($thread = $db->fetch_array($query)) {
|
// Moderated, and not moderator? if($thread['visible'] == 0 && is_moderator($thread['fid'], "canviewunapprove") === false) { continue; }
$forumpermissions = $fpermissions[$thread['fid']]; if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0) { $threadcache[$thread['tid']] = $thread; }
| $threadcache[$thread['tid']] = $thread;
|
}
$latest_threads = '';
| }
$latest_threads = '';
|
Zeile 4542 | Zeile 4597 |
---|
$latest_threads_threads = ''; foreach($threadcache as $thread) {
|
$latest_threads_threads = ''; foreach($threadcache as $thread) {
|
$plugins->run_hooks("usercp_latest_threads_thread");
| $plugins->run_hooks("usercp_latest_threads_thread");
|
if($thread['tid']) { $bgcolor = alt_trow();
| if($thread['tid']) { $bgcolor = alt_trow();
|
Zeile 4604 | Zeile 4659 |
---|
$cutoff = 0; if($thread['lastpost'] > $cutoff) {
|
$cutoff = 0; if($thread['lastpost'] > $cutoff) {
|
if($thread['lastread'])
| if(!empty($thread['lastread']))
|
{ $lastread = $thread['lastread']; }
| { $lastread = $thread['lastread']; }
|