phpBB

Code Changes

File: includes/acp/acp_attachments.php

  Unmodified   Added   Modified   Removed
Line 90Line 90
				$s_assigned_groups = array();
while ($row = $db->sql_fetchrow($result))
{

				$s_assigned_groups = array();
while ($row = $db->sql_fetchrow($result))
{

 
					$row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'];

					$s_assigned_groups[$row['cat_id']][] = $row['group_name'];
}
$db->sql_freeresult($result);

					$s_assigned_groups[$row['cat_id']][] = $row['group_name'];
}
$db->sql_freeresult($result);

Line 124Line 125
						'legend2'					=> $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

						'legend2'					=> $l_legend_cat_images,
'img_display_inlined' => array('lang' => 'DISPLAY_INLINED', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'img_create_thumbnail' => array('lang' => 'CREATE_THUMBNAIL', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),

						'img_max_thumb_width'		=> array('lang' => 'MAX_THUMB_WIDTH',		'validate' => 'int',	'type' => 'text:7:15', 'explain' => true, 'append' => ' px'),

						'img_max_thumb_width'		=> array('lang' => 'MAX_THUMB_WIDTH',		'validate' => 'int',	'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),

						'img_min_thumb_filesize'	=> array('lang' => 'MIN_THUMB_FILESIZE',	'validate' => 'int',	'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),

						'img_min_thumb_filesize'	=> array('lang' => 'MIN_THUMB_FILESIZE',	'validate' => 'int',	'type' => 'text:7:15', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),

						'img_imagick'				=> array('lang' => 'IMAGICK_PATH',			'validate' => 'string',	'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' px'),

						'img_imagick'				=> array('lang' => 'IMAGICK_PATH',			'validate' => 'absolute_path',	'type' => 'text:20:200', 'explain' => true, 'append' => '&nbsp;&nbsp;<span>[ <a href="' . $this->u_action . '&amp;action=imgmagick">' . $user->lang['SEARCH_IMAGICK'] . '</a> ]</span>'),
'img_max' => array('lang' => 'MAX_IMAGE_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),
'img_link' => array('lang' => 'IMAGE_LINK_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true, 'append' => ' ' . $user->lang['PIXEL']),

					)
);


					)
);


Line 494Line 495
						$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . "
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'";

						$sql = 'SELECT group_id
FROM ' . EXTENSION_GROUPS_TABLE . "
WHERE LOWER(group_name) = '" . $db->sql_escape(utf8_strtolower($new_group_name)) . "'";

 
						if ($group_id)
{
$sql .= ' AND group_id <> ' . $group_id;
}

						$result = $db->sql_query($sql);

if ($db->sql_fetchrow($result))

						$result = $db->sql_query($sql);

if ($db->sql_fetchrow($result))

Line 551Line 556
							$group_id = $db->sql_nextid();
}


							$group_id = $db->sql_nextid();
}


 
						$group_name = (isset($user->lang['EXT_GROUP_' . $group_name])) ? $user->lang['EXT_GROUP_' . $group_name] : $group_name;

						add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name);
}


						add_log('admin', 'LOG_ATTACH_EXTGROUP_' . strtoupper($action), $group_name);
}


Line 684Line 690
							$ext_group_row['max_filesize'] = (int) $config['max_filesize'];
}


							$ext_group_row['max_filesize'] = (int) $config['max_filesize'];
}


						$size_format = ($ext_group_row['max_filesize'] >= 1048576) ? 'mb' : (($ext_group_row['max_filesize'] >= 1024) ? 'kb' : 'b');
$ext_group_row['max_filesize'] = get_formatted_filesize($ext_group_row['max_filesize'], false);


						$max_filesize = get_formatted_filesize($ext_group_row['max_filesize'], false, array('mb', 'kb', 'b'));
$size_format = $max_filesize['si_identifier'];
$ext_group_row['max_filesize'] = $max_filesize['value'];


$img_path = $config['upload_icons_path'];



$img_path = $config['upload_icons_path'];


Line 694Line 701

