Skip to content

Commit

Permalink
Adds automated version, year, and copyright to ssi_example files
Browse files Browse the repository at this point in the history
Signed-off-by: Jon Stovell <[email protected]>
  • Loading branch information
Sesquipedalian committed Jan 29, 2019
1 parent 21f0ddf commit da2d6af
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
46 changes: 46 additions & 0 deletions SSI.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,52 @@ function ssi_shutdown()
template_footer();
}

/**
* Show the SMF version.
*/
function ssi_version($output_method = 'echo')
{
if ($output_method == 'echo')
echo SMF_VERSION;
else
return SMF_VERSION;
}

/**
* Show the full SMF version string.
*/
function ssi_full_version($output_method = 'echo')
{
if ($output_method == 'echo')
echo SMF_FULL_VERSION;
else
return SMF_FULL_VERSION;
}

/**
* Show the SMF software year.
*/
function ssi_software_year($output_method = 'echo')
{
if ($output_method == 'echo')
echo SMF_SOFTWARE_YEAR;
else
return SMF_SOFTWARE_YEAR;
}

/**
* Show the forum copyright. Only used in our ssi_examples files.
*/
function ssi_copyright($output_method = 'echo')
{
global $forum_copyright;

if ($output_method == 'echo')
printf($forum_copyright, SMF_FULL_VERSION, SMF_SOFTWARE_YEAR);
else
return sprintf($forum_copyright, SMF_FULL_VERSION, SMF_SOFTWARE_YEAR);
}

/**
* Display a welcome message, like: Hey, User, you have 0 messages, 0 are new.
*
Expand Down
6 changes: 3 additions & 3 deletions ssi_examples.shtml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<title> &lt;&lt; :: SMF SSI.php 2.1 RC1 :: &gt;&gt; </title>
<title> &lt;&lt; :: SMF SSI.php <!--#include virtual="./SSI.php?ssi_function=version" --> :: &gt;&gt; </title>
</head>
<body style="font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10pt;">
<h1>SMF SSI.php Functions</h1>
Current Version 2.1 RC1<br>
Current Version <!--#include virtual="./SSI.php?ssi_function=version" --><br>
<br>
This file is used to demonstrate the capabilities of SSI.php using SHTML include functions.<br>
The examples the include tag, then the results of it. Examples are separated by horizontal rules.<br>
Expand Down Expand Up @@ -150,7 +150,7 @@
<br>
<br>
<span class="smalltext">
<a href="https://www.simplemachines.org/" title="Simple Machines Forum" target="_blank" rel="noopener">SMF &copy; 2019, Simple Machines</a>
<!--#include virtual="./SSI.php?ssi_function=copyright" -->
</span>
<br>
<br>
Expand Down

0 comments on commit da2d6af

Please sign in to comment.