Browse Source

Merge pull request #913 from Oldiesmann/release-2.1

! Tweak support version to reflect that we're showing ImageMagick versio...
Michael Eshom 11 years ago
parent
commit
fb661c4a14
3 changed files with 19 additions and 15 deletions
  1. 1 2
      Sources/Admin.php
  2. 17 11
      Sources/Subs-Admin.php
  3. 1 2
      Themes/default/languages/Admin.english.php

+ 1 - 2
Sources/Admin.php

@@ -524,8 +524,7 @@ function AdminHome()
 	require_once($sourcedir . '/Subs-Admin.php');
 	$checkFor = array(
 		'gd',
-		'imagick',
-		'magickwand',
+		'imagemagick',
 		'db_server',
 		'mmcache',
 		'eaccelerator',

+ 17 - 11
Sources/Subs-Admin.php

@@ -35,19 +35,25 @@ function getServerVersions($checkFor)
 		$versions['gd'] = array('title' => $txt['support_versions_gd'], 'version' => $temp['GD Version']);
 	}
 
-	// Why not have a look at ImageMagick? If it is, we should show version information for it too.
-	if (in_array('imagick', $checkFor) && class_exists('Imagick'))
+	// Why not have a look at ImageMagick? If it's installed, we should show version information for it too.
+	if (in_array('imagemagick', $checkFor) && (class_exists('Imagick') || function_exists('MagickGetVersionString')))
 	{
-		$temp = New Imagick;
-		$temp2 = $temp->getVersion();
-		$versions['imagick'] = array('title' => $txt['support_versions_imagick'], 'version' => $temp2['versionString']);
-	}
+		if (class_exists('Imagick'))
+		{
+			$temp = New Imagick;
+			$temp2 = $temp->getVersion();
+			$im_version = $temp2['versionString'];
+			$extension_version = 'Imagick ' . phpversion('Imagick');
+		}
+		else
+		{
+			$im_version = MagickGetVersionString();
+			$extension_version = 'MagickWand ' . phpversion('MagickWand');
+		}
 
-	// Don't forget MagickWand either!
-	if (in_array('magickwand', $checkFor) && function_exists('MagickGetVersionString'))
-	{
-		$temp = MagickGetVersionString();
-		$versions['magickwand'] = array('title' => $txt['support_versions_magickwand'], 'version' => $temp);
+		// We already know it's ImageMagick and the website isn't needed...
+		$im_version = str_replace(array('ImageMagick ', ' http://www.imagemagick.org'), '', $im_version);
+		$versions['imagemagick'] = array('title' => $txt['support_versions_imagemagick'], 'version' => $im_version . '(' . $extension_version . ')');
 	}
 
 	// Now lets check for the Database.

+ 1 - 2
Themes/default/languages/Admin.english.php

@@ -298,8 +298,7 @@ $txt['support_versions_php'] = 'PHP version';
 $txt['support_versions_db'] = '%1$s version';
 $txt['support_versions_server'] = 'Server version';
 $txt['support_versions_gd'] = 'GD version';
-$txt['support_versions_imagick'] = 'Imagick version';
-$txt['support_versions_magickwand'] = 'MagickWand version';
+$txt['support_versions_imagemagick'] = 'ImageMagick version';
 $txt['support_versions'] = 'Version Information';
 $txt['support_resources'] = 'Support Resources';
 $txt['support_resources_p1'] = 'Our <a href="%1$s">Online Manual</a> provides the main documentation for SMF. The SMF Online Manual has many documents to help answer support questions and explain <a href="%2$s">Features</a>, <a href="%3$s">Settings</a>, <a href="%4$s">Themes</a>, <a href="%5$s">Packages</a>, etc. The Online Manual documents each area of SMF thoroughly and should answer most questions quickly.';