Zeile 6 | Zeile 6 |
---|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* Website: http://www.mybboard.net * License: http://www.mybboard.net/about/license *
|
* $Id: usercp.php 4038 2008-07-25 08:50:26Z dennis $
| * $Id: usercp.php 4184 2008-09-10 04:40:17Z Tikitiki $
|
*/
define("IN_MYBB", 1);
|
*/
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_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups";
| $templatelist = "usercp,usercp_home,usercp_nav,usercp_profile,error_nopermission,buddy_online,buddy_offline,usercp_changename,usercp_nav_changename"; $templatelist .= ",usercp_usergroups_memberof_usergroup,usercp_usergroups_memberof,usercp_usergroups_joinable_usergroup,usercp_usergroups_joinable,usercp_usergroups";
|
Zeile 198 | Zeile 199 |
---|
"away" => 1, "date" => $awaydate, "returndate" => $returndate,
|
"away" => 1, "date" => $awaydate, "returndate" => $returndate,
|
"awayreason" => $mybb->input['awayreason']
| "awayreason" => $db->escape_string($mybb->input['awayreason'])
|
); } else
| ); } else
|
Zeile 1135 | Zeile 1136 |
---|
}
// Clean input - only accept integers thanks!
|
}
// Clean input - only accept integers thanks!
|
array_walk($mybb->input['check'], 'intval');
| $mybb->input['check'] = array_map('intval', $mybb->input['check']);
|
$tids = implode(",", $mybb->input['check']);
// Deleting these subscriptions?
| $tids = implode(",", $mybb->input['check']);
// Deleting these subscriptions?
|
Zeile 1235 | Zeile 1236 |
---|
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. $query = $db->query(" SELECT fid FROM ".TABLE_PREFIX."forums WHERE active != 0 ORDER BY pid, disporder "); $forumsread = unserialize($mybb->cookies['mybb']['forumread']); } else { // Build a forum cache. $query = $db->query(" SELECT f.fid, fr.dateline AS lastread FROM ".TABLE_PREFIX."forums f LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}') WHERE f.active != 0 ORDER BY pid, disporder "); } while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0) { if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']]; } } $readforums[$forum['fid']] = $forum['lastread']; }
|
// Check participation by the current user in any of these threads - for 'dot' folder icons if($mybb->settings['dotfolders'] != 0)
| // Check participation by the current user in any of these threads - for 'dot' folder icons if($mybb->settings['dotfolders'] != 0)
|
Zeile 1253 | Zeile 1289 |
---|
while($readthread = $db->fetch_array($query)) { $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
while($readthread = $db->fetch_array($query)) { $subscriptions[$readthread['tid']]['lastread'] = $readthread['dateline'];
|
} }
| } }
|
// Now we can build our subscription list foreach($subscriptions as $thread) {
| // Now we can build our subscription list foreach($subscriptions as $thread) {
|
Zeile 1278 | Zeile 1313 |
---|
{ $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 = " ";
|
}
| }
|
// Determine the folder $folder = ''; $folder_label = '';
|
// Determine the folder $folder = ''; $folder_label = '';
|
|
|
if($thread['doticon']) { $folder = "dot_"; $folder_label .= $lang->icon_dot;
|
if($thread['doticon']) { $folder = "dot_"; $folder_label .= $lang->icon_dot;
|
}
| }
|
$gotounread = ''; $isnew = 0; $donenew = 0; $lastread = 0;
|
$gotounread = ''; $isnew = 0; $donenew = 0; $lastread = 0;
|
$forumread = my_get_array_cookie("forumread", $thread['fid']); if($mybb->user['lastvisit'] > $forumread) { $forumread = $mybb->user['lastvisit']; }
if($mybb->settings['threadreadcut'] > 0 && $thread['lastpost'] > $forumread)
| 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) { $forum_read = $read_cutoff; } } 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 1316 | Zeile 1360 |
---|
{ if($thread['lastread']) {
|
{ if($thread['lastread']) {
|
$lastread = $thread['lastread'];
| $lastread = $thread['lastread'];
|
} else {
|
} else {
|
$lastread = 1;
| $lastread = 1;
|
} } }
| } } }
|
Zeile 1328 | Zeile 1372 |
---|
if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
|
if(!$lastread) { $readcookie = $threadread = my_get_array_cookie("threadread", $thread['tid']);
|
if($readcookie > $forumread)
| if($readcookie > $forum_read)
|
{ $lastread = $readcookie; } else {
|
{ $lastread = $readcookie; } else {
|
$lastread = $forumread;
| $lastread = $forum_read;
|
} }
| } }
|
Zeile 1351 | Zeile 1395 |
---|
{ $folder_label .= $lang->icon_no_new; $new_class = "";
|
{ $folder_label .= $lang->icon_no_new; $new_class = "";
|
}
| }
|
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
|
if($thread['replies'] >= $mybb->settings['hottopic'] || $thread['views'] >= $mybb->settings['hottopicviews'])
|
{
| {
|
$folder .= "hot"; $folder_label .= $lang->icon_hot;
|
$folder .= "hot"; $folder_label .= $lang->icon_hot;
|
}
| }
|
if($thread['closed'] == 1) {
| if($thread['closed'] == 1) {
|
Zeile 1373 | Zeile 1417 |
---|
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter']; $lastposteruid = $thread['lastposteruid'];
|
$lastposttime = my_date($mybb->settings['timeformat'], $thread['lastpost']); $lastposter = $thread['lastposter']; $lastposteruid = $thread['lastposteruid'];
|
|
|
// 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 = $lastposter; } else
|
Zeile 1395 | Zeile 1439 |
---|
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")."\";");
|
} } else { eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
| } } else { eval("\$threads = \"".$templates->get("usercp_subscriptions_none")."\";");
|
} eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";"); $plugins->run_hooks("usercp_subscriptions_end");
| } eval("\$subscriptions = \"".$templates->get("usercp_subscriptions")."\";"); $plugins->run_hooks("usercp_subscriptions_end");
|
Zeile 1411 | Zeile 1455 |
---|
if($mybb->input['action'] == "forumsubscriptions") { $plugins->run_hooks("usercp_forumsubscriptions_start");
|
if($mybb->input['action'] == "forumsubscriptions") { $plugins->run_hooks("usercp_forumsubscriptions_start");
|
$query = $db->query(" SELECT * FROM ".TABLE_PREFIX."forumpermissions WHERE gid='".$mybb->user['usergroup']."' ");
| $query = $db->simple_select("forumpermissions", "*", "gid='".$db->escape_string($mybb->user['usergroup'])."'");
|
while($permissions = $db->fetch_array($query))
|
while($permissions = $db->fetch_array($query))
|
{
| {
|
$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions; }
|
$permissioncache[$permissions['gid']][$permissions['fid']] = $permissions; }
|
| if($mybb->user['uid'] == 0) { // Build a forum cache. $query = $db->query(" SELECT fid FROM ".TABLE_PREFIX."forums WHERE active != 0 ORDER BY pid, disporder "); $forumsread = unserialize($mybb->cookies['mybb']['forumread']); } else { // Build a forum cache. $query = $db->query(" SELECT f.fid, fr.dateline AS lastread FROM ".TABLE_PREFIX."forums f LEFT JOIN ".TABLE_PREFIX."forumsread fr ON (fr.fid=f.fid AND fr.uid='{$mybb->user['uid']}') WHERE f.active != 0 ORDER BY pid, disporder "); } while($forum = $db->fetch_array($query)) { if($mybb->user['uid'] == 0) { if($forumsread[$forum['fid']]) { $forum['lastread'] = $forumsread[$forum['fid']]; } } $readforums[$forum['fid']] = $forum['lastread']; }
|
$fpermissions = forum_permissions(); $query = $db->query(" SELECT fs.*, f.*, t.subject AS lastpostsubject
| $fpermissions = forum_permissions(); $query = $db->query(" SELECT fs.*, f.*, t.subject AS lastpostsubject
|
Zeile 1436 | Zeile 1512 |
---|
$forumpermissions = $fpermissions[$forum['fid']]; if($forumpermissions['canview'] != 0) {
|
$forumpermissions = $fpermissions[$forum['fid']]; if($forumpermissions['canview'] != 0) {
|
if(($forum['lastpost'] > $mybb->user['lastvisit'] || $mybbforumread[$forum['fid']] > $mybb->user['lastvisit']) && $forum['lastpost'] != 0)
| if(($forum['lastpost'] > $mybb->user['lastvisit'] || $readforums[$forum['fid']] > $mybb->user['lastvisit']) && $forum['lastpost'] != 0)
|
{ $folder = "on"; }
| { $folder = "on"; }
|
Zeile 1527 | Zeile 1603 |
---|
else if($error) { $sig = $mybb->input['signature'];
|
else if($error) { $sig = $mybb->input['signature'];
|
| $template = false;
|
}
if($sig && $template)
| }
if($sig && $template)
|
Zeile 2730 | Zeile 2807 |
---|
{ error($lang->no_attachments_selected); }
|
{ error($lang->no_attachments_selected); }
|
$aids = $db->escape_string(implode(",", $mybb->input['attachments']));
| $aids = implode(',', array_map('intval', $mybb->input['attachments']));
|
$query = $db->simple_select("attachments", "*", "aid IN ($aids) AND uid='".$mybb->user['uid']."'"); while($attachment = $db->fetch_array($query)) {
| $query = $db->simple_select("attachments", "*", "aid IN ($aids) AND uid='".$mybb->user['uid']."'"); while($attachment = $db->fetch_array($query)) {
|