Vergleich admin/modules/forum/attachments.php - 1.6.2 - 1.6.15

  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: attachments.php 5016 2010-06-12 00:24:02Z RyanGordon $

 * $Id$

 */

// Disallow direct access to this file for security reasons

 */

// Disallow direct access to this file for security reasons

Zeile 211Zeile 211
		{
$user['username'] = $lang->na;
}

		{
$user['username'] = $lang->na;
}

		$table->construct_cell(build_profile_link($user['username'], $user['useruid']));
$table->construct_cell("<a href=\"index.php?module=forum-attachments&amp;results=1&amp;username=".urlencode($user['username'])."\">".get_friendly_size($user['totalsize'])."</a>", array('class' => 'align_center'));

		$table->construct_cell(build_profile_link($user['username'], $user['useruid'], "_blank"));
$table->construct_cell("<a href=\"index.php?module=forum-attachments&amp;results=1&amp;username=".urlencode($user['username'])."\" target=\"_blank\">".get_friendly_size($user['totalsize'])."</a>", array('class' => 'align_center'));

		$table->construct_row();
}
$table->output($lang->users_diskspace);

		$table->construct_row();
}
$table->output($lang->users_diskspace);

Zeile 365Zeile 365
			$query = $db->simple_select("attachments", "*", "aid IN (".implode(",", $aids).")");
while($attachment = $db->fetch_array($query))
{

			$query = $db->simple_select("attachments", "*", "aid IN (".implode(",", $aids).")");
while($attachment = $db->fetch_array($query))
{

 
				$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);


				if($missing_attachment_files[$attachment['aid']])
{
$reason = $lang->reason_file_missing;

				if($missing_attachment_files[$attachment['aid']])
{
$reason = $lang->reason_file_missing;

Zeile 379Zeile 381
				}
$table->construct_cell($form->generate_check_box('orphaned_attachments[]', $attachment['aid'], '', array('checked' => true)));
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));

				}
$table->construct_cell($form->generate_check_box('orphaned_attachments[]', $attachment['aid'], '', array('checked' => true)));
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));

				$table->construct_cell("<span class=\"float_right\">".get_friendly_size($attachment['filesize'])."</span><a href=\"../attachment.php?aid={$attachment['aid']}\">{$attachment['filename']}</a>", array('class' => $cell_class));

				$table->construct_cell("<span class=\"float_right\">".get_friendly_size($attachment['filesize'])."</span>{$attachment['filename']}", array('class' => $cell_class));

				$table->construct_cell($reason, array('class' => 'align_center'));
if($attachment['dateuploaded'])
{

				$table->construct_cell($reason, array('class' => 'align_center'));
if($attachment['dateuploaded'])
{

Zeile 412Zeile 414
		echo "<h3>{$lang->step2of2}</h3>";
echo "<p class=\"align_center\">{$lang->step2of2_line1}</p>";
echo "<p class=\"align_center\">{$lang->step_line2}</p>";

		echo "<h3>{$lang->step2of2}</h3>";
echo "<p class=\"align_center\">{$lang->step2of2_line1}</p>";
echo "<p class=\"align_center\">{$lang->step_line2}</p>";

		echo "<p class=\"align_center\"><img src=\"styles/{$page->style}/images/spinner_big.gif\" alt=\"Scanning..\" id=\"spinner\" /></p>";

		echo "<p class=\"align_center\"><img src=\"styles/{$page->style}/images/spinner_big.gif\" alt=\"{$lang->scanning}\" id=\"spinner\" /></p>";


$page->output_footer(false);
flush();


$page->output_footer(false);
flush();

Zeile 571Zeile 573
		echo "<h3>{$lang->step1of2}</h3>";
echo "<p class=\"align_center\">{$lang->step1of2_line1}</p>";
echo "<p class=\"align_center\">{$lang->step_line2}</p>";

		echo "<h3>{$lang->step1of2}</h3>";
echo "<p class=\"align_center\">{$lang->step1of2_line1}</p>";
echo "<p class=\"align_center\">{$lang->step_line2}</p>";

		echo "<p class=\"align_center\"><img src=\"styles/{$page->style}/images/spinner_big.gif\" alt=\"Scanning..\" id=\"spinner\" /></p>";

		echo "<p class=\"align_center\"><img src=\"styles/{$page->style}/images/spinner_big.gif\" alt=\"{$lang->scanning}\" id=\"spinner\" /></p>";


$page->output_footer(false);



$page->output_footer(false);


Zeile 631Zeile 633
			else
{
$search_sql .= " AND a.uid='{$user['uid']}'";

			else
{
$search_sql .= " AND a.uid='{$user['uid']}'";

			}

			}

		}

$forum_cache = cache_forums();

		}

