Zeile 6 | Zeile 6 |
---|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* Website: http://mybb.com * License: http://mybb.com/about/license *
|
* $Id: usercp.php 5142 2010-07-29 23:36:56Z RyanGordon $
| * $Id$
|
*/
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 59 | Zeile 82 |
---|
(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) && substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages']) )
|
(($mybb->settings['sigimgcode'] == 1 || $mybb->settings['sigsmilies'] == 1) && substr_count($parsed_sig, "<img") > $mybb->settings['maxsigimages']) )
|
{
| {
|
if($mybb->settings['sigimgcode'] == 1)
|
if($mybb->settings['sigimgcode'] == 1)
|
{
| {
|
$imgsallowed = $mybb->settings['maxsigimages'];
|
$imgsallowed = $mybb->settings['maxsigimages'];
|
} else {
| } else {
|
$imgsallowed = 0; } $lang->too_many_sig_images2 = $lang->sprintf($lang->too_many_sig_images2, $imgsallowed);
| $imgsallowed = 0; } $lang->too_many_sig_images2 = $lang->sprintf($lang->too_many_sig_images2, $imgsallowed);
|
Zeile 90 | Zeile 113 |
---|
if($sig_length - $mybb->settings['siglength'] > 1) { $lang->sig_too_long .= $lang->sprintf($lang->sig_remove_chars_plural, $sig_length-$mybb->settings['siglength']);
|
if($sig_length - $mybb->settings['siglength'] > 1) { $lang->sig_too_long .= $lang->sprintf($lang->sig_remove_chars_plural, $sig_length-$mybb->settings['siglength']);
|
} else
| } else
|
{ $lang->sig_too_long .= $lang->sig_remove_chars_singular; }
| { $lang->sig_too_long .= $lang->sig_remove_chars_singular; }
|
Zeile 194 | Zeile 217 |
---|
if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate))) { error($lang->error_usercp_return_date_past);
|
if($return_year < my_date('Y', $awaydate) || ($returntimestamp < $awaytimestamp && $return_year == my_date('Y', $awaydate))) { error($lang->error_usercp_return_date_past);
|
}
| }
|
$returndate = "{$return_day}-{$return_month}-{$return_year}"; }
| $returndate = "{$return_day}-{$return_month}-{$return_year}"; }
|
Zeile 258 | Zeile 281 |
---|
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 273 | Zeile 303 |
---|
if($mybb->input['action'] == "profile") { if($errors)
|
if($mybb->input['action'] == "profile") { if($errors)
|
{
| {
|
$user = $mybb->input; $bday = array(); $bday[0] = $mybb->input['bday1'];
| $user = $mybb->input; $bday = array(); $bday[0] = $mybb->input['bday1'];
|
Zeile 298 | Zeile 328 |
---|
else { $bdaydaysel .= "<option value=\"$i\">$i</option>\n";
|
else { $bdaydaysel .= "<option value=\"$i\">$i</option>\n";
|
}
| }
|
} $bdaymonthsel[$bday[1]] = 'selected="selected"';
| } $bdaymonthsel[$bday[1]] = 'selected="selected"';
|
Zeile 402 | Zeile 432 |
---|
$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder')); while($profilefield = $db->fetch_array($query)) {
|
$query = $db->simple_select("profilefields", "*", "editable=1", array('order_by' => 'disporder')); while($profilefield = $db->fetch_array($query)) {
|
| // Does this field have a minimum post count? if($profilefield['postnum'] && $profilefield['postnum'] > $user['postnum']) { continue; }
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
|
$profilefield['type'] = htmlspecialchars_uni($profilefield['type']);
|
| $profilefield['name'] = htmlspecialchars_uni($profilefield['name']);
|
$profilefield['description'] = htmlspecialchars_uni($profilefield['description']); $thing = explode("\n", $profilefield['type'], "2"); $type = $thing[0];
| $profilefield['description'] = htmlspecialchars_uni($profilefield['description']); $thing = explode("\n", $profilefield['type'], "2"); $type = $thing[0];
|
Zeile 414 | Zeile 451 |
---|
$userfield = $mybb->input['profile_fields'][$field]; } else
|
$userfield = $mybb->input['profile_fields'][$field]; } else
|
{
| {
|
$userfield = $user[$field]; } if($type == "multiselect")
| $userfield = $user[$field]; } if($type == "multiselect")
|
Zeile 450 | Zeile 487 |
---|
} $select .= "<option value=\"$val\"$sel>$val</option>\n"; }
|
} $select .= "<option value=\"$val\"$sel>$val</option>\n"; }
|
if(!$profilefield['length']) { $profilefield['length'] = 3; }
| if(!$profilefield['length']) { $profilefield['length'] = 3; }
|
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";
|
$code = "<select name=\"profile_fields[$field][]\" size=\"{$profilefield['length']}\" multiple=\"multiple\">$select</select>";
|
} }
| } }
|
elseif($type == "select")
|
elseif($type == "select")
|
{ $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val)
| { $expoptions = explode("\n", $options); if(is_array($expoptions)) { foreach($expoptions as $key => $val)
|
{ $val = trim($val); $val = str_replace("\n", "\\n", $val);
| { $val = trim($val); $val = str_replace("\n", "\\n", $val);
|
Zeile 481 | Zeile 518 |
---|
} } elseif($type == "radio")
|
} } elseif($type == "radio")
|
{
| {
|
$expoptions = explode("\n", $options); if(is_array($expoptions)) {
| $expoptions = explode("\n", $options); if(is_array($expoptions)) {
|
Zeile 494 | Zeile 531 |
---|
} $code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />"; }
|
} $code .= "<input type=\"radio\" class=\"radio\" name=\"profile_fields[$field]\" value=\"$val\"$checked /> <span class=\"smalltext\">$val</span><br />"; }
|
}
| }
|
} elseif($type == "checkbox") { if($errors)
|
} elseif($type == "checkbox") { if($errors)
|
{
| {
|
$useropts = $userfield;
|
$useropts = $userfield;
|
} else { $useropts = explode("\n", $userfield); }
| } else { $useropts = explode("\n", $userfield); }
|
if(is_array($useropts)) { foreach($useropts as $key => $val)
| if(is_array($useropts)) { foreach($useropts as $key => $val)
|
Zeile 568 | Zeile 605 |
---|
{ 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 { $defaulttitle = $mybb->usergroup['usertitle']; }
|
else { $defaulttitle = $mybb->usergroup['usertitle']; }
|
if(empty($user['usertitle']))
| if(trim($user['usertitle']) == '')
|
{ $lang->current_custom_usertitle = ''; }
| { $lang->current_custom_usertitle = ''; }
|
Zeile 663 | Zeile 709 |
---|
else { $userhandler->update_user();
|
else { $userhandler->update_user();
|
|
|
$plugins->run_hooks("usercp_do_options_end");
redirect("usercp.php", $lang->redirect_optionsupdated);
| $plugins->run_hooks("usercp_do_options_end");
redirect("usercp.php", $lang->redirect_optionsupdated);
|
Zeile 766 | Zeile 812 |
---|
if($user['receivepms'] == 1) { $receivepmscheck = "checked=\"checked\"";
|
if($user['receivepms'] == 1) { $receivepmscheck = "checked=\"checked\"";
|
}
| }
|
else { $receivepmscheck = "";
| else { $receivepmscheck = "";
|
Zeile 869 | Zeile 915 |
---|
else { $time_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";
|
else { $time_format_options .= "<option value=\"$key\">".my_date($format, TIME_NOW, "", 0)."</option>";
|
}
| }
|
}
$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);
| }
$tzselect = build_timezone_select("timezoneoffset", $mybb->user['timezone'], true);
|
Zeile 1176 | Zeile 1222 |
---|
if($mybb->input['action'] == "subscriptions") { $plugins->run_hooks("usercp_subscriptions_start");
|
if($mybb->input['action'] == "subscriptions") { $plugins->run_hooks("usercp_subscriptions_start");
|
| // Thread visiblity $visible = "AND t.visible != 0"; if(is_moderator() == true) { $visible = ''; }
|
// Do Multi Pages
|
// Do Multi Pages
|
$query = $db->simple_select("threadsubscriptions", "COUNT(tid) AS threads", "uid='".$mybb->user['uid']."'");
| $query = $db->query(" SELECT COUNT(ts.tid) as threads FROM ".TABLE_PREFIX."threadsubscriptions ts LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid = ts.tid) WHERE ts.uid = '".$mybb->user['uid']."' {$visible} ");
|
$threadcount = $db->fetch_field($query, "threads");
if(!$mybb->settings['threadsperpage'])
| $threadcount = $db->fetch_field($query, "threads");
if(!$mybb->settings['threadsperpage'])
|
Zeile 1214 | Zeile 1272 |
---|
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
|
LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid) LEFT JOIN ".TABLE_PREFIX."threadprefixes p ON (p.pid=t.prefix)
|
WHERE s.uid='".$mybb->user['uid']."'
| WHERE s.uid='".$mybb->user['uid']."' {$visible}
|
ORDER BY t.lastpost DESC LIMIT $start, $perpage "); while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
ORDER BY t.lastpost DESC LIMIT $start, $perpage "); while($subscription = $db->fetch_array($query)) { $forumpermissions = $fpermissions[$subscription['fid']];
|
// Only keep if we're allowed to view them if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0) {
| 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! $del_subscriptions[] = $subscription['sid']; } else if($subscription['tid']) {
|
$subscriptions[$subscription['tid']] = $subscription;
|
$subscriptions[$subscription['tid']] = $subscription;
|
} // Hmm, you don't have permission to view - unsubscribe! else if($subscription['tid']) { $del_subscriptions[] = $subscription['tid'];
| |
} }
if(is_array($del_subscriptions))
|
} }
if(is_array($del_subscriptions))
|
{ $tids = implode(',', $del_subscriptions); if($tids) { $db->delete_query("threadsubscriptions", "tid IN ({$tids}) AND uid='{$mybb->user['uid']}'");
| { $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) { $threadcount = 0;
|
} }
| } }
|
Zeile 1256 | Zeile 1322 |
---|
ORDER BY pid, disporder ");
|
ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else
|
} else
|
{
| {
|
// Build a forum cache. $query = $db->query(" SELECT f.fid, fr.dateline AS lastread
| // Build a forum cache. $query = $db->query(" SELECT f.fid, fr.dateline AS lastread
|
Zeile 1269 | Zeile 1335 |
---|
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 1288 | Zeile 1355 |
---|
while($post = $db->fetch_array($query)) { $subscriptions[$post['tid']]['doticon'] = 1;
|
while($post = $db->fetch_array($query)) { $subscriptions[$post['tid']]['doticon'] = 1;
|
} }
| } }
|
// Read threads if($mybb->settings['threadreadcut'] > 0) { $query = $db->simple_select("threadsread", "*", "uid='{$mybb->user['uid']}' AND tid IN ({$tids})"); while($readthread = $db->fetch_array($query))
|
// Read threads 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']; } }
| $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline']; } }
|
Zeile 1330 | Zeile 1397 |
---|
{ $icon = $icon_cache[$thread['icon']]; $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
{ $icon = $icon_cache[$thread['icon']]; $icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />";
|
} else
| } else
|
{ $icon = " "; }
| { $icon = " "; }
|
Zeile 1373 | Zeile 1440 |
---|
if($thread['lastpost'] > $cutoff) {
|
if($thread['lastpost'] > $cutoff) {
|
if($thread['lastpost'] > $cutoff) { if($thread['lastread']) { $lastread = $thread['lastread']; } else { $lastread = 1; }
| if($thread['lastread']) { $lastread = $thread['lastread']; } else { $lastread = 1;
|
} }
| } }
|
Zeile 1390 | Zeile 1454 |
---|
{ $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']); if($readcookie > $forum_read)
|
{ $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']); if($readcookie > $forum_read)
|
{
| {
|
$lastread = $readcookie; } else { $lastread = $forum_read; }
|
$lastread = $readcookie; } else { $lastread = $forum_read; }
|
}
if($thread['lastpost'] > $lastread && $lastread)
| }
if($lastread && $lastread < $thread['lastpost'])
|
{ $folder .= "new"; $folder_label .= $lang->icon_new;
| { $folder .= "new"; $folder_label .= $lang->icon_new;
|
Zeile 1407 | Zeile 1471 |
---|
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
$thread['newpostlink'] = get_thread_link($thread['tid'], 0, "newpost"); eval("\$gotounread = \"".$templates->get("forumdisplay_thread_gotounread")."\";"); $unreadpost = 1;
|
}
| }
|
else { $folder_label .= $lang->icon_no_new; $new_class = "subject_old";
|
else { $folder_label .= $lang->icon_no_new; $new_class = "subject_old";
|
}
| }
|
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
|
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
|
{
| {
|
$folder .= "hot"; $folder_label .= $lang->icon_hot;
|
$folder .= "hot"; $folder_label .= $lang->icon_hot;
|
}
| }
|
if($thread['closed'] == 1)
|
if($thread['closed'] == 1)
|
{
| {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock; }
|
$folder .= "lock"; $folder_label .= $lang->icon_lock; }
|
$folder .= "folder";
| $folder .= "folder";
if($thread['visible'] == 0) { $bgcolor = "trow_shaded"; }
|
// Build last post info
|
// Build last post info
|
| |
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter'];
| $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter'];
|
Zeile 1474 | Zeile 1542 |
---|
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) {
| if($mybb->user['uid'] == 0) {
|
Zeile 1493 | Zeile 1557 |
---|
ORDER BY pid, disporder ");
|
ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else {
| } else {
|
Zeile 1506 | Zeile 1570 |
---|
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)
|
{
| {
|
if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']];
| if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']];
|
Zeile 1517 | Zeile 1582 |
---|
} $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 1530 | Zeile 1595 |
---|
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); }
| eval("\$forumsubscriptions = \"".$templates->get("usercp_forumsubscriptions")."\";"); output_page($forumsubscriptions); }
|
Zeile 1593 | Zeile 1683 |
---|
{ $update_signature = array( "includesig" => 1
|
{ $update_signature = array( "includesig" => 1
|
); $db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
| ); $db->update_query("posts", $update_signature, "uid='".$mybb->user['uid']."'");
|
} elseif($mybb->input['updateposts'] == "disable") {
| } elseif($mybb->input['updateposts'] == "disable") {
|
Zeile 1632 | Zeile 1722 |
---|
$template = false; }
|
$template = false; }
|
if(!$mybb->user['signature'] && ($mybb->user['suspendsignature'] && $mybb->user['suspendsigtime'] > TIME_NOW))
| if($mybb->user['suspendsignature'] && ($mybb->user['suspendsigtime'] == 0 || $mybb->user['suspendsigtime'] > 0 && $mybb->user['suspendsigtime'] > TIME_NOW))
|
{ // User currently has no signature and they're suspended
|
{ // User currently has no signature and they're suspended
|
| error($lang->sig_suspended); }
if($mybb->usergroup['canusesig'] != 1) { // Usergroup has no permission to use this facility
|
error_no_permission();
|
error_no_permission();
|
| } else if($mybb->usergroup['canusesig'] == 1 && $mybb->usergroup['canusesigxposts'] > 0 && $mybb->user['postnum'] < $mybb->usergroup['canusesigxposts']) { // Usergroup can use this facility, but only after x posts error($lang->sprintf($lang->sig_suspended_posts, $mybb->usergroup['canusesigxposts']));
|
}
if($sig && $template)
| }
if($sig && $template)
|
Zeile 1646 | Zeile 1747 |
---|
"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 2112 | Zeile 2214 |
---|
$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))
|
Zeile 2141 | Zeile 2253 |
---|
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 2251 | Zeile 2353 |
---|
echo "\$('{$mybb->input['manage']}_count').innerHTML = '".count(explode(",", $new_list))."';\n"; } echo $message_js;
|
echo "\$('{$mybb->input['manage']}_count').innerHTML = '".count(explode(",", $new_list))."';\n"; } echo $message_js;
|
exit;
| exit;
|
} $mybb->input['action'] = "editlists"; }
| } $mybb->input['action'] = "editlists"; }
|
Zeile 2301 | Zeile 2403 |
---|
// Fetch out ignore list users $ignore_count = 0;
|
// Fetch out ignore list users $ignore_count = 0;
|
if($mybb->user['ignorelist'])
| if($mybb->user['ignorelist'])
|
{ $type = "ignored"; $query = $db->simple_select("users", "*", "uid IN ({$mybb->user['ignorelist']})", array("order_by" => "username"));
| { $type = "ignored"; $query = $db->simple_select("users", "*", "uid IN ({$mybb->user['ignorelist']})", array("order_by" => "username"));
|
Zeile 2374 | Zeile 2476 |
---|
} 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 2552 | Zeile 2654 |
---|
eval("\$joinpage = \"".$templates->get("usercp_usergroups_joingroup")."\";"); output_page($joinpage); exit();
|
eval("\$joinpage = \"".$templates->get("usercp_usergroups_joingroup")."\";"); output_page($joinpage); exit();
|
} else
| } else
|
{ join_usergroup($mybb->user['uid'], $mybb->input['joingroup']); $plugins->run_hooks("usercp_usergroups_join_group");
| { join_usergroup($mybb->user['uid'], $mybb->input['joingroup']); $plugins->run_hooks("usercp_usergroups_join_group");
|
Zeile 2642 | Zeile 2744 |
---|
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 2780 | Zeile 2882 |
---|
require_once MYBB_ROOT."inc/functions_upload.php";
$attachments = '';
|
require_once MYBB_ROOT."inc/functions_upload.php";
$attachments = '';
|
$query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount']; $friendlyusage = get_friendly_size($totalusage); if($mybb->usergroup['attachquota']) { $percent = round(($totalusage/($mybb->usergroup['attachquota']*1024))*100)."%"; $attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024); $usagenote = $lang->sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $percent, $totalattachments); } else { $percent = $lang->unlimited; $attachquota = $lang->unlimited; $usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments); }
| |
// Pagination if(!$mybb->settings['threadsperpage'])
|
// Pagination if(!$mybb->settings['threadsperpage'])
|
{
| {
|
$mybb->settings['threadsperpage'] = 20;
|
$mybb->settings['threadsperpage'] = 20;
|
}
| }
|
$perpage = $mybb->settings['threadsperpage']; $page = intval($mybb->input['page']);
if(intval($mybb->input['page']) > 0) { $start = ($page-1) *$perpage;
|
$perpage = $mybb->settings['threadsperpage']; $page = intval($mybb->input['page']);
if(intval($mybb->input['page']) > 0) { $start = ($page-1) *$perpage;
|
}
| }
|
else { $start = 0;
| else { $start = 0;
|
Zeile 2818 | Zeile 2903 |
---|
}
$end = $start + $perpage;
|
}
$end = $start + $perpage;
|
$lower = $start+1;
if($end > $totalattachments) { $upper = $totalattachments; } $multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
| $lower = $start+1;
|
$query = $db->query(" SELECT a.*, p.subject, p.dateline, t.tid, t.subject AS threadsubject FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
$query = $db->query(" SELECT a.*, p.subject, p.dateline, t.tid, t.subject AS threadsubject FROM ".TABLE_PREFIX."attachments a LEFT JOIN ".TABLE_PREFIX."posts p ON (a.pid=p.pid) LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
|
WHERE a.uid='".$mybb->user['uid']."' AND a.pid!='0'
| WHERE a.uid='".$mybb->user['uid']."'
|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage} ");
|
ORDER BY p.dateline DESC LIMIT {$start}, {$perpage} ");
|
|
|
$bandwidth = $totaldownloads = 0; while($attachment = $db->fetch_array($query))
|
$bandwidth = $totaldownloads = 0; while($attachment = $db->fetch_array($query))
|
{
| {
|
if($attachment['dateline'] && $attachment['tid']) { $attachment['subject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['subject'])); $attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']); $attachment['threadsubject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['threadsubject']));
|
if($attachment['dateline'] && $attachment['tid']) { $attachment['subject'] = htmlspecialchars_uni($parser->parse_badwords($attachment['subject'])); $attachment['postlink'] = get_post_link($attachment['pid'], $attachment['tid']); $attachment['threadlink'] = get_thread_link($attachment['tid']); $attachment['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'];
|
Zeile 2860 | Zeile 2945 |
---|
remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']); } }
|
remove_attachment($attachment['pid'], $attachment['posthash'], $attachment['aid']); } }
|
| $query = $db->simple_select("attachments", "SUM(filesize) AS ausage, COUNT(aid) AS acount", "uid='".$mybb->user['uid']."'"); $usage = $db->fetch_array($query); $totalusage = $usage['ausage']; $totalattachments = $usage['acount']; $friendlyusage = get_friendly_size($totalusage); if($mybb->usergroup['attachquota']) { $percent = round(($totalusage/($mybb->usergroup['attachquota']*1024))*100)."%"; $attachquota = get_friendly_size($mybb->usergroup['attachquota']*1024); $usagenote = $lang->sprintf($lang->attachments_usage_quota, $friendlyusage, $attachquota, $percent, $totalattachments); } else { $percent = $lang->unlimited; $attachquota = $lang->unlimited; $usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments); }
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");
|
$bandwidth = get_friendly_size($bandwidth);
if(!$attachments)
| $bandwidth = get_friendly_size($bandwidth);
if(!$attachments)
|
Zeile 2899 | Zeile 3004 |
---|
{ // 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_start"); $db->update_query("users", array('notepad' => $db->escape_string($mybb->input['notepad'])), "uid='".$mybb->user['uid']."'");
|
Zeile 2910 | Zeile 3021 |
---|
{ // Get posts per day $daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);
|
{ // Get posts per day $daysreg = (TIME_NOW - $mybb->user['regdate']) / (24*3600);
|
| if($daysreg < 1) { $daysreg = 1; }
|
$perday = $mybb->user['postnum'] / $daysreg; $perday = round($perday, 2); if($perday > $mybb->user['postnum'])
| $perday = $mybb->user['postnum'] / $daysreg; $perday = round($perday, 2); if($perday > $mybb->user['postnum'])
|
Zeile 2940 | Zeile 3057 |
---|
{ $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 2962 | Zeile 3079 |
---|
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($mybb->settings['enablewarningsystem'] != 0 && $mybb->settings['canviewownwarning'] != 0) { $warning_level = round($mybb->user['warningpoints']/$mybb->settings['maxwarningpoints']*100);
|
Zeile 3066 | Zeile 3184 |
---|
$plugins->run_hooks("usercp_notepad_end"); // Thread Subscriptions with New Posts
|
$plugins->run_hooks("usercp_notepad_end"); // 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)) {
|
| $visible = "AND t.visible != 0"; if(is_moderator() == true) { $visible = ''; }
|
$query = $db->query(" SELECT s.*, t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
$query = $db->query(" SELECT s.*, t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threadsubscriptions s LEFT JOIN ".TABLE_PREFIX."threads t ON (s.tid=t.tid) LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE s.uid='".$mybb->user['uid']."'
| WHERE s.uid='".$mybb->user['uid']."' {$visible}
|
ORDER BY t.lastpost DESC LIMIT 0, 10 ");
| ORDER BY t.lastpost DESC LIMIT 0, 10 ");
|
Zeile 3083 | Zeile 3208 |
---|
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)
| if($forumpermissions['canview'] != 0 && $forumpermissions['canviewthreads'] != 0 && ($forumpermissions['canonlyviewownthreads'] == 0 || $subscription['uid'] == $mybb->user['uid']))
|
{ $subscriptions[$subscription['tid']] = $subscription; }
| { $subscriptions[$subscription['tid']] = $subscription; }
|
Zeile 3125 | Zeile 3250 |
---|
foreach($subscriptions as $thread) {
|
foreach($subscriptions as $thread) {
|
| $folder = ''; $folder_label = ''; $gotounread = '';
|
if($thread['tid']) { $bgcolor = alt_trow();
| if($thread['tid']) { $bgcolor = alt_trow();
|
Zeile 3179 | Zeile 3308 |
---|
} $folder .= "folder";
|
} $folder .= "folder";
|
| if($thread['visible'] == 0) { $bgcolor = "trow_shaded"; }
|
$lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
| $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']); $lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']);
|
Zeile 3188 | Zeile 3322 |
---|
if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
if($lastposteruid == 0) { $lastposterlink = $lastposter;
|
}
| }
|
else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
| else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
Zeile 3209 | Zeile 3343 |
---|
// 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) { $f_perm_sql = "AND t.fid NOT IN (".$unviewable_forums.")";
|
$unviewable_forums = get_unviewable_forums(); if($unviewable_forums) { $f_perm_sql = "AND t.fid NOT IN (".$unviewable_forums.")";
|
| }
$visible = " AND t.visible != 0"; if(is_moderator() == true) { $visible = '';
|
}
$query = $db->query(" SELECT t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
}
$query = $db->query(" SELECT t.*, t.username AS threadusername, u.username FROM ".TABLE_PREFIX."threads t LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid = t.uid)
|
WHERE t.uid='".$mybb->user['uid']."' {$f_perm_sql}
| WHERE t.uid='".$mybb->user['uid']."' AND t.firstpost != 0 AND t.visible != '-2' {$visible} {$f_perm_sql}
|
ORDER BY t.lastpost DESC LIMIT 0, 5 ");
| ORDER BY t.lastpost DESC LIMIT 0, 5 ");
|
Zeile 3228 | Zeile 3369 |
---|
$threadcache = array(); $fpermissions = forum_permissions(); while($thread = $db->fetch_array($query))
|
$threadcache = array(); $fpermissions = forum_permissions(); while($thread = $db->fetch_array($query))
|
{
| {
|
// Moderated, and not moderator? if($thread['visible'] == 0 && is_moderator($thread['fid']) === false) {
| // Moderated, and not moderator? if($thread['visible'] == 0 && is_moderator($thread['fid']) === false) {
|
Zeile 3237 | Zeile 3378 |
---|
$forumpermissions = $fpermissions[$thread['fid']]; if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0)
|
$forumpermissions = $fpermissions[$thread['fid']]; if($forumpermissions['canview'] != 0 || $forumpermissions['canviewthreads'] != 0)
|
{
| {
|
$threadcache[$thread['tid']] = $thread; } }
| $threadcache[$thread['tid']] = $thread; } }
|
Zeile 3266 | Zeile 3407 |
---|
while($readthread = $db->fetch_array($query)) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
while($readthread = $db->fetch_array($query)) { $threadcache[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
} }
| } }
|
// Icon Stuff if($mybb->settings['dotfolders'] != 0) {
| // Icon Stuff if($mybb->settings['dotfolders'] != 0) {
|
Zeile 3278 | Zeile 3419 |
---|
$threadcache[$post['tid']]['doticon'] = 1; } }
|
$threadcache[$post['tid']]['doticon'] = 1; } }
|
|
|
$icon_cache = $cache->read("posticons"); // Run the threads...
|
$icon_cache = $cache->read("posticons"); // Run the threads...
|
| $latest_threads_threads = '';
|
foreach($threadcache as $thread) { if($thread['tid'])
| foreach($threadcache as $thread) { if($thread['tid'])
|
Zeile 3306 | Zeile 3448 |
---|
else { $thread['displayprefix'] = '';
|
else { $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 3319 | Zeile 3461 |
---|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else
|
$icon = "<img src=\"{$icon['path']}\" alt=\"{$icon['name']}\" />"; } else
|
{
| {
|
$icon = " "; }
| $icon = " "; }
|
Zeile 3338 | Zeile 3480 |
---|
{ $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 3386 | Zeile 3529 |
---|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
{ $folder .= "hot"; $folder_label .= $lang->icon_hot;
|
| }
// Is our thread visible? if($thread['visible'] == 0) { $bgcolor = 'trow_shaded';
|
}
if($thread['closed'] == 1)
| }
if($thread['closed'] == 1)
|