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 5616 2011-09-20 13:24:59Z Tomm $
| * $Id$
|
*/
define("IN_MYBB", 1); define('THIS_SCRIPT', 'usercp.php');
|
*/
define("IN_MYBB", 1); define('THIS_SCRIPT', 'usercp.php');
|
$templatelist = "usercp,usercp_home,usercp_nav,usercp_profile,error_nopermission,buddy_online,buddy_offline,usercp_changename,usercp_nav_changename";
| $templatelist = "usercp,usercp_nav,usercp_profile,usercp_changename,usercp_email,usercp_password,usercp_subscriptions_thread,forumbit_depth2_forum_lastpost,usercp_forumsubscriptions_forum";
|
$templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups"; $templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_usergroups_leader_usergroup,usercp_usergroups_leader,usercp_currentavatar,usercp_reputation";
|
$templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups"; $templatelist .= ",usercp_nav_messenger,usercp_nav_changename,usercp_nav_profile,usercp_nav_misc,usercp_usergroups_leader_usergroup,usercp_usergroups_leader,usercp_currentavatar,usercp_reputation";
|
$templatelist .= ",usercp_attachments_attachment,usercp_attachments,usercp_profile_away,usercp_profile_customfield,usercp_profile_profilefields,usercp_profile_customtitle,usercp_forumsubscriptions_none,usercp_forumsubscriptions,usercp_subscriptions_none,usercp_subscriptions,usercp_options_pms_from_buddys,usercp_options_tppselect,usercp_options_pppselect,usercp_options";
| $templatelist .= ",usercp_attachments_attachment,usercp_attachments,usercp_profile_away,usercp_profile_customfield,usercp_profile_profilefields,usercp_profile_customtitle,usercp_forumsubscriptions_none"; $templatelist .= ",usercp_forumsubscriptions,usercp_subscriptions_none,usercp_subscriptions,usercp_options_pms_from_buddys,usercp_options_tppselect,usercp_options_pppselect,usercp_options";
|
$templatelist .= ",usercp_nav_editsignature,usercp_referrals,usercp_notepad,usercp_latest_threads_threads,forumdisplay_thread_gotounread,usercp_latest_threads,usercp_subscriptions_remove";
|
$templatelist .= ",usercp_nav_editsignature,usercp_referrals,usercp_notepad,usercp_latest_threads_threads,forumdisplay_thread_gotounread,usercp_latest_threads,usercp_subscriptions_remove";
|
| $templatelist .= ",usercp_editsig_suspended,usercp_editsig,usercp_avatar_gallery_avatar,usercp_avatar_gallery_blankblock,usercp_avatar_gallery_noavatars,usercp_avatar_gallery,usercp_avatar_current"; $templatelist .= ",usercp_avatar,usercp_editlists_userusercp_editlists,usercp_drafts_draft,usercp_drafts_none,usercp_drafts_submit,usercp_drafts,usercp_usergroups_joingroup,usercp_attachments_none"; $templatelist .= ",usercp_warnings_warning,usercp_warnings,usercp_latest_subscribed_threads,usercp_latest_subscribed,usercp_nav_messenger_tracking,multipage_prevpage,multipage_start,multipage_end"; $templatelist .= ",multipage_nextpage,multipage,multipage_page_current,codebuttons,smilieinsert_getmore,smilieinsert";
|
require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
| require_once "./global.php"; require_once MYBB_ROOT."inc/functions_post.php";
|
Zeile 39 | Zeile 44 |
---|
}
$errors = '';
|
}
$errors = '';
|
| if(!isset($mybb->input['action'])) { $mybb->input['action'] = ''; }
$collapse_options = array('usercppms', 'usercpprofile', 'usercpmisc'); foreach($collapse_options as $option) { if(!isset($collapsedimg[$option])) { $collapsedimg[$option] = ''; } if(!isset($collapsed[$option.'_e'])) { $collapsed[$option.'_e'] = ''; } }
|
usercp_menu();
| usercp_menu();
|
Zeile 120 | Zeile 143 |
---|
case "email": case "do_email": add_breadcrumb($lang->nav_email);
|
case "email": case "do_email": add_breadcrumb($lang->nav_email);
|
break;
| break;
|
case "password": case "do_password": add_breadcrumb($lang->nav_password);
| case "password": case "do_password": add_breadcrumb($lang->nav_password);
|
Zeile 183 | Zeile 206 |
---|
{ $mybb->input['awayyear'] = my_date('Y', $awaydate); }
|
{ $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 = min(intval($mybb->input['awayyear']), 9999);
| $return_month = intval(substr($mybb->input['awaymonth'], 0, 2)); $return_day = intval(substr($mybb->input['awayday'], 0, 2)); $return_year = min(intval($mybb->input['awayyear']), 9999);
|
Zeile 195 | Zeile 218 |
---|
{ error($lang->error_usercp_return_date_past); }
|
{ error($lang->error_usercp_return_date_past); }
|
|
|
$returndate = "{$return_day}-{$return_month}-{$return_year}"; } else
| $returndate = "{$return_day}-{$return_month}-{$return_year}"; } else
|
Zeile 231 | Zeile 254 |
---|
$user = array( "uid" => $mybb->user['uid'],
|
$user = array( "uid" => $mybb->user['uid'],
|
| "postnum" => $mybb->user['postnum'],
|
"website" => $mybb->input['website'], "icq" => intval($mybb->input['icq']), "aim" => $mybb->input['aim'],
| "website" => $mybb->input['website'], "icq" => intval($mybb->input['icq']), "aim" => $mybb->input['aim'],
|
Zeile 258 | Zeile 282 |
---|
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
|
if(!$userhandler->validate_user()) { $errors = $userhandler->get_friendly_errors();
|
| // Set allowed value otherwise select options disappear if(in_array($lang->userdata_invalid_birthday_privacy, $errors)) { $mybb->input['birthdayprivacy'] = 'none'; }
|
$errors = inline_error($errors); $mybb->input['action'] = "profile"; }
| $errors = inline_error($errors); $mybb->input['action'] = "profile"; }
|
Zeile 403 | Zeile 434 |
---|
while($profilefield = $db->fetch_array($query)) { // Does this field have a minimum post count?
|
while($profilefield = $db->fetch_array($query)) { // Does this field have a minimum post count?
|
if($profilefield['postnum'] && $profilefield['postnum'] > $user['postnum'])
| if($profilefield['postnum'] && $profilefield['postnum'] > $mybb->user['postnum'])
|
{ continue; }
| { continue; }
|
Zeile 575 | Zeile 606 |
---|
{ if($mybb->usergroup['usertitle'] == "") {
|
{ if($mybb->usergroup['usertitle'] == "") {
|
$query = $db->simple_select("usertitles", "*", "posts <='".$mybb->user['postnum']."'", array('order_by' => 'posts', 'order_dir' => 'DESC', 'limit' => 1)); $utitle = $db->fetch_array($query); $defaulttitle = $utitle['title'];
| $defaulttitle = ''; $usertitles = $cache->read('usertitles');
foreach($usertitles as $title) { if($title['posts'] <= $mybb->user['postnum']) { $defaulttitle = $title['title']; break; } }
|
} else {
| } else {
|
Zeile 587 | Zeile 626 |
---|
if(trim($user['usertitle']) == '') { $lang->current_custom_usertitle = '';
|
if(trim($user['usertitle']) == '') { $lang->current_custom_usertitle = '';
|
}
| }
|
else { if($errors)
| else { if($errors)
|
Zeile 602 | Zeile 641 |
---|
{ $customtitle = ""; }
|
{ $customtitle = ""; }
|
|
|
$plugins->run_hooks("usercp_profile_end");
|
$plugins->run_hooks("usercp_profile_end");
|
|
|
eval("\$editprofile = \"".$templates->get("usercp_profile")."\";"); output_page($editprofile); }
| eval("\$editprofile = \"".$templates->get("usercp_profile")."\";"); output_page($editprofile); }
|
Zeile 728 | Zeile 767 |
---|
else { $hideemailcheck = "";
|
else { $hideemailcheck = "";
|
}
| }
|
if($user['subscriptionmethod'] == 1) { $no_email_subscribe_selected = "selected=\"selected\"";
| if($user['subscriptionmethod'] == 1) { $no_email_subscribe_selected = "selected=\"selected\"";
|
Zeile 738 | Zeile 777 |
---|
{ $instant_email_subscribe_selected = "selected=\"selected\""; }
|
{ $instant_email_subscribe_selected = "selected=\"selected\""; }
|
else
{ $no_subscribe_selected = "selected=\"selected\""; }
| else
{ $no_subscribe_selected = "selected=\"selected\""; }
|
if($user['showsigs'] == 1) { $showsigscheck = "checked=\"checked\"";
|
if($user['showsigs'] == 1) { $showsigscheck = "checked=\"checked\"";
|
} else
| } else
|
{ $showsigscheck = ""; }
| { $showsigscheck = ""; }
|
Zeile 765 | Zeile 804 |
---|
if($user['showquickreply'] == 1) { $showquickreplycheck = "checked=\"checked\"";
|
if($user['showquickreply'] == 1) { $showquickreplycheck = "checked=\"checked\"";
|
} else
| } else
|
{ $showquickreplycheck = ""; }
| { $showquickreplycheck = ""; }
|
Zeile 774 | Zeile 813 |
---|
if($user['receivepms'] == 1) { $receivepmscheck = "checked=\"checked\"";
|
if($user['receivepms'] == 1) { $receivepmscheck = "checked=\"checked\"";
|
} else {
| } else {
|
$receivepmscheck = ""; }
|
$receivepmscheck = ""; }
|
|
|
if($user['receivefrombuddy'] == 1) { $receivefrombuddycheck = "checked=\"checked\"";
| if($user['receivefrombuddy'] == 1) { $receivefrombuddycheck = "checked=\"checked\"";
|
Zeile 796 | Zeile 835 |
---|
else { $pmnoticecheck = "";
|
else { $pmnoticecheck = "";
|
}
| }
|
if($user['dstcorrection'] == 2) {
| if($user['dstcorrection'] == 2) {
|
Zeile 805 | Zeile 844 |
---|
else if($user['dstcorrection'] == 1) { $dst_enabled_selected = "selected=\"selected\"";
|
else if($user['dstcorrection'] == 1) { $dst_enabled_selected = "selected=\"selected\"";
|
}
| }
|
else { $dst_disabled_selected = "selected=\"selected\"";
|
else { $dst_disabled_selected = "selected=\"selected\"";
|
}
| }
|
if($user['showcodebuttons'] == 1) { $showcodebuttonscheck = "checked=\"checked\"";
|
if($user['showcodebuttons'] == 1) { $showcodebuttonscheck = "checked=\"checked\"";
|
} else
| } else
|
{ $showcodebuttonscheck = "";
|
{ $showcodebuttonscheck = "";
|
}
| }
|
if($user['showredirect'] != 0) { $showredirectcheck = "checked=\"checked\"";
|
if($user['showredirect'] != 0) { $showredirectcheck = "checked=\"checked\"";
|
} else
| } else
|
{ $showredirectcheck = ""; }
| { $showredirectcheck = ""; }
|
Zeile 838 | Zeile 877 |
---|
$pmnotifycheck = ''; }
|
$pmnotifycheck = ''; }
|
|
|
if($user['threadmode'] != "threaded" && $user['threadmode'] != "linear") { $user['threadmode'] = ''; // Leave blank to show default
|
if($user['threadmode'] != "threaded" && $user['threadmode'] != "linear") { $user['threadmode'] = ''; // Leave blank to show default
|
}
| }
|
if($user['classicpostbit'] != 0) { $classicpostbitcheck = "checked=\"checked\"";
| if($user['classicpostbit'] != 0) { $classicpostbitcheck = "checked=\"checked\"";
|
Zeile 851 | Zeile 890 |
---|
else { $classicpostbitcheck = '';
|
else { $classicpostbitcheck = '';
|
}
| }
|
$date_format_options = "<option value=\"0\">{$lang->use_default}</option>"; foreach($date_formats as $key => $format) { if($user['dateformat'] == $key) { $date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";
|
$date_format_options = "<option value=\"0\">{$lang->use_default}</option>"; foreach($date_formats as $key => $format) { if($user['dateformat'] == $key) { $date_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>";
|
} else {
| } else {
|
$date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>"; } }
| $date_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>"; } }
|
Zeile 871 | Zeile 910 |
---|
foreach($time_formats as $key => $format) { if($user['timeformat'] == $key)
|
foreach($time_formats as $key => $format) { if($user['timeformat'] == $key)
|
{
| {
|
$time_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>"; } else
| $time_format_options .= "<option value=\"$key\" selected=\"selected\">".my_date($format, TIME_NOW, "", 0)."</option>"; } else
|
Zeile 881 | Zeile 920 |
---|
}
$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);
|
}
$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);
|
|
|
if($mybb->settings['allowbuddyonly'] == 1) { eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";");
| if($mybb->settings['allowbuddyonly'] == 1) { eval("\$pms_from_buddys = \"".$templates->get("usercp_options_pms_from_buddys")."\";");
|
Zeile 928 | Zeile 967 |
---|
} eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";"); }
|
} eval("\$pppselect = \"".$templates->get("usercp_options_pppselect")."\";"); }
|
|
|
$plugins->run_hooks("usercp_options_end");
|
$plugins->run_hooks("usercp_options_end");
|
|
|
eval("\$editprofile = \"".$templates->get("usercp_options")."\";"); output_page($editprofile); }
| eval("\$editprofile = \"".$templates->get("usercp_options")."\";"); output_page($editprofile); }
|
Zeile 1020 | Zeile 1059 |
---|
}
$plugins->run_hooks("usercp_email");
|
}
$plugins->run_hooks("usercp_email");
|
|
|
eval("\$changemail = \"".$templates->get("usercp_email")."\";"); output_page($changemail);
|
eval("\$changemail = \"".$templates->get("usercp_email")."\";"); output_page($changemail);
|
}
| }
|
if($mybb->input['action'] == "do_password" && $mybb->request_method == "post") { // Verify incoming POST request
| if($mybb->input['action'] == "do_password" && $mybb->request_method == "post") { // Verify incoming POST request
|
Zeile 1073 | Zeile 1112 |
---|
if($mybb->input['action'] == "password") { $plugins->run_hooks("usercp_password");
|
if($mybb->input['action'] == "password") { $plugins->run_hooks("usercp_password");
|
|
|
eval("\$editpassword = \"".$templates->get("usercp_password")."\";"); output_page($editpassword); }
| eval("\$editpassword = \"".$templates->get("usercp_password")."\";"); output_page($editpassword); }
|
Zeile 1132 | Zeile 1171 |
---|
{ error_no_permission(); }
|
{ error_no_permission(); }
|
|
|
$plugins->run_hooks("usercp_changename_end");
|
$plugins->run_hooks("usercp_changename_end");
|
|
|
eval("\$changename = \"".$templates->get("usercp_changename")."\";"); output_page($changename); }
| eval("\$changename = \"".$templates->get("usercp_changename")."\";"); output_page($changename); }
|
Zeile 1201 | Zeile 1240 |
---|
"); $threadcount = $db->fetch_field($query, "threads");
|
"); $threadcount = $db->fetch_field($query, "threads");
|
if(!$mybb->settings['threadsperpage'])
| if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
|
{ $mybb->settings['threadsperpage'] = 20; }
| { $mybb->settings['threadsperpage'] = 20; }
|
Zeile 1210 | Zeile 1249 |
---|
$page = intval($mybb->input['page']); if($page > 0) {
|
$page = intval($mybb->input['page']); if($page > 0) {
|
$start = ($page-1) *$perpage;
| $start = ($page-1) * $perpage; $pages = $threadcount / $perpage; $pages = ceil($pages); if($page > $pages || $page <= 0) { $start = 0; $page = 1; }
|
} else {
| } else {
|
Zeile 1242 | Zeile 1288 |
---|
{ $forumpermissions = $fpermissions[$subscription['fid']];
|
{ $forumpermissions = $fpermissions[$subscription['fid']];
|
if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
| if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0 || ($forumpermissions['canonlyviewownthreads'] != 0 && $subscription['uid'] != $mybb->user['uid']))
|
{ // Hmm, you don't have permission to view this thread - unsubscribe!
|
{ // Hmm, you don't have permission to view this thread - unsubscribe!
|
$del_subscriptions[] = $subscription['tid'];
| $del_subscriptions[] = $subscription['sid'];
|
} else if($subscription['tid']) { $subscriptions[$subscription['tid']] = $subscription;
|
} else if($subscription['tid']) { $subscriptions[$subscription['tid']] = $subscription;
|
} }
| } }
|
if(is_array($del_subscriptions))
|
if(is_array($del_subscriptions))
|
{ $tids = implode(',', $del_subscriptions); if($tids)
| { $sids = implode(',', $del_subscriptions);
if($sids) { $db->delete_query("threadsubscriptions", "sid IN ({$sids}) AND uid='{$mybb->user['uid']}'"); }
$threadcount = $threadcount - count($del_subscriptions);
if($threadcount < 0)
|
{
|
{
|
$db->delete_query("threadsubscriptions", "tid IN ({$tids}) AND uid='{$mybb->user['uid']}'");
| $threadcount = 0;
|
} }
if(is_array($subscriptions)) { $tids = implode(",", array_keys($subscriptions));
|
} }
if(is_array($subscriptions)) { $tids = implode(",", array_keys($subscriptions));
|
|
|
if($mybb->user['uid'] == 0) { // Build a forum cache.
| if($mybb->user['uid'] == 0) { // Build a forum cache.
|
Zeile 1275 | Zeile 1329 |
---|
WHERE active != 0 ORDER BY pid, disporder ");
|
WHERE active != 0 ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else {
| } else {
|
Zeile 1288 | Zeile 1342 |
---|
WHERE f.active != 0 ORDER BY pid, disporder ");
|
WHERE f.active != 0 ORDER BY pid, disporder ");
|
}
| }
|
while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0)
| while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0)
|
Zeile 1312 | Zeile 1367 |
---|
}
// Read threads
|
}
// Read threads
|
if($mybb->settings['threadreadcut'] > 0) { $query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
| if($mybb->settings['threadreadcut'] > 0) { $query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})");
|
while($readthread = $db->fetch_array($query)) { $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline']; } }
|
while($readthread = $db->fetch_array($query)) { $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline']; } }
|
$icon_cache = $cache->read("posticons");
| $icon_cache = $cache->read("posticons");
|
// Now we can build our subscription list foreach($subscriptions as $thread)
| // Now we can build our subscription list foreach($subscriptions as $thread)
|
Zeile 1330 | Zeile 1385 |
---|
$folder = ''; $prefix = '';
|
$folder = ''; $prefix = '';
|
|
|
// If this thread has a prefix, insert a space between prefix and subject if($thread['prefix'] != 0) { $thread['threadprefix'] .= ' '; }
|
// If this thread has a prefix, insert a space between prefix and subject if($thread['prefix'] != 0) { $thread['threadprefix'] .= ' '; }
|
|
|
// Sanitize $thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']);
| // Sanitize $thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']);
|
Zeile 1344 | Zeile 1399 |
---|
// Build our links $thread['threadlink'] = get_thread_link($thread['tid']); $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
|
// Build our links $thread['threadlink'] = get_thread_link($thread['tid']); $thread['lastpostlink'] = get_thread_link($thread['tid'], 0, "lastpost");
|
|
|
// Fetch the thread icon if we have one if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) { $icon = $icon_cache[$thread['icon']];
|
// Fetch the thread icon if we have one if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) { $icon = $icon_cache[$thread['icon']];
|
| $icon['path'] = htmlspecialchars_uni($icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']);
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else
| $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else
|
Zeile 1370 | Zeile 1427 |
---|
$isnew = 0; $donenew = 0; $lastread = 0;
|
$isnew = 0; $donenew = 0; $lastread = 0;
|
|
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) { $forum_read = $readforums[$thread['fid']];
|
if($mybb->settings['threadreadcut'] > 0 && $mybb->user['uid']) { $forum_read = $readforums[$thread['fid']];
|
|
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) {
| $read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) {
|
Zeile 1489 | Zeile 1546 |
---|
{ eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";"); }
|
{ eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";"); }
|
|
|
$plugins->run_hooks("usercp_subscriptions_end");
|
$plugins->run_hooks("usercp_subscriptions_end");
|
|
|
eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";"); output_page($subscriptions); }
|
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");
|
$query = $db->simple_select("forumpermissions", "*", "gid='".$db->escape_string($mybb->user['usergroup'])."'"); while($permissions = $db->fetch_array($query)) { $permissioncache[$permissions['gid']][$permissions['fid']] = $permissions; }
|
|
if($mybb->user['uid'] == 0) { // Build a forum cache.
| if($mybb->user['uid'] == 0) { // Build a forum cache.
|
Zeile 1513 | Zeile 1566 |
---|
WHERE active != 0 ORDER BY pid, disporder ");
|
WHERE active != 0 ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else {
| } else {
|
Zeile 1527 | Zeile 1580 |
---|
ORDER BY pid, disporder "); }
|
ORDER BY pid, disporder "); }
|
|
|
while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0)
| while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0)
|
Zeile 1534 | Zeile 1588 |
---|
if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']];
|
if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']];
|
} }
| } }
|
$readforums[$forum['fid']] = $forum['lastread']; }
|
$readforums[$forum['fid']] = $forum['lastread']; }
|
require_once MYBB_ROOT."inc/functions_forumlist.php";
|
|
$fpermissions = forum_permissions();
|
$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 1551 | Zeile 1605 |
---|
WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."' ORDER BY f.name ASC ");
|
WHERE f.type='f' AND fs.uid='".$mybb->user['uid']."' ORDER BY f.name ASC ");
|
|
|
$forums = ''; while($forum = $db->fetch_array($query)) { $forum_url = get_forum_link($forum['fid']); $forumpermissions = $fpermissions[$forum['fid']];
|
$forums = ''; while($forum = $db->fetch_array($query)) { $forum_url = get_forum_link($forum['fid']); $forumpermissions = $fpermissions[$forum['fid']];
|
if($forumpermissions['canview'] != 0)
| if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0) { continue; }
$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost'])); $folder = $lightbulb['folder'];
if($forumpermissions['canonlyviewownthreads'] != 0) { $posts = '-'; $threads = '-'; } else { $posts = my_number_format($forum['posts']); $threads = my_number_format($forum['threads']); }
if($forum['lastpost'] == 0 || $forum['lastposter'] == "") { $lastpost = "<div align=\"center\">{$lang->never}</div>"; } // Hide last post elseif($forumpermissions['canonlyviewownthreads'] != 0 && $forum['lastposteruid'] != $mybb->user['uid']) { $lastpost = "<div align=\"center\">{$lang->na}</div>"; } else
|
{
|
{
|
$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost'])); $folder = $lightbulb['folder']; if($forum['lastpost'] == 0 || $forum['lastposter'] == "")
| $forum['lastpostsubject'] = $parser->parse_badwords($forum['lastpostsubject']); $lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']); $lastpost_time = my_date($mybb->settings['timeformat'], $forum['lastpost']); $lastposttid = $forum['lastposttid']; $lastposter = $forum['lastposter']; $lastpost_profilelink = build_profile_link($lastposter, $forum['lastposteruid']); $lastpost_subject = htmlspecialchars_uni($forum['lastpostsubject']); if(my_strlen($lastpost_subject) > 25)
|
{
|
{
|
$lastpost = "<div align=\"center\">$lang->never</div>"; } else { $lastpost_date = my_date($mybb->settings['dateformat'], $forum['lastpost']); $lastpost_time = my_date($mybb->settings['timeformat'], $forum['lastpost']); $lastposttid = $forum['lastposttid']; $lastposter = $forum['lastposter']; $lastpost_profilelink = build_profile_link($lastposter, $forum['lastposteruid']); $lastpost_subject = $forum['lastpostsubject']; if(my_strlen($lastpost_subject) > 25) { $lastpost_subject = my_substr($lastpost_subject, 0, 25) . "..."; } $lastpost_link = get_thread_link($forum['lastposttid'], 0, "lastpost"); eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost")."\";");
| $lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";
|
}
|
}
|
| $lastpost_link = get_thread_link($forum['lastposttid'], 0, "lastpost"); eval("\$lastpost = \"".$templates->get("forumbit_depth2_forum_lastpost")."\";");
|
}
|
}
|
$posts = my_number_format($forum['posts']); $threads = my_number_format($forum['threads']);
|
|
if($mybb->settings['showdescriptions'] == 0) { $forum['description'] = ""; }
|
if($mybb->settings['showdescriptions'] == 0) { $forum['description'] = ""; }
|
|
|
eval("\$forums .= \"".$templates->get("usercp_forumsubscriptions_forum")."\";");
|
eval("\$forums .= \"".$templates->get("usercp_forumsubscriptions_forum")."\";");
|
}
| }
|
if(!$forums) { eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";"); }
|
if(!$forums) { eval("\$forums = \"".$templates->get("usercp_forumsubscriptions_none")."\";"); }
|
|
|
$plugins->run_hooks("usercp_forumsubscriptions_end");
|
$plugins->run_hooks("usercp_forumsubscriptions_end");
|
|
|
eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";"); output_page($forumsubscriptions); }
if($mybb->input['action'] == "do_editsig" && $mybb->request_method == "post")
|
eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";"); output_page($forumsubscriptions); }
if($mybb->input['action'] == "do_editsig" && $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']);
|
|
|
$plugins->run_hooks("usercp_do_editsig_start");
// User currently has a suspended signature if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW)
|
$plugins->run_hooks("usercp_do_editsig_start");
// User currently has a suspended signature if($mybb->user['suspendsignature'] == 1 && $mybb->user['suspendsigtime'] > TIME_NOW)
|
{ error_no_permission();
| { error_no_permission();
|
}
if($mybb->input['updateposts'] == "enable")
| }
if($mybb->input['updateposts'] == "enable")
|
Zeile 1678 | Zeile 1757 |
---|
"allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'], "me_username" => $mybb->user['username'],
|
"allow_smilies" => $mybb->settings['sigsmilies'], "allow_imgcode" => $mybb->settings['sigimgcode'], "me_username" => $mybb->user['username'],
|
| "filter_badwords" => 1
|
);
$sigpreview = $parser->parse_message($sig, $sig_parser);
| );
$sigpreview = $parser->parse_message($sig, $sig_parser);
|
Zeile 1688 | Zeile 1768 |
---|
if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW) { $plugins->run_hooks("usercp_editsig_end");
|
if($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW) { $plugins->run_hooks("usercp_editsig_end");
|
|
|
// User either doesn't have permission, or has their signature suspended eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";"); }
| // User either doesn't have permission, or has their signature suspended eval("\$editsig = \"".$templates->get("usercp_editsig_suspended")."\";"); }
|
Zeile 1735 | Zeile 1815 |
---|
{ $codebuttons = build_mycode_inserter("signature"); }
|
{ $codebuttons = build_mycode_inserter("signature"); }
|
|
|
$plugins->run_hooks("usercp_editsig_end");
|
$plugins->run_hooks("usercp_editsig_end");
|
|
|
eval("\$editsig = \"".$templates->get("usercp_editsig")."\";"); }
|
eval("\$editsig = \"".$templates->get("usercp_editsig")."\";"); }
|
|
|
output_page($editsig); }
| output_page($editsig); }
|
Zeile 1767 | Zeile 1847 |
---|
elseif($mybb->input['gallery']) // Gallery avatar { if(empty($mybb->input['avatar']))
|
elseif($mybb->input['gallery']) // Gallery avatar { if(empty($mybb->input['avatar']))
|
{
| {
|
$avatar_error = $lang->error_noavatar; }
|
$avatar_error = $lang->error_noavatar; }
|
|
|
$mybb->input['gallery'] = str_replace(array("./", ".."), "", $mybb->input['gallery']); $mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);
if(empty($avatar_error))
|
$mybb->input['gallery'] = str_replace(array("./", ".."), "", $mybb->input['gallery']); $mybb->input['avatar'] = str_replace(array("./", ".."), "", $mybb->input['avatar']);
if(empty($avatar_error))
|
{
| {
|
if($mybb->input['gallery'] == "default") { $avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']);
| if($mybb->input['gallery'] == "default") { $avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['avatar']);
|
Zeile 1795 | Zeile 1875 |
---|
"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']); } } elseif($_FILES['avatarupload']['name']) // upload avatar { if($mybb->usergroup['canuploadavatars'] == 0)
|
remove_avatars($mybb->user['uid']); } } elseif($_FILES['avatarupload']['name']) // upload avatar { if($mybb->usergroup['canuploadavatars'] == 0)
|
{
| {
|
error_no_permission(); } $avatar = upload_avatar();
| error_no_permission(); } $avatar = upload_avatar();
|
Zeile 1820 | Zeile 1900 |
---|
"avatar" => $avatar['avatar'].'?dateline='.TIME_NOW, "avatardimensions" => $avatar_dimensions, "avatartype" => "upload"
|
"avatar" => $avatar['avatar'].'?dateline='.TIME_NOW, "avatardimensions" => $avatar_dimensions, "avatartype" => "upload"
|
); $db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
| ); $db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
|
} } else // remote avatar
| } } else // remote avatar
|
Zeile 1975 | Zeile 2055 |
---|
for($i = $count; $i <= 5; ++$i) { eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_blankblock")."\";");
|
for($i = $count; $i <= 5; ++$i) { eval("\$avatarlist .= \"".$templates->get("usercp_avatar_gallery_blankblock")."\";");
|
} } }
| } } }
|
else { eval("\$avatarlist = \"".$templates->get("usercp_avatar_gallery_noavatars")."\";"); }
|
else { eval("\$avatarlist = \"".$templates->get("usercp_avatar_gallery_noavatars")."\";"); }
|
|
|
$plugins->run_hooks("usercp_avatar_end");
|
$plugins->run_hooks("usercp_avatar_end");
|
|
|
eval("\$gallery = \"".$templates->get("usercp_avatar_gallery")."\";"); output_page($gallery); }
| eval("\$gallery = \"".$templates->get("usercp_avatar_gallery")."\";"); output_page($gallery); }
|
Zeile 2037 | Zeile 2117 |
---|
{ $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>"; }
|
{ $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");
|
|
|
eval("\$avatar = \"".$templates->get("usercp_avatar")."\";"); output_page($avatar); } }
|
eval("\$avatar = \"".$templates->get("usercp_avatar")."\";"); output_page($avatar); } }
|
|
|
if($mybb->input['action'] == "do_editlists") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
if($mybb->input['action'] == "do_editlists") { // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
|
|
$plugins->run_hooks("usercp_do_editlists_start");
$existing_users = array(); $selected_list = array(); if($mybb->input['manage'] == "ignored")
|
$plugins->run_hooks("usercp_do_editlists_start");
$existing_users = array(); $selected_list = array(); if($mybb->input['manage'] == "ignored")
|
{
| {
|
if($mybb->user['ignorelist']) { $existing_users = explode(",", $mybb->user['ignorelist']);
|
if($mybb->user['ignorelist']) { $existing_users = explode(",", $mybb->user['ignorelist']);
|
}
| }
|
if($mybb->user['buddylist']) { // Create a list of buddies...
|
if($mybb->user['buddylist']) { // Create a list of buddies...
|
$selected_list = explode(",", $mybb->user['buddylist']); }
| $selected_list = explode(",", $mybb->user['buddylist']); }
|
} else {
| } else {
|
Zeile 2080 | Zeile 2160 |
---|
$selected_list = explode(",", $mybb->user['ignorelist']); } }
|
$selected_list = explode(",", $mybb->user['ignorelist']); } }
|
|
|
$error_message = ""; $message = "";
|
$error_message = ""; $message = "";
|
|
|
// Adding one or more users to this list if($mybb->input['add_username']) {
| // Adding one or more users to this list if($mybb->input['add_username']) {
|
Zeile 2141 | Zeile 2221 |
---|
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; }
|
|
|
$existing_users[] = $user['uid']; }
|
$existing_users[] = $user['uid']; }
|
| }
if($found_users < count($users)) { if($error_message) { $error_message .= "<br />"; }
$error_message .= $lang->invalid_user_selected;
|
}
if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))
|
}
if(($adding_self != true || ($adding_self == true && count($users) > 0)) && ($error_message == "" || count($users) > 1))
|
{ if($mybb->input['manage'] == "ignored")
| { if($mybb->input['manage'] == "ignored")
|
{ $message = $lang->users_added_to_ignore_list; }
| { $message = $lang->users_added_to_ignore_list; }
|
Zeile 2161 | Zeile 2251 |
---|
if($adding_self == true) { if($mybb->input['manage'] == "ignored")
|
if($adding_self == true) { if($mybb->input['manage'] == "ignored")
|
{
| {
|
$error_message = $lang->cant_add_self_to_ignore_list; } else
| $error_message = $lang->cant_add_self_to_ignore_list; } else
|
Zeile 2173 | Zeile 2263 |
---|
if(count($existing_users) == 0) { $message = "";
|
if(count($existing_users) == 0) { $message = "";
|
}
if($found_users < count($users)) { if($error_message) { $error_message .= "<br />"; }
$error_message .= $lang->invalid_user_selected;
| |
} }
| } }
|
Zeile 2192 | Zeile 2272 |
---|
// Check if user exists on the list $key = array_search($mybb->input['delete'], $existing_users); if($key !== false)
|
// Check if user exists on the list $key = array_search($mybb->input['delete'], $existing_users); if($key !== false)
|
{
| {
|
unset($existing_users[$key]); $user = get_user($mybb->input['delete']); if($mybb->input['manage'] == "ignored") { $message = $lang->removed_from_ignore_list;
|
unset($existing_users[$key]); $user = get_user($mybb->input['delete']); if($mybb->input['manage'] == "ignored") { $message = $lang->removed_from_ignore_list;
|
}
| }
|
else { $message = $lang->removed_from_buddy_list;
| else { $message = $lang->removed_from_buddy_list;
|
Zeile 2229 | Zeile 2309 |
---|
{ $user['ignorelist'] = $db->escape_string($new_list); $mybb->user['ignorelist'] = $user['ignorelist'];
|
{ $user['ignorelist'] = $db->escape_string($new_list); $mybb->user['ignorelist'] = $user['ignorelist'];
|
}
| }
|
else { $user['buddylist'] = $db->escape_string($new_list); $mybb->user['buddylist'] = $user['buddylist']; }
|
else { $user['buddylist'] = $db->escape_string($new_list); $mybb->user['buddylist'] = $user['buddylist']; }
|
|
|
$db->update_query("users", $user, "uid='".$mybb->user['uid']."'");
|
$db->update_query("users", $user, "uid='".$mybb->user['uid']."'");
|
|
|
$plugins->run_hooks("usercp_do_editlists_end");
// Ajax based request, throw new list to browser if($mybb->input['ajax'])
|
$plugins->run_hooks("usercp_do_editlists_end");
// Ajax based request, throw new list to browser if($mybb->input['ajax'])
|
{ if($mybb->input['manage'] == "ignored") {
| { if($mybb->input['manage'] == "ignored") {
|
$list = "ignore"; } else { $list = "buddy";
|
$list = "ignore"; } else { $list = "buddy";
|
}
| }
|
if($message) { $message_js = "var success = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(success, element); success.innerHTML = '{$message}'; success.className = 'success_message'; window.setTimeout(function() { Element.remove(success) }, 5000);";
|
if($message) { $message_js = "var success = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(success, element); success.innerHTML = '{$message}'; success.className = 'success_message'; window.setTimeout(function() { Element.remove(success) }, 5000);";
|
}
if($error_message)
| }
if($error_message)
|
{ $message_js .= " var error = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(error, element); error.innerHTML = '{$error_message}'; error.className = 'error_message'; window.setTimeout(function() { Element.remove(error) }, 5000);"; }
| { $message_js .= " var error = document.createElement('div'); var element = \$('{$list}_list'); element.parentNode.insertBefore(error, element); error.innerHTML = '{$error_message}'; error.className = 'error_message'; window.setTimeout(function() { Element.remove(error) }, 5000);"; }
|
Zeile 2270 | Zeile 2350 |
---|
{ echo "\$('{$mybb->input['manage']}_count').innerHTML = '0';\n"; if($mybb->input['manage'] == "ignored")
|
{ echo "\$('{$mybb->input['manage']}_count').innerHTML = '0';\n"; if($mybb->input['manage'] == "ignored")
|
{
| {
|
echo "\$('ignore_list').innerHTML = '<li>{$lang->ignore_list_empty}</li>';\n";
|
echo "\$('ignore_list').innerHTML = '<li>{$lang->ignore_list_empty}</li>';\n";
|
}
| }
|
else { echo "\$('buddy_list').innerHTML = '<li>{$lang->buddy_list_empty}</li>';\n"; }
|
else { echo "\$('buddy_list').innerHTML = '<li>{$lang->buddy_list_empty}</li>';\n"; }
|
}
| }
|
else { echo "\$('{$mybb->input['manage']}_count').innerHTML = '".count(explode(",", $new_list))."';\n";
| else { echo "\$('{$mybb->input['manage']}_count').innerHTML = '".count(explode(",", $new_list))."';\n";
|
Zeile 2294 | Zeile 2374 |
---|
$message .= "<br />".$error_message; } redirect("usercp.php?action=editlists#{$mybb->input['manage']}", $message);
|
$message .= "<br />".$error_message; } redirect("usercp.php?action=editlists#{$mybb->input['manage']}", $message);
|
} }
| } }
|
if($mybb->input['action'] == "editlists") { $plugins->run_hooks("usercp_editlists_start");
| if($mybb->input['action'] == "editlists") { $plugins->run_hooks("usercp_editlists_start");
|
Zeile 2374 | Zeile 2454 |
---|
} exit; }
|
} exit; }
|
|
|
$plugins->run_hooks("usercp_editlists_end");
eval("\$listpage = \"".$templates->get("usercp_editlists")."\";");
| $plugins->run_hooks("usercp_editlists_end");
eval("\$listpage = \"".$templates->get("usercp_editlists")."\";");
|
Zeile 2406 | Zeile 2486 |
---|
} elseif($draft['threadvisible'] == -2) // We're looking at a draft thread {
|
} elseif($draft['threadvisible'] == -2) // We're looking at a draft thread {
|
$detail = $lang->forum." <a href=\"".get_forum_link($draft['fid'])."\">".htmlspecialchars_uni($draft['forumname'])."</a>";
| $detail = $lang->forum." <a href=\"".get_forum_link($draft['fid'])."\">{$draft['forumname']}</a>";
|
$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";
|
Zeile 2426 | Zeile 2506 |
---|
eval("\$draftsubmit = \"".$templates->get("usercp_drafts_submit")."\";"); $disable_delete_drafts = ''; }
|
eval("\$draftsubmit = \"".$templates->get("usercp_drafts_submit")."\";"); $disable_delete_drafts = ''; }
|
|
|
$query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='".$mybb->user['uid']."'"); $count = $db->fetch_array($query); $draftcount = "(".my_number_format($count['draftcount']).")";
|
$query = $db->simple_select("posts", "COUNT(*) AS draftcount", "visible='-2' AND uid='".$mybb->user['uid']."'"); $count = $db->fetch_array($query); $draftcount = "(".my_number_format($count['draftcount']).")";
|
|
|
$plugins->run_hooks("usercp_drafts_end");
|
$plugins->run_hooks("usercp_drafts_end");
|
|
|
eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";"); output_page($draftlist);
| eval("\$draftlist = \"".$templates->get("usercp_drafts")."\";"); output_page($draftlist);
|
Zeile 2507 | Zeile 2587 |
---|
$cache->update_moderators(); $plugins->run_hooks("usercp_usergroups_change_displaygroup"); redirect("usercp.php?action=usergroups", $lang->display_group_changed);
|
$cache->update_moderators(); $plugins->run_hooks("usercp_usergroups_change_displaygroup"); redirect("usercp.php?action=usergroups", $lang->display_group_changed);
|
exit; }
| exit; }
|
// Leaving a group if($mybb->input['leavegroup']) {
| // Leaving a group if($mybb->input['leavegroup']) {
|
Zeile 2520 | Zeile 2600 |
---|
{ error($lang->not_member_of_group); }
|
{ error($lang->not_member_of_group); }
|
if($mybb->user['usergroup'] == $mybb->input['leavegroup']) { error($lang->cannot_leave_primary_group); }
| if($mybb->user['usergroup'] == $mybb->input['leavegroup']) { error($lang->cannot_leave_primary_group); }
|
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['leavegroup'])."'"); $usergroup = $db->fetch_array($query); if($usergroup['type'] != 4 && $usergroup['type'] != 3) { error($lang->cannot_leave_group);
|
$query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['leavegroup'])."'"); $usergroup = $db->fetch_array($query); if($usergroup['type'] != 4 && $usergroup['type'] != 3) { error($lang->cannot_leave_group);
|
}
| }
|
leave_usergroup($mybb->user['uid'], $mybb->input['leavegroup']); $plugins->run_hooks("usercp_usergroups_leave_group"); redirect("usercp.php?action=usergroups", $lang->left_group); exit; }
|
leave_usergroup($mybb->user['uid'], $mybb->input['leavegroup']); $plugins->run_hooks("usercp_usergroups_leave_group"); redirect("usercp.php?action=usergroups", $lang->left_group); exit; }
|
|
|
// Joining a group if($mybb->input['joingroup']) {
| // Joining a group if($mybb->input['joingroup']) {
|
Zeile 2561 | Zeile 2641 |
---|
if($joinrequest['rid']) { error($lang->already_sent_join_request);
|
if($joinrequest['rid']) { error($lang->already_sent_join_request);
|
}
| }
|
if($mybb->input['do'] == "joingroup" && $usergroup['type'] == 4) {
|
if($mybb->input['do'] == "joingroup" && $usergroup['type'] == 4) {
|
$reason = $db->escape_string($reason);
| $reason = $db->escape_string($mybb->input['reason']);
|
$now = TIME_NOW; $joinrequest = array( "uid" => $mybb->user['uid'], "gid" => intval($mybb->input['joingroup']),
|
$now = TIME_NOW; $joinrequest = array( "uid" => $mybb->user['uid'], "gid" => intval($mybb->input['joingroup']),
|
"reason" => $db->escape_string($mybb->input['reason']),
| "reason" => $reason,
|
"dateline" => TIME_NOW );
| "dateline" => TIME_NOW );
|
Zeile 2614 | Zeile 2694 |
---|
{ case "pgsql": case "sqlite":
|
{ case "pgsql": case "sqlite":
|
$query = $db->query(" SELECT g.title, g.gid, g.type, COUNT(u.uid) AS users, COUNT(j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers FROM ".TABLE_PREFIX."groupleaders l
| $query = $db->query(" SELECT g.title, g.gid, g.type, COUNT(DISTINCT u.uid) AS users, COUNT(DISTINCT j.rid) AS joinrequests, l.canmanagerequests, l.canmanagemembers FROM ".TABLE_PREFIX."groupleaders l
|
LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid) 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 AND j.uid != 0)
| LEFT JOIN ".TABLE_PREFIX."usergroups g ON(g.gid=l.gid) 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 AND j.uid != 0)
|
Zeile 2704 | Zeile 2784 |
---|
else { $description = '';
|
else { $description = '';
|
} if(!$usergroup['usertitle']) { // fetch title here
| |
} $trow = alt_trow(); if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])
| } $trow = alt_trow(); if($usergroup['candisplaygroup'] == 1 && $usergroup['gid'] == $mybb->user['displaygroup'])
|
Zeile 2715 | Zeile 2791 |
---|
$displaycode = " ({$lang->display_group})"; } elseif($usergroup['candisplaygroup'] == 1)
|
$displaycode = " ({$lang->display_group})"; } 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>)";
|
$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 2753 | Zeile 2829 |
---|
else { $description = '';
|
else { $description = '';
|
}
| }
|
// Moderating join requests? if($usergroup['type'] == 4)
|
// Moderating join requests? if($usergroup['type'] == 4)
|
{
| {
|
$conditions = $lang->usergroup_joins_moderated;
|
$conditions = $lang->usergroup_joins_moderated;
|
} else {
| } else {
|
$conditions = $lang->usergroup_joins_anyone; }
| $conditions = $lang->usergroup_joins_anyone; }
|
Zeile 2774 | Zeile 2850 |
---|
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 2788 | Zeile 2864 |
---|
$comma = $lang->comma; } $usergroupleaders = $lang->usergroup_leaders." ".$usergroupleaders;
|
$comma = $lang->comma; } $usergroupleaders = $lang->usergroup_leaders." ".$usergroupleaders;
|
}
| }
|
if(my_strpos($usergroupleaders, $mybb->user['username']) === false) { // User is already a leader of the group, so don't show as a "Join Group" eval("\$joinablegrouplist .= \"".$templates->get("usercp_usergroups_joinable_usergroup")."\";"); }
|
if(my_strpos($usergroupleaders, $mybb->user['username']) === false) { // User is already a leader of the group, so don't show as a "Join Group" eval("\$joinablegrouplist .= \"".$templates->get("usercp_usergroups_joinable_usergroup")."\";"); }
|
}
| }
|
if($joinablegrouplist) { eval("\$joinablegroups = \"".$templates->get("usercp_usergroups_joinable")."\";"); }
$plugins->run_hooks("usercp_usergroups_end");
|
if($joinablegrouplist) { eval("\$joinablegroups = \"".$templates->get("usercp_usergroups_joinable")."\";"); }
$plugins->run_hooks("usercp_usergroups_end");
|
|
|
eval("\$groupmemberships = \"".$templates->get("usercp_usergroups")."\";"); output_page($groupmemberships); }
| eval("\$groupmemberships = \"".$templates->get("usercp_usergroups")."\";"); output_page($groupmemberships); }
|
Zeile 2814 | Zeile 2890 |
---|
$attachments = '';
// Pagination
|
$attachments = '';
// Pagination
|
if(!$mybb->settings['threadsperpage'])
| if(!$mybb->settings['threadsperpage'] || (int)$mybb->settings['threadsperpage'] < 1)
|
{ $mybb->settings['threadsperpage'] = 20; }
| { $mybb->settings['threadsperpage'] = 20; }
|
Zeile 2853 | Zeile 2929 |
---|
$attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']); $attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));
|
$attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']); $attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));
|
|
|
$size = get_friendly_size($attachment['filesize']); $icon = get_attachment_icon(get_extension($attachment['filename']));
|
$size = get_friendly_size($attachment['filesize']); $icon = get_attachment_icon(get_extension($attachment['filename']));
|
| $attachment['filename'] = htmlspecialchars_uni($attachment['filename']);
|
$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']); $attachdate = my_date($mybb->settings['dateformat'], $attachment['dateline']); $attachtime = my_date($mybb->settings['timeformat'], $attachment['dateline']); $altbg = alt_trow();
|
$sizedownloads = $lang->sprintf($lang->attachment_size_downloads, $size, $attachment['downloads']); $attachdate = my_date($mybb->settings['dateformat'], $attachment['dateline']); $attachtime = my_date($mybb->settings['timeformat'], $attachment['dateline']); $altbg = alt_trow();
|
|
|
eval("\$attachments .= \"".$templates->get("usercp_attachments_attachment")."\";");
|
eval("\$attachments .= \"".$templates->get("usercp_attachments_attachment")."\";");
|
|
|
// 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
| else { // This little thing delets attachments without a thread/post
|
Zeile 2881 | Zeile 2962 |
---|
$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);
|
$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);
|
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);
| $multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments"); $bandwidth = get_friendly_size($bandwidth);
|
Zeile 2897 | Zeile 2978 |
---|
eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";"); $usagenote = ''; }
|
eval("\$attachments = \"".$templates->get("usercp_attachments_none")."\";"); $usagenote = ''; }
|
|
|
$plugins->run_hooks("usercp_attachments_end");
|
$plugins->run_hooks("usercp_attachments_end");
|
|
|
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 2929 | Zeile 3010 |
---|
{ // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
{ // Verify incoming POST request verify_post_check($mybb->input['my_post_key']);
|
| // Cap at 60,000 chars; text will allow up to 65535? if(my_strlen($mybb->input['notepad']) > 60000) { $mybb->input['notepad'] = my_substr($mybb->input['notepad'], 0, 60000); }
|
$plugins->run_hooks("usercp_do_notepad_start"); $db->update_query("users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'"); $plugins->run_hooks("usercp_do_notepad_end"); redirect("usercp.php", $lang->redirect_notepadupdated); }
|
$plugins->run_hooks("usercp_do_notepad_start"); $db->update_query("users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'"); $plugins->run_hooks("usercp_do_notepad_end"); redirect("usercp.php", $lang->redirect_notepadupdated); }
|
|
|
if(!$mybb->input['action']) { // Get posts per day $daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);
if($daysreg < 1)
|
if(!$mybb->input['action']) { // Get posts per day $daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);
if($daysreg < 1)
|
{
| {
|
$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'])
|
{
| {
|
$perday = $mybb->user['postnum']; }
$stats = $cache->read("stats"); $posts = $stats['numposts']; if($posts == 0)
|
$perday = $mybb->user['postnum']; }
$stats = $cache->read("stats"); $posts = $stats['numposts']; if($posts == 0)
|
{
| {
|
$percent = "0"; } else
| $percent = "0"; } else
|
Zeile 2976 | Zeile 3063 |
---|
{ $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\""; }
|
{ $avatar_width_height = "width=\"{$avatar_dimensions[0]}\" height=\"{$avatar_dimensions[1]}\""; }
|
$mybb->user['avatar'] = htmlspecialchars($mybb->user['avatar']);
| $mybb->user['avatar'] = htmlspecialchars_uni($mybb->user['avatar']);
|
eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";"); $colspan = 2; }
| eval("\$avatar = \"".$templates->get("usercp_currentavatar")."\";"); $colspan = 2; }
|
Zeile 2989 | Zeile 3076 |
---|
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>)";
|
}
| }
|
// Make reputations row $reputations = ''; if($mybb->usergroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)
| // Make reputations row $reputations = ''; if($mybb->usergroup['usereputationsystem'] == 1 && $mybb->settings['enablereputation'] == 1)
|
Zeile 2998 | Zeile 3085 |
---|
eval("\$reputation = \"".$templates->get("usercp_reputation")."\";"); }
|
eval("\$reputation = \"".$templates->get("usercp_reputation")."\";"); }
|
| $latest_warnings = '';
|
if($mybb->settings['enablewarningsystem'] != 0 && $mybb->settings['canviewownwarning'] != 0) { $warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100)
|
if($mybb->settings['enablewarningsystem'] != 0 && $mybb->settings['canviewownwarning'] != 0) { $warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100); if($warning_level > 100)
|
{
| {
|
$warning_level = 100; }
| $warning_level = 100; }
|
Zeile 3041 | Zeile 3129 |
---|
if($warning['type_title']) { $warning_type = $warning['type_title'];
|
if($warning['type_title']) { $warning_type = $warning['type_title'];
|
}
| }
|
else { $warning_type = $warning['title']; } $warning_type = htmlspecialchars_uni($warning_type); if($warning['points'] > 0)
|
else { $warning_type = $warning['title']; } $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 3061 | Zeile 3149 |
---|
elseif($warning['expired']) { $expires = $lang->already_expired;
|
elseif($warning['expired']) { $expires = $lang->already_expired;
|
}
| }
|
elseif($warning['expires'] == 0) { $expires = $lang->never;
| elseif($warning['expires'] == 0) { $expires = $lang->never;
|
Zeile 3080 | Zeile 3168 |
---|
} } }
|
} } }
|
|
|
// Format username $username = format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']); $username = build_profile_link($username, $mybb->user['uid']);
|
// Format username $username = format_name($mybb->user['username'], $mybb->user['usergroup'], $mybb->user['displaygroup']); $username = build_profile_link($username, $mybb->user['uid']);
|
|
|
// Format post numbers $mybb->user['posts'] = my_number_format($mybb->user['postnum']);
|
// Format post numbers $mybb->user['posts'] = my_number_format($mybb->user['postnum']);
|
|
|
// Build referral link if($mybb->settings['usereferrals'] == 1) { $referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']); eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
|
// Build referral link if($mybb->settings['usereferrals'] == 1) { $referral_link = $lang->sprintf($lang->referral_link, $settings['bburl'], $mybb->user['uid']); eval("\$referral_info = \"".$templates->get("usercp_referrals")."\";");
|
}
| }
|
// User Notepad $plugins->run_hooks("usercp_notepad_start"); $mybb->user['notepad'] = htmlspecialchars_uni($mybb->user['notepad']); eval("\$user_notepad = \"".$templates->get("usercp_notepad")."\";"); $plugins->run_hooks("usercp_notepad_end");
|
// User Notepad $plugins->run_hooks("usercp_notepad_start"); $mybb->user['notepad'] = htmlspecialchars_uni($mybb->user['notepad']); eval("\$user_notepad = \"".$templates->get("usercp_notepad")."\";"); $plugins->run_hooks("usercp_notepad_end");
|
|
|
// Thread Subscriptions with New Posts
|
// Thread Subscriptions with New Posts
|
| $latest_subscribed = '';
|
$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)) {
|
Zeile 3120 | Zeile 3209 |
---|
ORDER BY t.lastpost DESC LIMIT 0, 10 ");
|
ORDER BY t.lastpost DESC LIMIT 0, 10 ");
|
|
|
$fpermissions = forum_permissions(); while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
$fpermissions = forum_permissions(); while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0)
| if($forumpermissions['canview'] != 0 && $forumpermissions['canviewthreads'] != 0 && ($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid']))
|
{ $subscriptions[$subscription['tid']] = $subscription; } }
|
{ $subscriptions[$subscription['tid']] = $subscription; } }
|
|
|
if(is_array($subscriptions)) { $tids = implode(",", array_keys($subscriptions));
| if(is_array($subscriptions)) { $tids = implode(",", array_keys($subscriptions));
|
Zeile 3146 | Zeile 3235 |
---|
unset($subscriptions[$readthread['tid']]); // If it's already been read, then don't display the thread } else
|
unset($subscriptions[$readthread['tid']]); // If it's already been read, then don't display the thread } else
|
{
| {
|
$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline']; } } }
|
$subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline']; } } }
|
|
|
if($subscriptions) { if($mybb->settings['dotfolders'] != 0)
| if($subscriptions) { if($mybb->settings['dotfolders'] != 0)
|
Zeile 3164 | Zeile 3253 |
---|
}
$icon_cache = $cache->read("posticons");
|
}
$icon_cache = $cache->read("posticons");
|
|
|
foreach($subscriptions as $thread) { $folder = ''; $folder_label = ''; $gotounread = '';
|
foreach($subscriptions as $thread) { $folder = ''; $folder_label = ''; $gotounread = '';
|
|
|
if($thread['tid']) { $bgcolor = alt_trow();
| if($thread['tid']) { $bgcolor = alt_trow();
|
Zeile 3184 | Zeile 3273 |
---|
{ $query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'"); $threadprefix = $db->fetch_array($query);
|
{ $query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'"); $threadprefix = $db->fetch_array($query);
|
|
|
$thread['displayprefix'] = $threadprefix['displaystyle'].' ';
|
$thread['displayprefix'] = $threadprefix['displaystyle'].' ';
|
}
| }
|
else { $thread['displayprefix'] = '';
|
else { $thread['displayprefix'] = '';
|
}
| }
|
// Icons if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) { $icon = $icon_cache[$thread['icon']];
|
// Icons if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) { $icon = $icon_cache[$thread['icon']];
|
| $icon['path'] = htmlspecialchars_uni($icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']);
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else { $icon = " "; }
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else { $icon = " "; }
|
|
|
if($thread['doticon']) { $folder = "dot_"; $folder_label .= $lang->icon_dot;
|
if($thread['doticon']) { $folder = "dot_"; $folder_label .= $lang->icon_dot;
|
}
| }
|
// 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']) {
|
Zeile 3217 | Zeile 3308 |
---|
$new_class = "subject_new"; $thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
|
$new_class = "subject_new"; $thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";");
|
} else {
| } else {
|
$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($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter']; $lastposteruid = $thread['lastposteruid'];
|
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter']; $lastposteruid = $thread['lastposteruid'];
|
|
|
if($lastposteruid == 0) { $lastposterlink = $lastposter;
| if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
Zeile 3244 | Zeile 3335 |
---|
{ $lastposterlink = build_profile_link($lastposter, $lastposteruid); }
|
{ $lastposterlink = build_profile_link($lastposter, $lastposteruid); }
|
|
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']); $thread['author'] = build_profile_link($thread['username'], $thread['uid']);
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']); $thread['author'] = build_profile_link($thread['username'], $thread['uid']);
|
|
|
eval("\$latest_subscribed_threads .= \"".$templates->get("usercp_latest_subscribed_threads")."\";"); } }
| eval("\$latest_subscribed_threads .= \"".$templates->get("usercp_latest_subscribed_threads")."\";"); } }
|
Zeile 3256 | Zeile 3347 |
---|
} } }
|
} } }
|
|
|
// User's Latest Threads
// Get unviewable forums
|
// User's Latest Threads
// Get unviewable forums
|
| $f_perm_sql = '';
|
$unviewable_forums = get_unviewable_forums(); if($unviewable_forums) {
| $unviewable_forums = get_unviewable_forums(); if($unviewable_forums) {
|
Zeile 3318 | Zeile 3410 |
---|
// Threads being read? if($mybb->settings['threadreadcut'] > 0)
|
// Threads being read? if($mybb->settings['threadreadcut'] > 0)
|
{
| {
|
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})"); while($readthread = $db->fetch_array($query)) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
$query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})"); while($readthread = $db->fetch_array($query)) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
} }
| } }
|
// Icon Stuff if($mybb->settings['dotfolders'] != 0) { $query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})"); while($post = $db->fetch_array($query))
|
// Icon Stuff if($mybb->settings['dotfolders'] != 0) { $query = $db->simple_select("posts", "tid,uid", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})"); while($post = $db->fetch_array($query))
|
{
| {
|
$threadcache[$post['tid']]['doticon'] = 1; } }
|
$threadcache[$post['tid']]['doticon'] = 1; } }
|
|
|
$icon_cache = $cache->read("posticons");
|
$icon_cache = $cache->read("posticons");
|
|
|
// Run the threads...
|
// Run the threads...
|
| $latest_threads_threads = '';
|
foreach($threadcache as $thread) { if($thread['tid'])
| foreach($threadcache as $thread) { if($thread['tid'])
|
Zeile 3351 | Zeile 3444 |
---|
$isnew = 0; $donenew = 0; $lastread = 0;
|
$isnew = 0; $donenew = 0; $lastread = 0;
|
|
|
// If this thread has a prefix... if($thread['prefix'] != 0)
|
// If this thread has a prefix... if($thread['prefix'] != 0)
|
{
| {
|
$query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'"); $threadprefix = $db->fetch_array($query);
| $query = $db->simple_select('threadprefixes', 'prefix, displaystyle', "pid='{$thread['prefix']}'"); $threadprefix = $db->fetch_array($query);
|
Zeile 3364 | Zeile 3457 |
---|
{ $thread['displayprefix'] = ''; }
|
{ $thread['displayprefix'] = ''; }
|
|
|
$thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']); $thread['threadlink'] = get_thread_link($thread['tid']);
| $thread['subject'] = $parser->parse_badwords($thread['subject']); $thread['subject'] = htmlspecialchars_uni($thread['subject']); $thread['threadlink'] = get_thread_link($thread['tid']);
|
Zeile 3373 | Zeile 3466 |
---|
if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) { $icon = $icon_cache[$thread['icon']];
|
if($thread['icon'] > 0 && $icon_cache[$thread['icon']]) { $icon = $icon_cache[$thread['icon']];
|
| $icon['path'] = htmlspecialchars_uni($icon['path']); $icon['name'] = htmlspecialchars_uni($icon['name']);
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
}
| }
|
else { $icon = " ";
|
else { $icon = " ";
|
}
| }
|
if($mybb->settings['threadreadcut'] > 0)
|
if($mybb->settings['threadreadcut'] > 0)
|
{
| {
|
$forum_read = $readforums[$thread['fid']];
|
$forum_read = $readforums[$thread['fid']];
|
|
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
$read_cutoff = TIME_NOW-$mybb->settings['threadreadcut']*60*60*24; if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
}
| }
|
}
|
}
|
|
|
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; }
|
| $cutoff = 0;
|
if($thread['lastpost'] > $cutoff) { if($thread['lastread'])
| if($thread['lastpost'] > $cutoff) { if($thread['lastread'])
|
Zeile 3403 | Zeile 3499 |
---|
$lastread = $thread['lastread']; } }
|
$lastread = $thread['lastread']; } }
|
|
|
if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
| if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
|
Zeile 3483 | Zeile 3579 |
---|
eval("\$latest_threads = \"".$templates->get("usercp_latest_threads")."\";"); }
|
eval("\$latest_threads = \"".$templates->get("usercp_latest_threads")."\";"); }
|
|
|
$plugins->run_hooks("usercp_end");
eval("\$usercp = \"".$templates->get("usercp")."\";");
| $plugins->run_hooks("usercp_end");
eval("\$usercp = \"".$templates->get("usercp")."\";");
|