$imglist = filelist($phpbb_root_path . $img_path);



$imglist = filelist($phpbb_root_path . $img_path);


						if (sizeof($imglist))

						if (!empty($imglist['']))

						{
$imglist = array_values($imglist);
$imglist = $imglist[0];

						{
$imglist = array_values($imglist);
$imglist = $imglist[0];

Line 857Line 864
						'U_EDIT'		=> $this->u_action . "&amp;action=edit&amp;g={$row['group_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;g={$row['group_id']}",


						'U_EDIT'		=> $this->u_action . "&amp;action=edit&amp;g={$row['group_id']}",
'U_DELETE' => $this->u_action . "&amp;action=delete&amp;g={$row['group_id']}",


						'GROUP_NAME'	=> $row['group_name'],

						'GROUP_NAME'	=> (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'],

						'CATEGORY'		=> $cat_lang[$row['cat_id']],
)
);

						'CATEGORY'		=> $cat_lang[$row['cat_id']],
)
);

Line 1003Line 1010

if ($files_added)
{


if ($files_added)
{

							set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true);
set_config('num_files', $config['num_files'] + $files_added, true);

							set_config_count('upload_dir_size', $space_taken, true);
set_config_count('num_files', $files_added, true);

						}
}
}

						}
}
}

Line 1026Line 1033
					$template->assign_block_vars('orphan', array(
'FILESIZE' => get_formatted_filesize($row['filesize']),
'FILETIME' => $user->format_date($row['filetime']),

					$template->assign_block_vars('orphan', array(
'FILESIZE' => get_formatted_filesize($row['filesize']),
'FILETIME' => $user->format_date($row['filetime']),

						'REAL_FILENAME'		=> basename($row['real_filename']),
'PHYSICAL_FILENAME' => basename($row['physical_filename']),

						'REAL_FILENAME'		=> utf8_basename($row['real_filename']),
'PHYSICAL_FILENAME' => utf8_basename($row['physical_filename']),

						'ATTACH_ID'			=> $row['attach_id'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&amp;id=' . $row['attach_id']))

						'ATTACH_ID'			=> $row['attach_id'],
'POST_IDS' => (!empty($post_ids[$row['attach_id']])) ? $post_ids[$row['attach_id']] : '',
'U_FILE' => append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'mode=view&amp;id=' . $row['attach_id']))

Line 1117Line 1124
		$group_name = array();
while ($row = $db->sql_fetchrow($result))
{

		$group_name = array();
while ($row = $db->sql_fetchrow($result))
{

 
			$row['group_name'] = (isset($user->lang['EXT_GROUP_' . $row['group_name']])) ? $user->lang['EXT_GROUP_' . $row['group_name']] : $row['group_name'];

			$group_name[] = $row;
}
$db->sql_freeresult($result);

			$group_name[] = $row;
}
$db->sql_freeresult($result);

Line 1214Line 1222
			return;
}


			return;
}


		if (!is_writable($phpbb_root_path . $upload_dir))

		if (!phpbb_is_writable($phpbb_root_path . $upload_dir))

		{
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
return;

		{
$error[] = sprintf($user->lang['NO_WRITE_UPLOAD'], $upload_dir);
return;

Line 1429Line 1437
	function max_filesize($value, $key = '')
{
// Determine size var and adjust the value accordingly

	function max_filesize($value, $key = '')
{
// Determine size var and adjust the value accordingly

		$size_var = ($value >= 1048576) ? 'mb' : (($value >= 1024) ? 'kb' : 'b');
$value = get_formatted_filesize($value, false);


		$filesize = get_formatted_filesize($value, false, array('mb', 'kb', 'b'));
$size_var = $filesize['si_identifier'];
$value = $filesize['value'];


return '<input type="text" id="' . $key . '" size="8" maxlength="15" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
}


return '<input type="text" id="' . $key . '" size="8" maxlength="15" name="config[' . $key . ']" value="' . $value . '" /> <select name="' . $key . '">' . size_select_options($size_var) . '</select>';
}