$forum_cache = cache_forums();

Zeile 642Zeile 644
			if(!is_array($mybb->input['forum']))
{
$mybb->input['forum'] = array($mybb->input['forum']);

			if(!is_array($mybb->input['forum']))
{
$mybb->input['forum'] = array($mybb->input['forum']);

			}

			}


$fid_in = array();
foreach($mybb->input['forum'] as $fid)


$fid_in = array();
foreach($mybb->input['forum'] as $fid)

Zeile 675Zeile 677

$direction_fields = array("dateuploaded", "filesize", "downloads");
foreach($direction_fields as $search_field)


$direction_fields = array("dateuploaded", "filesize", "downloads");
foreach($direction_fields as $search_field)

		{

		{

			$direction_field = $search_field."_dir";
if($mybb->input[$search_field] && $mybb->input[$direction_field])
{

			$direction_field = $search_field."_dir";
if($mybb->input[$search_field] && $mybb->input[$direction_field])
{

Zeile 691Zeile 693
						$direction = "=";
}
$search_sql .= " AND a.{$search_field}{$direction}'".$db->escape_string($mybb->input[$search_field])."'";

						$direction = "=";
}
$search_sql .= " AND a.{$search_field}{$direction}'".$db->escape_string($mybb->input[$search_field])."'";

			}
}

			}
}

		if(!$errors)
{
// Lets fetch out how many results we have

		if(!$errors)
{
// Lets fetch out how many results we have

Zeile 708Zeile 710
			if(!$num_results)
{
$errors[] = $lang->error_no_results;

			if(!$num_results)
{
$errors[] = $lang->error_no_results;

			}

			}

		}

// Now we fetch the results if there were 100% no errors
if(!$errors)
{

		}

// Now we fetch the results if there were 100% no errors
if(!$errors)
{

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

			if(!$mybb->input['perpage'])
{
$mybb->input['perpage'] = 20;
}

			if(!$mybb->input['perpage'])
{
$mybb->input['perpage'] = 20;
}

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

 

$mybb->input['page'] = intval($mybb->input['page']);
if($mybb->input['page'])


$mybb->input['page'] = intval($mybb->input['page']);
if($mybb->input['page'])

Zeile 733Zeile 735

switch($mybb->input['sortby'])
{


switch($mybb->input['sortby'])
{

				case "lastactive":

				case "filesize":

					$sort_field = "a.filesize";
break;
case "downloads":

					$sort_field = "a.filesize";
break;
case "downloads":

Zeile 750Zeile 752
					$mybb->input['sortby'] = "filename";
}


					$mybb->input['sortby'] = "filename";
}


			if($mybb->input['sortorder'] != "desc")

			if($mybb->input['order'] != "desc")

			{

			{

				$mybb->input['sortorder'] = "asc";

				$mybb->input['order'] = "asc";

			}

$page->add_breadcrumb_item($lang->results);

			}

$page->add_breadcrumb_item($lang->results);

Zeile 779Zeile 781
				LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
WHERE {$search_sql}

				LEFT JOIN ".TABLE_PREFIX."threads t ON (t.tid=p.tid)
LEFT JOIN ".TABLE_PREFIX."users u ON (u.uid=a.uid)
WHERE {$search_sql}

				ORDER BY {$sort_field} {$mybb->input['sortorder']}

				ORDER BY {$sort_field} {$mybb->input['order']}

				LIMIT {$start}, {$mybb->input['perpage']}
");
while($attachment = $db->fetch_array($query))

				LIMIT {$start}, {$mybb->input['perpage']}
");
while($attachment = $db->fetch_array($query))

Zeile 791Zeile 793
			if($num_results > $mybb->input['perpage'])
{
$pagination_url = "index.php?module=forum-attachments&amp;results=1";

			if($num_results > $mybb->input['perpage'])
{
$pagination_url = "index.php?module=forum-attachments&amp;results=1";

				$pagination_vars = array('filename', 'mimetype', 'username', 'fid', 'downloads', 'downloads_dir', 'dateuploaded', 'dateuploaded_dir', 'filesize', 'filesize_dir');

				$pagination_vars = array('perpage', 'sortby', 'order', 'filename', 'mimetype', 'username', 'fid', 'downloads', 'downloads_dir', 'dateuploaded', 'dateuploaded_dir', 'filesize', 'filesize_dir');

				foreach($pagination_vars as $var)
{
if($mybb->input[$var])

				foreach($pagination_vars as $var)
{
if($mybb->input[$var])

Zeile 875Zeile 877
function build_attachment_row($attachment, &$table, $use_form=false)
{
global $mybb, $form;

function build_attachment_row($attachment, &$table, $use_form=false)
{
global $mybb, $form;

	$attachment['filename'] = htmlspecialchars($attachment['filename']);

	$attachment['filename'] = htmlspecialchars_uni($attachment['filename']);


// Here we do a bit of detection, we want to automatically check for removal any missing attachments and any not assigned to a post uploaded > 24hours ago
// Check if the attachment exists in the file system


// Here we do a bit of detection, we want to automatically check for removal any missing attachments and any not assigned to a post uploaded > 24hours ago
// Check if the attachment exists in the file system

Zeile 918Zeile 920
		$table->construct_cell($form->generate_check_box('aids[]', $attachment['aid'], '', array('checked' => $checked)));
}
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));

		$table->construct_cell($form->generate_check_box('aids[]', $attachment['aid'], '', array('checked' => $checked)));
}
$table->construct_cell(get_attachment_icon(get_extension($attachment['filename'])), array('width' => 1));

	$table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\">{$attachment['filename']}</a>");

	$table->construct_cell("<a href=\"../attachment.php?aid={$attachment['aid']}\" target=\"_blank\">{$attachment['filename']}</a>");

	$table->construct_cell(get_friendly_size($attachment['filesize']), array('class' => $cell_class));

if($attachment['user_username'])
{
$attachment['username'] = $attachment['username'];
}

	$table->construct_cell(get_friendly_size($attachment['filesize']), array('class' => $cell_class));

if($attachment['user_username'])
{
$attachment['username'] = $attachment['username'];
}

	$table->construct_cell(build_profile_link($attachment['username'], $attachment['uid']), array("class" => "align_center"));
$table->construct_cell("<a href=\"../".get_post_link($attachment['pid'])."\">".htmlspecialchars($attachment['subject'])."</a>", array("class" => "align_center"));

	$table->construct_cell(build_profile_link($attachment['username'], $attachment['uid'], "_blank"), array("class" => "align_center"));
$table->construct_cell("<a href=\"../".get_post_link($attachment['pid'])."\" target=\"_blank\">".htmlspecialchars_uni($attachment['subject'])."</a>", array("class" => "align_center"));

	$table->construct_cell(my_number_format($attachment['downloads']), array("class" => "align_center"));
if($attachment['dateuploaded'] > 0)
{

	$table->construct_cell(my_number_format($attachment['downloads']), array("class" => "align_center"));
if($attachment['dateuploaded'] > 0)
{