Vergleich usercp.php - 1.6.0 - 1.6.3

  Keine Änderungen   Hinzugefügt   Modifiziert   Entfernt
Zeile 6Zeile 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: usercp.php 5380 2011-02-21 12:04:43Z Tomm $

 */

define("IN_MYBB", 1);

 */

define("IN_MYBB", 1);

Zeile 1176Zeile 1176
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 1214Zeile 1226
		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)
{
$subscriptions[$subscription['tid']] = $subscription;



if($forumpermissions['canview'] == 0 || $forumpermissions['canviewthreads'] == 0)
{
// Hmm, you don't have permission to view this thread - unsubscribe!
$del_subscriptions[] = $subscription['tid'];

		}

		}

		// Hmm, you don't have permission to view - unsubscribe!

 
		else if($subscription['tid'])
{

		else if($subscription['tid'])
{

			$del_subscriptions[] = $subscription['tid'];

			$subscriptions[$subscription['tid']] = $subscription;

		}
}


		}
}


Zeile 1274Zeile 1286
			if($mybb->user['uid'] == 0)
{
if($forumsread[$forum['fid']])

			if($mybb->user['uid'] == 0)
{
if($forumsread[$forum['fid']])

				{

				{

					$forum['lastread'] = $forumsread[$forum['fid']];
}
}

					$forum['lastread'] = $forumsread[$forum['fid']];
}
}

Zeile 1364Zeile 1376
			else
{
$forum_read = $forumsread[$thread['fid']];

			else
{
$forum_read = $forumsread[$thread['fid']];

			}

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;
}


Zeile 1383Zeile 1395
					{
$lastread = 1;
}

					{
$lastread = 1;
}

				}

				}

			}

if(!$lastread)

			}

if(!$lastread)

Zeile 1397Zeile 1409
				{
$lastread = $forum_read;
}

				{
$lastread = $forum_read;
}

			}


			}


			if($thread['lastpost'] > $lastread && $lastread)
{
$folder .= "new";

			if($thread['lastpost'] > $lastread && $lastread)
{
$folder .= "new";

Zeile 1418Zeile 1430
			{
$folder .= "hot";
$folder_label .= $lang->icon_hot;

			{
$folder .= "hot";
$folder_label .= $lang->icon_hot;

			}

			}


if($thread['closed'] == 1)
{


if($thread['closed'] == 1)
{

Zeile 1427Zeile 1439
			}

$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 1632Zeile 1648
		$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
error_no_permission();

	{
// User currently has no signature and they're suspended
error_no_permission();

Zeile 1731Zeile 1747
		);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
remove_avatars($mybb->user['uid']);

		);
$db->update_query("users", $updated_avatar, "uid='".$mybb->user['uid']."'");
remove_avatars($mybb->user['uid']);

	}

	}

	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;
}


Zeile 1747Zeile 1763
			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']);

			}

			}

			else
{
$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);

			else
{
$avatarpath = $db->escape_string($mybb->settings['avatardir']."/".$mybb->input['gallery']."/".$mybb->input['avatar']);

			}

			}


if(file_exists($avatarpath))
{


if(file_exists($avatarpath))
{

Zeile 1763Zeile 1779
					"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']);
}

			}
remove_avatars($mybb->user['uid']);
}

	}
elseif($_FILES['avatarupload']['name']) // upload avatar
{

	}
elseif($_FILES['avatarupload']['name']) // upload avatar
{

Zeile 1833Zeile 1849
				{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;

				{
$lang->error_avatartoobig = $lang->sprintf($lang->error_avatartoobig, $maxwidth, $maxheight);
$avatar_error = $lang->error_avatartoobig;

				}

				}

			}
}


			}
}


Zeile 1901Zeile 1917
		// Get a listing of avatars in this gallery
$avatardir = $mybb->settings['avatardir'];
if($gallery != "default")

		// Get a listing of avatars in this gallery
$avatardir = $mybb->settings['avatardir'];
if($gallery != "default")

		{

		{

			$avatardir .= "/$gallery";
}
$opendir = opendir($avatardir);

			$avatardir .= "/$gallery";
}
$opendir = opendir($avatardir);

Zeile 2004Zeile 2020
		else if($mybb->settings['avatarresizing'] == "user")
{
$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>";

		else if($mybb->settings['avatarresizing'] == "user")
{
$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")

}

if($mybb->input['action'] == "do_editlists")

Zeile 2029Zeile 2045
			$existing_users = explode(",", $mybb->user['ignorelist']);
}


			$existing_users = explode(",", $mybb->user['ignorelist']);
}


		if($mybb->user['buddylist'])
{

		if($mybb->user['buddylist'])
{

			// Create a list of buddies...
$selected_list = explode(",", $mybb->user['buddylist']);
}

			// Create a list of buddies...
$selected_list = explode(",", $mybb->user['buddylist']);
}

Zeile 2038Zeile 2054
	else
{
if($mybb->user['buddylist'])

	else
{
if($mybb->user['buddylist'])

		{

		{

			$existing_users = explode(",", $mybb->user['buddylist']);
}


			$existing_users = explode(",", $mybb->user['buddylist']);
}


Zeile 2172Zeile 2188
				$message = $lang->removed_from_buddy_list;
}
$message = $lang->sprintf($message, $user['username']);

				$message = $lang->removed_from_buddy_list;
}
$message = $lang->sprintf($message, $user['username']);

		}
}


		}
}


	// Now we have the new list, so throw it all back together
