diff options
Diffstat (limited to 'phpBB/develop')
30 files changed, 374 insertions, 132 deletions
| diff --git a/phpBB/develop/add_permissions.php b/phpBB/develop/add_permissions.php index 035c23f49c..5d9af3cad5 100644 --- a/phpBB/develop/add_permissions.php +++ b/phpBB/develop/add_permissions.php @@ -413,5 +413,3 @@ function mass_auth($ug_type, $forum_id, $ug_id, $acl_list, $setting)  	unset($sql_ary);  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_avatars.php b/phpBB/develop/adjust_avatars.php index 81599e694b..dc4ae88f37 100644 --- a/phpBB/develop/adjust_avatars.php +++ b/phpBB/develop/adjust_avatars.php @@ -143,5 +143,3 @@ function adjust_avatar($old_name, $midfix)  	}  	return false;  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_bbcodes.php b/phpBB/develop/adjust_bbcodes.php index f06f0112ab..5a7f065d7f 100644 --- a/phpBB/develop/adjust_bbcodes.php +++ b/phpBB/develop/adjust_bbcodes.php @@ -170,5 +170,3 @@ $db->sql_freeresult($result);  // Done  $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_magic_urls.php b/phpBB/develop/adjust_magic_urls.php index 1430a47a12..c417c755cf 100644 --- a/phpBB/develop/adjust_magic_urls.php +++ b/phpBB/develop/adjust_magic_urls.php @@ -122,5 +122,3 @@ $db->sql_freeresult($result);  // Done  $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_sizes.php b/phpBB/develop/adjust_sizes.php index 7d72813056..9b58389163 100644 --- a/phpBB/develop/adjust_sizes.php +++ b/phpBB/develop/adjust_sizes.php @@ -128,5 +128,3 @@ $db->sql_freeresult($result);  // Done  $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_smilies.php b/phpBB/develop/adjust_smilies.php index 774c8834f6..ecc3461670 100644 --- a/phpBB/develop/adjust_smilies.php +++ b/phpBB/develop/adjust_smilies.php @@ -126,5 +126,3 @@ $db->sql_freeresult($result);  // Done  $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_uids.php b/phpBB/develop/adjust_uids.php index d301f3cadb..3468475b8f 100644 --- a/phpBB/develop/adjust_uids.php +++ b/phpBB/develop/adjust_uids.php @@ -126,4 +126,3 @@ $db->sql_freeresult($result);  // Done  $db->sql_close();  echo 'done'; -?>
\ No newline at end of file diff --git a/phpBB/develop/adjust_usernames.php b/phpBB/develop/adjust_usernames.php index 1afa77af16..111a9a30d7 100644 --- a/phpBB/develop/adjust_usernames.php +++ b/phpBB/develop/adjust_usernames.php @@ -48,5 +48,3 @@ echo 'FINISHED';  // Done  $db->sql_close(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/benchmark.php b/phpBB/develop/benchmark.php index 5bbe6f53be..c867b9262e 100644 --- a/phpBB/develop/benchmark.php +++ b/phpBB/develop/benchmark.php @@ -458,5 +458,3 @@ function make_user($username)  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/calc_email_hash.php b/phpBB/develop/calc_email_hash.php index a67b0f52a3..0f7540ee7d 100644 --- a/phpBB/develop/calc_email_hash.php +++ b/phpBB/develop/calc_email_hash.php @@ -72,5 +72,3 @@ do  while ($start);  echo "<p><b>Done</b></p>\n"; -  -?>
\ No newline at end of file diff --git a/phpBB/develop/change_smiley_ref.php b/phpBB/develop/change_smiley_ref.php index db65dd52d4..23a26951bf 100644 --- a/phpBB/develop/change_smiley_ref.php +++ b/phpBB/develop/change_smiley_ref.php @@ -58,5 +58,3 @@ while ($row = $db->sql_fetchrow($result))  $db->sql_freeresult($result);  echo "<p><b>Done</b></p>\n"; -  -?>
\ No newline at end of file diff --git a/phpBB/develop/compile_template.php b/phpBB/develop/compile_template.php new file mode 100644 index 0000000000..e741e909d8 --- /dev/null +++ b/phpBB/develop/compile_template.php @@ -0,0 +1,24 @@ +<?php +// ------------------------------------------------------------- +// +// $Id$ +// +// FILENAME  : compile_template.php +// STARTED   : Sun Apr 24, 2011 +// COPYRIGHT : © 2011 phpBB Group +// WWW       : http://www.phpbb.com/ +// LICENCE   : GPL vs2.0 [ see /docs/COPYING ]  +//  +// ------------------------------------------------------------- + +define('IN_PHPBB', 1); +define('ANONYMOUS', 1); +$phpEx = substr(strrchr(__FILE__, '.'), 1); +$phpbb_root_path = './../'; + +include($phpbb_root_path . 'includes/template_compile.'.$phpEx); + +$file = $argv[1]; + +$compile = new phpbb_template_compile(); +echo $compile->compile_file($file); diff --git a/phpBB/develop/create_schema_files.php b/phpBB/develop/create_schema_files.php index 7f37b94453..a957e2c40b 100644 --- a/phpBB/develop/create_schema_files.php +++ b/phpBB/develop/create_schema_files.php @@ -1167,7 +1167,8 @@ function get_schema_struct()  			'group_receive_pm'		=> array('BOOL', 0),  			'group_message_limit'	=> array('UINT', 0),  			'group_max_recipients'	=> array('UINT', 0), -			'group_legend'			=> array('BOOL', 1), +			'group_legend'			=> array('UINT', 0), +			'group_teampage'		=> array('UINT', 0),  		),  		'PRIMARY_KEY'	=> 'group_id',  		'KEYS'			=> array( @@ -1221,6 +1222,7 @@ function get_schema_struct()  		'PRIMARY_KEY'	=> 'log_id',  		'KEYS'			=> array(  			'log_type'				=> array('INDEX', 'log_type'), +			'log_time'				=> array('INDEX', 'log_time'),  			'forum_id'				=> array('INDEX', 'forum_id'),  			'topic_id'				=> array('INDEX', 'topic_id'),  			'reportee_id'			=> array('INDEX', 'reportee_id'), @@ -1450,6 +1452,7 @@ function get_schema_struct()  			'field_validation'		=> array('VCHAR_UNI:20', ''),  			'field_required'		=> array('BOOL', 0),  			'field_show_on_reg'		=> array('BOOL', 0), +			'field_show_on_pm'		=> array('BOOL', 0),  			'field_show_on_vt'		=> array('BOOL', 0),  			'field_show_profile'	=> array('BOOL', 0),  			'field_hide'			=> array('BOOL', 0), @@ -1643,14 +1646,12 @@ function get_schema_struct()  			'style_active'			=> array('BOOL', 1),  			'template_id'			=> array('UINT', 0),  			'theme_id'				=> array('UINT', 0), -			'imageset_id'			=> array('UINT', 0),  		),  		'PRIMARY_KEY'	=> 'style_id',  		'KEYS'			=> array(  			'style_name'		=> array('UNIQUE', 'style_name'),  			'template_id'		=> array('INDEX', 'template_id'),  			'theme_id'			=> array('INDEX', 'theme_id'), -			'imageset_id'		=> array('INDEX', 'imageset_id'),  		),  	); @@ -1661,7 +1662,6 @@ function get_schema_struct()  			'template_copyright'	=> array('VCHAR_UNI', ''),  			'template_path'			=> array('VCHAR:100', ''),  			'bbcode_bitfield'		=> array('VCHAR:255', 'kNg='), -			'template_storedb'		=> array('BOOL', 0),  			'template_inherits_id'		=> array('UINT:4', 0),  			'template_inherit_path'		=> array('VCHAR', ''),  		), @@ -1671,29 +1671,12 @@ function get_schema_struct()  		),  	); -	$schema_data['phpbb_styles_template_data'] = array( -		'COLUMNS'		=> array( -			'template_id'			=> array('UINT', 0), -			'template_filename'		=> array('VCHAR:100', ''), -			'template_included'		=> array('TEXT', ''), -			'template_mtime'		=> array('TIMESTAMP', 0), -			'template_data'			=> array('MTEXT_UNI', ''), -		), -		'KEYS'			=> array( -			'tid'					=> array('INDEX', 'template_id'), -			'tfn'					=> array('INDEX', 'template_filename'), -		), -	); -  	$schema_data['phpbb_styles_theme'] = array(  		'COLUMNS'		=> array(  			'theme_id'				=> array('UINT', NULL, 'auto_increment'),  			'theme_name'			=> array('VCHAR_UNI:255', ''),  			'theme_copyright'		=> array('VCHAR_UNI', ''),  			'theme_path'			=> array('VCHAR:100', ''), -			'theme_storedb'			=> array('BOOL', 0), -			'theme_mtime'			=> array('TIMESTAMP', 0), -			'theme_data'			=> array('MTEXT_UNI', ''),  		),  		'PRIMARY_KEY'	=> 'theme_id',  		'KEYS'			=> array( @@ -1701,35 +1684,6 @@ function get_schema_struct()  		),  	); -	$schema_data['phpbb_styles_imageset'] = array( -		'COLUMNS'		=> array( -			'imageset_id'				=> array('UINT', NULL, 'auto_increment'), -			'imageset_name'				=> array('VCHAR_UNI:255', ''), -			'imageset_copyright'		=> array('VCHAR_UNI', ''), -			'imageset_path'				=> array('VCHAR:100', ''), -		), -		'PRIMARY_KEY'		=> 'imageset_id', -		'KEYS'				=> array( -			'imgset_nm'			=> array('UNIQUE', 'imageset_name'), -		), -	); - -	$schema_data['phpbb_styles_imageset_data'] = array( -		'COLUMNS'		=> array( -			'image_id'				=> array('UINT', NULL, 'auto_increment'), -			'image_name'			=> array('VCHAR:200', ''), -			'image_filename'		=> array('VCHAR:200', ''), -			'image_lang'			=> array('VCHAR:30', ''), -			'image_height'			=> array('USINT', 0), -			'image_width'			=> array('USINT', 0), -			'imageset_id'			=> array('UINT', 0), -		), -		'PRIMARY_KEY'		=> 'image_id', -		'KEYS'				=> array( -			'i_d'			=> array('INDEX', 'imageset_id'), -		), -	); -  	$schema_data['phpbb_topics'] = array(  		'COLUMNS'		=> array(  			'topic_id'					=> array('UINT', NULL, 'auto_increment'), @@ -2085,4 +2039,3 @@ EOF;  }  echo 'done'; - diff --git a/phpBB/develop/create_variable_overview.php b/phpBB/develop/create_variable_overview.php index fe7cacf0d1..b42d1aebe2 100644 --- a/phpBB/develop/create_variable_overview.php +++ b/phpBB/develop/create_variable_overview.php @@ -44,7 +44,7 @@ fwrite($fp, $contents);  fclose($fp);  $html_skeleton = ' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!DOCTYPE html>  <html>  <head>  <link rel="stylesheet" href="subSilver.css" type="text/css"> @@ -362,7 +362,7 @@ echo '<br>Store Files';  $fp = fopen($store_dir . 'index.html', 'w');  $html_data = ' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!DOCTYPE html>  <html>  <head>  <link rel="stylesheet" href="subSilver.css" type="text/css"> @@ -427,7 +427,7 @@ fwrite($common_fp, "<?php\n\n \$lang = array(\n");  $fp = fopen($store_dir . 'lang_index.html', 'w');  $html_data = ' -<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<!DOCTYPE html>  <html>  <head>  <link rel="stylesheet" href="subSilver.css" type="text/css"> @@ -543,5 +543,3 @@ fclose($fp);  echo '<br>Finished!';  flush(); - -?>
\ No newline at end of file diff --git a/phpBB/develop/fill.php b/phpBB/develop/fill.php index 336e510d06..c9824e88e5 100644 --- a/phpBB/develop/fill.php +++ b/phpBB/develop/fill.php @@ -186,5 +186,3 @@ function rndm_username()  	return $usernames[array_rand($usernames)];  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/generate_utf_casefold.php b/phpBB/develop/generate_utf_casefold.php index 89c4aec01a..4f764ca471 100644 --- a/phpBB/develop/generate_utf_casefold.php +++ b/phpBB/develop/generate_utf_casefold.php @@ -152,5 +152,3 @@ function download($url)  	echo "\n";  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/generate_utf_confusables.php b/phpBB/develop/generate_utf_confusables.php index 0ffa9720c9..bc88e67ba9 100644 --- a/phpBB/develop/generate_utf_confusables.php +++ b/phpBB/develop/generate_utf_confusables.php @@ -240,5 +240,3 @@ function download($url)  	echo "\n";  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/generate_utf_tables.php b/phpBB/develop/generate_utf_tables.php index 3d5188163d..dbef125803 100644 --- a/phpBB/develop/generate_utf_tables.php +++ b/phpBB/develop/generate_utf_tables.php @@ -569,4 +569,4 @@ function cp_to_utf($cp)  	{  		return chr($cp);  	} -}
\ No newline at end of file +} diff --git a/phpBB/develop/imageset_to_css.php b/phpBB/develop/imageset_to_css.php new file mode 100644 index 0000000000..3d55808319 --- /dev/null +++ b/phpBB/develop/imageset_to_css.php @@ -0,0 +1,274 @@ +<?php + +/* +	Converts imageset to CSS code +	 +	Change style name and path below, open in browser. +*/ + +$phpbb_root_path = '../'; +$style = 'subsilver2'; + +$imageset_path = $phpbb_root_path . 'styles/' . $style . '/imageset'; +$theme_path = $phpbb_root_path . 'styles/' . $style . '/theme2'; + +// Start output buffering +ob_start(); + +// Get global and English images +$images_global = get_imageset($imageset_path); +if($images_global === false) +{ +	echo 'imageset.cfg was not found.'; +	echo ob_get_clean(); +	return; +} +$images_en = get_imageset($imageset_path, 'en'); +if($images_en === false) +{ +	echo 'English imageset.cfg was not found.'; +	echo ob_get_clean(); +	return; +} + +// Remove duplicate images +foreach($images_en as $key => $row) +{ +	unset($images_global[$key]); +} + +// CSS replacements +$not_compatible = array( +	'{T_TEMPLATE_PATH}', +	'{T_IMAGESET_PATH}', +	'{T_IMAGESET_LANG_PATH}', +	'{T_STYLESHEET_NAME}', +	'{S_USER_LANG}' +); +$replace = array( +	'{T_THEME_PATH}'	=> '.', +); +// Enable/disable one of lines below to enable/disable replacement of English buttons +// $replace = array_merge($replace, get_replacements($images_global)); +$replace = array_merge($replace, get_replacements($images_global), get_replacements($images_en)); + +// Get all CSS files, parse them +$files = list_files($theme_path, 'css'); +if($files === false || !count($files)) +{ +	echo 'No CSS files found in theme directory.<br />'; +} +else for($i=0; $i<count($files); $i++) +{ +	$file = $theme_path . '/' . $files[$i]; +	$data = file_get_contents($file); +	$hash = md5($data); +	$data = strtr($data, $replace); +	$errors = false; +	for($j=0; $j<count($not_compatible); $j++) +	{ +		if(strpos($data, $not_compatible[$j]) !== false) +		{ +			echo 'Error: ', $file, ' contains ', $not_compatible[$j], '. That variable cannot be converted.<br />'; +		} +	} +	if(md5($data) == $hash) +	{ +		echo 'Nothing to replace in ', $file, '<br />'; +	} +	else +	{ +		echo 'Updated ', $file, ':', dump_code($data, $files[$i]); +	} +} + +// Check if there are invalid images in imageset +$list = array_merge($images_global, $images_en); +foreach($list as $key => $row) +{ +	if($row['skip']) +	{ +		echo 'Unable to generate code to add to CSS files because some images are missing or invalid. See errors above.'; +		echo ob_get_clean(); +		return; +	} +} + +// Code to add to CSS files +$code = ' +/* Former imageset */ +span.imageset { +	display: inline-block; +	background: transparent none 0 0 no-repeat; +	margin: 0; +	padding: 0; +	width: 0; +	height: 0; +	overflow: hidden; +} + +/* Global imageset items */ +' . css($images_global, './images/') . ' + +/* English images for fallback */ +' . css($images_en, './en/'); +echo 'Code to add to CSS file:', dump_code($code, 'imageset.css'); + +$list = list_languages($imageset_path); +for($i=0; $i<count($list); $i++) +{ +	$lang = $list[$i]; +	$images = get_imageset($imageset_path . '/' . $lang); +	if(!count($images)) continue; +	$code = '/* ' . strtoupper($lang) . ' Language Pack */ +' . css($images, './'); +	echo 'New CSS file: ', $theme_path, '/', $lang, '/stylesheet.css', dump_code($code, 'stylesheet_' . $lang . '.css'); +} + +echo ob_get_clean(); +return; + + +/* +	Functions +*/ +function get_imageset($path, $lang = '') +{ +	$cfg = $path . ($lang ? '/' . $lang : '') . '/imageset.cfg'; +	if(!@file_exists($cfg)) return false; +	$data = file($cfg); +	$result = array(); +	for($i=0; $i<count($data); $i++) +	{ +		$str = trim($data[$i]); +		if(substr($str, 0, 4) != 'img_') continue; +		$list = explode('=', $data[$i]); +		if(count($list) != 2) continue; +		$key = trim($list[0]); +		$row = explode('*', trim($list[1])); +		$file = trim($row[0]); +		$height = isset($row[1]) && intval($row[1]) ? intval($row[1]) : false; +		$width = isset($row[2]) && intval($row[2]) ? intval($row[2]) : false; +		$skip = false; +		if(strlen($file) && (!$width || !$height)) +		{ +			// Try to detect width/height +			$filename = $path . ($lang ? '/' . $lang : '') . '/' . $file; +			if(!@file_exists($filename)) +			{ +				echo 'Error: file ', $filename, ' does not exist and its dimensions are not available in imageset.cfg<br />'; +				$skip = true; +			} +			else +			{ +				$size = @getimagesize($filename); +				if($size === false) +				{ +					echo 'Error: file ', $filename, ' is not a valid image<br />'; +					$skip = true; +				} +				else +				{ +					if(!$width) $width = intval($size[0]); +					if(!$height) $height = intval($size[1]); +				} +			} +		} +		$result[$key] = array( +			'lang'  => $lang, +			'file'  => $file, +			'height'	=> $height, +			'width' => $width, +			'skip'  => $skip +		); +	} +	return $result; +} + +function get_replacements($list) +{ +	$result = array(); +	foreach($list as $key => $row) +	{ +		$key = '{' . strtoupper($key); +		$result[$key . '_SRC}'] = strlen($row['file']) ? ($row['lang'] ? './' . $row['lang'] : './images') . '/' . $row['file'] : ''; +		$result[$key . '_WIDTH}'] = intval($row['width']); +		$result[$key . '_HEIGHT}'] = intval($row['height']); +	} +	return $result; +} + +function list_files($dir, $ext) +{ +	$res = @opendir($dir); +	if($res === false) return false; +	$files = array(); +	while(($file = readdir($res)) !== false) +	{ +		$list = explode('.', $file); +		if(count($list) > 1 && strtolower($list[count($list) - 1]) == $ext) +		{ +			$files[] = $file; +		} +	} +	closedir($res); +	return $files; +} + +function list_languages($dir) +{ +	$res = @opendir($dir); +	if($res === false) return array(); +	$files = array(); +	while(($file = readdir($res)) !== false) +	{ +		if(substr($file, 0, 1) == '.') continue; +		$filename = $dir . '/' . $file; +		if(is_dir($filename) && file_exists($filename . '/imageset.cfg')) +		{ +			$files[] = $file; +		} +	} +	closedir($res); +	return $files; +} + +function dump_code($code, $filename = 'file.txt') +{ +	$hash = md5($code); +	if(isset($_GET['download']) && $_GET['download'] === $hash) +	{ +		// Download file +		ob_end_clean(); +		header('Pragma: public'); +		header('Expires: 0'); +		header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); +		header('Content-Type: application/force-download'); +		header('Content-Disposition: attachment; filename="' . $filename . '";'); +		header('Content-Transfer-Encoding: binary'); +		header('Content-Length: ' . strlen($code)); +		echo $code; +		exit; +	} +	$list = explode("\n", $code); +	$height = 15 * count($list); +	echo ' [ <a href="?download=', $hash, '">download</a> <a href="javascript:void(0);" onclick="document.getElementById(\'code-', $hash, '\').style.height = \'', $height, 'px\'; this.style.display = \'none\'; return false;">expand</a> ]<br />'; +	echo '<textarea id="code-', $hash, '" onfocus="this.select();" style="width: 98%; height: 200px;">', htmlspecialchars($code), '</textarea><br />'; +} + +function css($list, $path = './') +{ +	$code = ''; +	foreach($list as $key => $row) +	{ +		if(!strlen($row['file'])) continue; +		$code .= '.imageset.' . substr($key, 4) . ' { +	background-image: url("' . $path . $row['file'] . '"); +	padding-left: ' . $row['width'] . 'px; +	padding-top: ' . $row['height'] . 'px; +} +'; +	} +	return $code; +} + diff --git a/phpBB/develop/lang_duplicates.php b/phpBB/develop/lang_duplicates.php index 5be48f69f0..3ea841b6d6 100644 --- a/phpBB/develop/lang_duplicates.php +++ b/phpBB/develop/lang_duplicates.php @@ -137,4 +137,4 @@ function find_modules($dirname)  ?>  	</body> -</html>
\ No newline at end of file +</html> diff --git a/phpBB/develop/merge_attachment_tables.php b/phpBB/develop/merge_attachment_tables.php index ae7fe57be4..aa6be0a26e 100644 --- a/phpBB/develop/merge_attachment_tables.php +++ b/phpBB/develop/merge_attachment_tables.php @@ -76,5 +76,3 @@ $db->sql_query($sql);  //$db->sql_query("DROP TABLE {$table_prefix}attach_temp");  echo "<p><b>Done</b></p>\n"; -  -?>
\ No newline at end of file diff --git a/phpBB/develop/merge_post_tables.php b/phpBB/develop/merge_post_tables.php index 3567a569c6..e7e22409a5 100644 --- a/phpBB/develop/merge_post_tables.php +++ b/phpBB/develop/merge_post_tables.php @@ -205,5 +205,3 @@ foreach ($sql_ary as $sql)  }  echo "<p><b>Done</b></p>\n"; -  -?>
\ No newline at end of file diff --git a/phpBB/develop/mysql_upgrader.php b/phpBB/develop/mysql_upgrader.php index dec8f8c210..c54a7155c2 100644 --- a/phpBB/develop/mysql_upgrader.php +++ b/phpBB/develop/mysql_upgrader.php @@ -689,6 +689,7 @@ function get_schema_struct()  		'PRIMARY_KEY'	=> 'log_id',  		'KEYS'			=> array(  			'log_type'				=> array('INDEX', 'log_type'), +			'log_time'				=> array('INDEX', 'log_time'),  			'forum_id'				=> array('INDEX', 'forum_id'),  			'topic_id'				=> array('INDEX', 'topic_id'),  			'reportee_id'			=> array('INDEX', 'reportee_id'), @@ -1093,14 +1094,12 @@ function get_schema_struct()  			'style_active'			=> array('BOOL', 1),  			'template_id'			=> array('UINT', 0),  			'theme_id'				=> array('UINT', 0), -			'imageset_id'			=> array('UINT', 0),  		),  		'PRIMARY_KEY'	=> 'style_id',  		'KEYS'			=> array(  			'style_name'		=> array('UNIQUE', 'style_name'),  			'template_id'		=> array('INDEX', 'template_id'),  			'theme_id'			=> array('INDEX', 'theme_id'), -			'imageset_id'		=> array('INDEX', 'imageset_id'),  		),  	); @@ -1151,35 +1150,6 @@ function get_schema_struct()  		),  	); -	$schema_data['phpbb_styles_imageset'] = array( -		'COLUMNS'		=> array( -			'imageset_id'				=> array('UINT', NULL, 'auto_increment'), -			'imageset_name'				=> array('VCHAR_UNI:255', ''), -			'imageset_copyright'		=> array('VCHAR_UNI', ''), -			'imageset_path'				=> array('VCHAR:100', ''), -		), -		'PRIMARY_KEY'		=> 'imageset_id', -		'KEYS'				=> array( -			'imgset_nm'			=> array('UNIQUE', 'imageset_name'), -		), -	); - -	$schema_data['phpbb_styles_imageset_data'] = array( -		'COLUMNS'		=> array( -			'image_id'				=> array('UINT', NULL, 'auto_increment'), -			'image_name'			=> array('VCHAR:200', ''), -			'image_filename'		=> array('VCHAR:200', ''), -			'image_lang'			=> array('VCHAR:30', ''), -			'image_height'			=> array('USINT', 0), -			'image_width'			=> array('USINT', 0), -			'imageset_id'			=> array('UINT', 0), -		), -		'PRIMARY_KEY'		=> 'image_id', -		'KEYS'				=> array( -			'i_d'			=> array('INDEX', 'imageset_id'), -		), -	); -  	$schema_data['phpbb_topics'] = array(  		'COLUMNS'		=> array(  			'topic_id'					=> array('UINT', NULL, 'auto_increment'), @@ -1398,5 +1368,3 @@ function get_schema_struct()  	return $schema_data;  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/nuke-db.php b/phpBB/develop/nuke-db.php index d7329c3f56..e1f64a6177 100644 --- a/phpBB/develop/nuke-db.php +++ b/phpBB/develop/nuke-db.php @@ -54,5 +54,3 @@ else  		flush();  	}  } -?> - diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 8165ba1f21..46b6fff701 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -80,5 +80,3 @@ echo 'www.URL: ' . $www_url . "<br />\n";  // no schema and no authority  $relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?";  echo 'relative URL: ' . $relative_url . "<br />\n"; - -?>
\ No newline at end of file diff --git a/phpBB/develop/remove-php-end-tags.py b/phpBB/develop/remove-php-end-tags.py new file mode 100755 index 0000000000..1707c6d519 --- /dev/null +++ b/phpBB/develop/remove-php-end-tags.py @@ -0,0 +1,65 @@ +#!/usr/bin/env python +# Remove ending PHP tags '?>' +# @author Oleg Pudeyev +# @license http://opensource.org/licenses/gpl-license.php GNU Public License + +import sys, os, os.path, optparse + +def error(message, code): +    print >>sys.stderr, message +    exit(code) + + +parser = optparse.OptionParser() +parser.add_option('-a', '--aggressive', help='Remove ending tags when they are followed by whitespace', action='store_true') +options, args = parser.parse_args() + +if len(args) != 1: +    parser.usage() +    error("Usage: remove-php-end-tags path", 2) + +path = args[0] + +if not os.path.exists(path): +    error("Path does not exist: %s" % path, 3) + +if options.aggressive: +    import re +     +    fix_re = re.compile(r'\s*\?>\s*$') +    def fix_content(content): +        content = fix_re.sub(r'\n', content) +        return content +else: +    def fix_content(content): +        if content.endswith('?>'): +            content = content[:-2].strip() + "\n" +        return content + +def process_file(path): +    f = open(path) +    try: +        content = f.read() +    finally: +        f.close() +    fixed_content = fix_content(content) +    if content != fixed_content: +        f = open(path, 'w') +        try: +            f.write(fixed_content) +        finally: +            f.close() + +def process_dir(path): +    for root, dirs, files in os.walk(path): +        if '.svn' in dirs: +            dirs.remove('.svn') +        for file in files: +            if file.endswith('.php'): +                path = os.path.join(root, file) +                process_file(path) + +if os.path.isdir(path): +    process_dir(path) +else: +    process_file(path) diff --git a/phpBB/develop/repair_bots.php b/phpBB/develop/repair_bots.php index c5aaa75d9b..790d3d9f2f 100644 --- a/phpBB/develop/repair_bots.php +++ b/phpBB/develop/repair_bots.php @@ -147,5 +147,3 @@ function add_bots($bots)  		}  	}  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/unicode_testing.php b/phpBB/develop/unicode_testing.php index 25a13d1325..ec3c71d078 100644 --- a/phpBB/develop/unicode_testing.php +++ b/phpBB/develop/unicode_testing.php @@ -116,5 +116,3 @@ function utf8_normalize_nfkc($strings)  	return $strings;  } - -?>
\ No newline at end of file diff --git a/phpBB/develop/update_email_hash.php b/phpBB/develop/update_email_hash.php index 80fd4bbc17..57aebe3ca0 100644 --- a/phpBB/develop/update_email_hash.php +++ b/phpBB/develop/update_email_hash.php @@ -54,4 +54,3 @@ echo 'FINISHED';  // Done  $db->sql_close(); -?>
\ No newline at end of file diff --git a/phpBB/develop/utf_normalizer_test.php b/phpBB/develop/utf_normalizer_test.php index 7705cd6851..463a274f66 100644 --- a/phpBB/develop/utf_normalizer_test.php +++ b/phpBB/develop/utf_normalizer_test.php @@ -388,4 +388,4 @@ function cp_to_utf($cp)  	{  		return chr($cp);  	} -}
\ No newline at end of file +} | 
