Skip to content

Commit bdad2ce

Browse files
committed
Release an updated smfinfo.php.
Fixed a issue with the theme when logged out. Fixed a issue with not detecting SMF 2.1 version due to changes in handling versioning in 2.1.
1 parent 02733fd commit bdad2ce

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

smfinfo.php

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
*
66
* @package SMF
77
* @author Simple Machines
8-
* @copyright 2019 Simple Machines
8+
* @copyright 2020 Simple Machines
99
* @license https://www.simplemachines.org/about/smf/license.php BSD
1010
*
11-
* @version 2.0.16
11+
* @version 2.0.17
1212
*/
1313

1414
// If SSI.php is in the same place as this file, and SMF isn't defined, this is being run standalone.
@@ -489,6 +489,7 @@ function addLoadEvent(func)
489489
<div id="wrapper">';
490490

491491
if (allowedTo('admin_forum'))
492+
{
492493
echo '
493494
<div class="windowbg" style="margin: 1ex; padding: 1ex 2ex; border: 1px dashed green; color: green;">
494495
', sprintf($txt['smfinfo_pass'], $smfInfo), '<br /><br />
@@ -523,8 +524,8 @@ function smfInfoCurrentVersion()
523524
{
524525
smfInfoCurrentVersion();';
525526

526-
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'])
527-
echo '
527+
if ($context['browser']['is_ie'] && !$context['browser']['is_ie4'])
528+
echo '
528529
if (typeof(smf_codeFix) != "undefined")
529530
window.detachEvent("onload", smf_codeFix);
530531
window.attachEvent("onload",
@@ -537,13 +538,15 @@ function ()
537538
if (typeof(smf_codeFix) != "undefined")
538539
window.attachEvent("onload", smf_codeFix);';
539540

540-
echo '
541+
echo '
541542
542543
if (oldonload)
543544
oldonload();
544545
}
545546
// ]]></script>
546547
</div>';
548+
}
549+
547550
echo '
548551
<select id="menuDropdown" onchange="swapSection(this[this.selectedIndex].value); return true;">
549552
<option value="0">-- Menu --</option>
@@ -1553,7 +1556,9 @@ function get_file_versions($core = false)
15531556
// The version looks rougly like... that.
15541557
if (preg_match('~\$forum_version\s=\s\'SMF (.+)\'~i', $header, $match) == 1)
15551558
$context['forum_version'] = $match[1];
1556-
1559+
// SMF 2.1+: define('SMF_VERSION', '2.1 RC2');
1560+
elseif (preg_match('~define\(\'SMF_VERSION\',\s*\'(.+)\'\);~i', $header, $match) == 1)
1561+
$context['forum_version'] = $match[1];
15571562
// Not found! This is bad.
15581563
else
15591564
$context['forum_version'] = '??';

0 commit comments

Comments
 (0)