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("IN_MYBB", 1);
|
Zeile 1256 | Zeile 1256 |
---|
if(is_array($del_subscriptions)) { $tids = implode(',', $del_subscriptions);
|
if(is_array($del_subscriptions)) { $tids = implode(',', $del_subscriptions);
|
|
|
if($tids)
|
if($tids)
|
{
| {
|
$db->delete_query("threadsubscriptions", "tid IN ({$tids}) AND uid='{$mybb->user['uid']}'");
|
$db->delete_query("threadsubscriptions", "tid IN ({$tids}) AND uid='{$mybb->user['uid']}'");
|
| }
$threadcount = $threadcount - count($del_subscriptions);
if($threadcount < 0) { $threadcount = 0;
|
} }
| } }
|
Zeile 1276 | Zeile 1284 |
---|
ORDER BY pid, disporder ");
|
ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else {
| } else {
|
Zeile 1289 | Zeile 1297 |
---|
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 1308 | Zeile 1317 |
---|
while($post = $db->fetch_array($query)) { $subscriptions[$post['tid']]['doticon'] = 1;
|
while($post = $db->fetch_array($query)) { $subscriptions[$post['tid']]['doticon'] = 1;
|
}
| }
|
}
// Read threads
| }
// Read threads
|
Zeile 1379 | Zeile 1388 |
---|
if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
if($forum_read == 0 || $forum_read < $read_cutoff) { $forum_read = $read_cutoff;
|
} } else { $forum_read = $forumsread[$thread['fid']]; }
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forum_read)
| } } else { $forum_read = $forumsread[$thread['fid']]; }
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; }
|
Zeile 1438 | Zeile 1447 |
---|
}
if($thread['closed'] == 1)
|
}
if($thread['closed'] == 1)
|
{
| {
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
|
$folder .= "lock"; $folder_label .= $lang->icon_lock;
|
}
| }
|
$folder .= "folder";
if($thread['visible'] == 0) { $bgcolor = "trow_shaded";
|
$folder .= "folder";
if($thread['visible'] == 0) { $bgcolor = "trow_shaded";
|
}
| }
|
// Build last post info $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
| // Build last post info $lastpostdate = my_date($mybb->settings['dateformat'], $thread['lastpost']);
|
Zeile 1458 | Zeile 1467 |
---|
// Don't link to guest's profiles (they have no profile). if($lastposteruid == 0)
|
// Don't link to guest's profiles (they have no profile). if($lastposteruid == 0)
|
{
| {
|
$lastposterlink = $lastposter; } else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
$lastposterlink = $lastposter; } else { $lastposterlink = build_profile_link($lastposter, $lastposteruid);
|
}
| }
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
|
$thread['replies'] = my_number_format($thread['replies']); $thread['views'] = my_number_format($thread['views']);
|
|
|
// What kind of notification type do we have here? switch($thread['notification']) {
| // What kind of notification type do we have here? switch($thread['notification']) {
|
Zeile 1477 | Zeile 1486 |
---|
break; default: // No notification $notification_type = $lang->no_notification;
|
break; default: // No notification $notification_type = $lang->no_notification;
|
}
| }
|
eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";"); }
| eval("\$threads .= \"".$templates->get("usercp_subscriptions_thread")."\";"); }
|
Zeile 1495 | Zeile 1504 |
---|
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 1514 | Zeile 1519 |
---|
ORDER BY pid, disporder ");
|
ORDER BY pid, disporder ");
|
$forumsread = unserialize($mybb->cookies['mybb']['forumread']);
| $forumsread = my_unserialize($mybb->cookies['mybb']['forumread']);
|
} else {
| } else {
|
Zeile 1527 | Zeile 1532 |
---|
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 1537 | Zeile 1543 |
---|
} } $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 1557 |
---|
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) { continue; }
$lightbulb = get_forum_lightbulb(array('open' => $forum['open'], 'lastread' => $forum['lastread']), array('lastpost' => $forum['lastpost'])); $folder = $lightbulb['folder'];
if($forum['lastpost'] == 0 || $forum['lastposter'] == "") { $lastpost = "<div align=\"center\">$lang->never</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>";
| $lastpost_subject = my_substr($lastpost_subject, 0, 25) . "...";
|
}
|
}
|
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 = htmlspecialchars_uni($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_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']);
|
$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 1678 | Zeile 1696 |
---|
"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 2309 | Zeile 2328 |
---|
{ $type = "buddy"; $query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array("order_by" => "username"));
|
{ $type = "buddy"; $query = $db->simple_select("users", "*", "uid IN ({$mybb->user['buddylist']})", array("order_by" => "username"));
|
while($user = $db->fetch_array($query)) { $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']); if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
| while($user = $db->fetch_array($query)) { $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']); if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive'])
|
{ $status = "online"; }
| { $status = "online"; }
|
Zeile 2338 | Zeile 2357 |
---|
$type = "ignored"; $query = $db->simple_select("users", "*", "uid IN ({$mybb->user['ignorelist']})", array("order_by" => "username")); while($user = $db->fetch_array($query))
|
$type = "ignored"; $query = $db->simple_select("users", "*", "uid IN ({$mybb->user['ignorelist']})", array("order_by" => "username")); while($user = $db->fetch_array($query))
|
{
| {
|
$profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']); if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive']) {
| $profile_link = build_profile_link(format_name($user['username'], $user['usergroup'], $user['displaygroup']), $user['uid']); if($user['lastactive'] > $timecut && ($user['invisible'] == 0 || $mybb->usergroup['canviewwolinvis'] == 1) && $user['lastvisit'] != $user['lastactive']) {
|
Zeile 2494 | Zeile 2513 |
---|
verify_post_check($mybb->input['my_post_key']);
if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)
|
verify_post_check($mybb->input['my_post_key']);
if(my_strpos($ingroups, ",".$mybb->input['displaygroup'].",") === false)
|
{
| {
|
error($lang->not_member_of_group); } $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['displaygroup'])."'");
| error($lang->not_member_of_group); } $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['displaygroup'])."'");
|
Zeile 2519 | Zeile 2538 |
---|
if(my_strpos($ingroups, ",".$mybb->input['leavegroup'].",") === false) { error($lang->not_member_of_group);
|
if(my_strpos($ingroups, ",".$mybb->input['leavegroup'].",") === false) { 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)
| $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['leavegroup'])."'"); $usergroup = $db->fetch_array($query); if($usergroup['type'] != 4 && $usergroup['type'] != 3)
|
Zeile 2545 | Zeile 2564 |
---|
$mybb->input['joingroup'] = intval($mybb->input['joingroup']); $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['joingroup'])."'"); $usergroup = $db->fetch_array($query);
|
$mybb->input['joingroup'] = intval($mybb->input['joingroup']); $query = $db->simple_select("usergroups", "*", "gid='".intval($mybb->input['joingroup'])."'"); $usergroup = $db->fetch_array($query);
|
|
|
if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid']) { error($lang->cannot_join_group);
| if(($usergroup['type'] != 4 && $usergroup['type'] != 3) || !$usergroup['gid']) { error($lang->cannot_join_group);
|
Zeile 2674 | Zeile 2693 |
---|
else { $displaycode = '';
|
else { $displaycode = '';
|
}
| }
|
eval("\$memberoflist = \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";"); $showmemberof = false; if($mybb->user['additionalgroups'])
| eval("\$memberoflist = \"".$templates->get("usercp_usergroups_memberof_usergroup")."\";"); $showmemberof = false; if($mybb->user['additionalgroups'])
|
Zeile 2688 | Zeile 2707 |
---|
if($groupleader[$usergroup['gid']]) { $leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">$lang->usergroup_leave_leader</span></div>";
|
if($groupleader[$usergroup['gid']]) { $leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">$lang->usergroup_leave_leader</span></div>";
|
}
| }
|
elseif($usergroup['type'] != 4 && $usergroup['type'] != 3) { $leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">{$lang->usergroup_cannot_leave}</span></div>";
|
elseif($usergroup['type'] != 4 && $usergroup['type'] != 3) { $leavelink = "<div style=\"text-align: center;\"><span class=\"smalltext\">{$lang->usergroup_cannot_leave}</span></div>";
|
}
| }
|
else { $leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."&my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";
| else { $leavelink = "<div style=\"text-align: center;\"><a href=\"usercp.php?action=usergroups&leavegroup=".$usergroup['gid']."&my_post_key={$mybb->post_code}\">".$lang->usergroup_leave."</a></div>";
|
Zeile 2700 | Zeile 2719 |
---|
if($usergroup['description']) { $description = "<br /><span class=\"smalltext\">".$usergroup['description']."</span>";
|
if($usergroup['description']) { $description = "<br /><span class=\"smalltext\">".$usergroup['description']."</span>";
|
} else
| } else
|
{ $description = ''; } if(!$usergroup['usertitle']) { // fetch title here
|
{ $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'])
|
{
| {
|
$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 = " ({$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>)";
|
}
| }
|
else { $displaycode = '';
| else { $displaycode = '';
|
Zeile 2726 | Zeile 2745 |
---|
} } eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");
|
} } eval("\$membergroups = \"".$templates->get("usercp_usergroups_memberof")."\";");
|
|
|
// List of groups this user has applied for but has not been accepted in to $query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."'"); while($request = $db->fetch_array($query))
| // List of groups this user has applied for but has not been accepted in to $query = $db->simple_select("joinrequests", "*", "uid='".$mybb->user['uid']."'"); while($request = $db->fetch_array($query))
|
Zeile 2778 | Zeile 2797 |
---|
$usergroupleaders = ''; if($groupleaders[$usergroup['gid']])
|
$usergroupleaders = ''; if($groupleaders[$usergroup['gid']])
|
{
| {
|
$comma = ''; $usergroupleaders = ''; foreach($groupleaders[$usergroup['gid']] as $leader)
| $comma = ''; $usergroupleaders = ''; foreach($groupleaders[$usergroup['gid']] as $leader)
|
Zeile 2830 | Zeile 2849 |
---|
{ $start = 0; $page = 1;
|
{ $start = 0; $page = 1;
|
}
| }
|
$end = $start + $perpage; $lower = $start+1;
| $end = $start + $perpage; $lower = $start+1;
|
Zeile 2882 | Zeile 2901 |
---|
$totalattachments = $usage['acount']; $friendlyusage = get_friendly_size($totalusage); if($mybb->usergroup['attachquota'])
|
$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 = 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);
| $percent = $lang->unlimited; $attachquota = $lang->unlimited; $usagenote = $lang->sprintf($lang->attachments_usage, $friendlyusage, $totalattachments);
|
Zeile 2907 | Zeile 2926 |
---|
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")
|
if($mybb->input['action'] == "do_attachments" && $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_attachments_start"); require_once MYBB_ROOT."inc/functions_upload.php";
| $plugins->run_hooks("usercp_do_attachments_start"); require_once MYBB_ROOT."inc/functions_upload.php";
|
Zeile 2934 | Zeile 2953 |
---|
{ // 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']."'");
|