feat: Add releaseDateYear function to dynamically display the copyright year in the footer based on the build timestamp

This commit is contained in:
Zack Spear
2025-04-04 18:36:46 -07:00
parent d11b22215f
commit e6d4c8ca29

View File

@@ -1,4 +1,17 @@
<?
function releaseDateYear() {
global $var;
$timestamp = _var($var, 'regBuildTime', '');
if (!$timestamp) {
return '';
}
$date = new DateTime();
$date->setTimestamp($timestamp);
return $date->format('Y');
}
function getArrayStatus($var) {
$progress = (_var($var,'fsProgress')!='') ? $var['fsProgress'] : "";
@@ -40,7 +53,7 @@ function getArrayStatus($var) {
</span>
<? endif; ?>
<span id="copyright">
Unraid&reg; webGui &copy;<?=date('Y')?>, Lime Technology, Inc.
Unraid&reg; webGui &copy;<?=releaseDateYear()?>, Lime Technology, Inc.
<a href="https://docs.unraid.net/go/manual/" target="_blank" title="<?=_('Online manual')?>">
<i class="fa fa-book"></i> <?=_('manual')?>
</a>
@@ -49,4 +62,4 @@ function getArrayStatus($var) {
themes='<?=htmlspecialchars(json_encode(['azure', 'gray', 'black', 'white']), ENT_QUOTES, 'UTF-8')?>'>
</unraid-theme-switcher>
</span>
</footer>
</footer>