Initial commit.
This commit is contained in:
27
lib/php/monica/copyyear.inc.php
Normal file
27
lib/php/monica/copyyear.inc.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// File name: copyyear.inc.php
|
||||
// Description: PHP subroutine to obtain the copyright year
|
||||
// Date: 2004-06-05
|
||||
// Author: imacat <imacat@pristine.com.tw>
|
||||
// Copyright: Copyright (C) 2004-2007 Pristine Communications
|
||||
|
||||
// copyyear: Return the copyright year
|
||||
function copyyear($startyear)
|
||||
{
|
||||
// Cache the result
|
||||
static $cache;
|
||||
// Return the cache
|
||||
if (isset($cache)) {
|
||||
return $cache;
|
||||
}
|
||||
$thisyear = date("Y");
|
||||
if ($thisyear == $startyear) {
|
||||
$cache = $startyear;
|
||||
} else {
|
||||
$cache = $startyear . "-" . $thisyear;
|
||||
}
|
||||
return $cache;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user