$new_list = implode(",", $existing_users);


	// Now we have the new list, so throw it all back together
$new_list = implode(",", $existing_users);


Zeile 2277Zeile 2293
	{
$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";
}
else

				$status = "online";
}
else

Zeile 2780Zeile 2796
	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'])
{
$mybb->settings['threadsperpage'] = 20;
}


// Pagination
if(!$mybb->settings['threadsperpage'])
{
$mybb->settings['threadsperpage'] = 20;
}

 


	$perpage = $mybb->settings['threadsperpage'];
$page = intval($mybb->input['page']);


	$perpage = $mybb->settings['threadsperpage'];
$page = intval($mybb->input['page']);


Zeile 2812Zeile 2811
		$start = ($page-1) *$perpage;
}
else

		$start = ($page-1) *$perpage;
}
else

	{

	{

		$start = 0;
$page = 1;

		$start = 0;
$page = 1;

	}


	}


	$end = $start + $perpage;
$lower = $start+1;

	$end = $start + $perpage;
$lower = $start+1;


if($end > $totalattachments)
{
$upper = $totalattachments;
}
$multipage = multipage($totalattachments, $perpage, $page, "usercp.php?action=attachments");

 

$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))
{

Zeile 2860Zeile 2854
			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 3016Zeile 3030
					$warning['points'] = "+{$warning['points']}";
}
$points = $lang->sprintf($lang->warning_points, $warning['points']);

					$warning['points'] = "+{$warning['points']}";
}
$points = $lang->sprintf($lang->warning_points, $warning['points']);





				// Figure out expiration time
if($warning['daterevoked'])
{
$expires = $lang->warning_revoked;
}
elseif($warning['expired'])

				// Figure out expiration time
if($warning['daterevoked'])
{
$expires = $lang->warning_revoked;
}
elseif($warning['expired'])

				{

				{

					$expires = $lang->already_expired;
}
elseif($warning['expires'] == 0)
{
$expires = $lang->never;

					$expires = $lang->already_expired;
}
elseif($warning['expires'] == 0)
{
$expires = $lang->never;

				}

				}

				else
{
$expires = my_date($mybb->settings['dateformat'], $warning['expires']).", ".my_date($mybb->settings['timeformat'], $warning['expires']);

				else
{
$expires = my_date($mybb->settings['dateformat'], $warning['expires']).", ".my_date($mybb->settings['timeformat'], $warning['expires']);

Zeile 3042Zeile 3056
			{
eval("\$latest_warnings = \"".$templates->get("usercp_warnings")."\";");
}

			{
eval("\$latest_warnings = \"".$templates->get("usercp_warnings")."\";");
}

		}

		}

	}

// Format username

	}

// Format username

Zeile 3069Zeile 3083
	$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 3125Zeile 3145
				
foreach($subscriptions as $thread)
{

				
foreach($subscriptions as $thread)
{

 
					$folder = '';
$folder_label = '';


					if($thread['tid'])
{
$bgcolor = alt_trow();

					if($thread['tid'])
{
$bgcolor = alt_trow();

Zeile 3179Zeile 3202
						}

$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 3213Zeile 3241
	if($unviewable_forums)
{
$f_perm_sql = "AND t.fid NOT IN (".$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
");





	// Figure out whether we can view these threads...
$threadcache = array();
$fpermissions = forum_permissions();

	// Figure out whether we can view these threads...
$threadcache = array();
$fpermissions = forum_permissions();

Zeile 3231Zeile 3265
	{
// 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)

		{

		{

			continue;
}


			continue;
}


Zeile 3255Zeile 3289
			ORDER BY pid, disporder
");
while($forum = $db->fetch_array($query))

			ORDER BY pid, disporder
");
while($forum = $db->fetch_array($query))

		{

		{

			$readforums[$forum['fid']] = $forum['lastread'];
}


			$readforums[$forum['fid']] = $forum['lastread'];
}


Zeile 3353Zeile 3387
					if($readcookie > $forum_read)
{
$lastread = $readcookie;

					if($readcookie > $forum_read)
{
$lastread = $readcookie;

					}

					}

					else
{
$lastread = $forum_read;

					else
{
$lastread = $forum_read;

Zeile 3365Zeile 3399
				{
$folder = "dot_";
$folder_label .= $lang->icon_dot;

				{
$folder = "dot_";
$folder_label .= $lang->icon_dot;

				}

				}


if($thread['lastpost'] > $lastread && $lastread)
{


if($thread['lastpost'] > $lastread && $lastread)
{

Zeile 3377Zeile 3411
					$unreadpost = 1;
}
else

					$unreadpost = 1;
}
else

				{

				{

					$folder_label .= $lang->icon_no_new;
$new_class = "subject_old";

					$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;

 
				}

// Is our thread visible?
if($thread['visible'] == 0)
{
$bgcolor = 'trow_shaded';

				}

if($thread['closed'] == 1)

				}

if($thread['closed'] == 1)