Files
HotLunches/site.messages.php
T
2026-10-19 15:22:52 -07:00

58 lines
1.5 KiB
PHP

<?php
if ((isset($displaySiteMessages) && $displaySiteMessages == true) || !isset($displaySiteMessages)) {
// Admin messages
if (is_file("admin-message.txt")) {
$MsgFile = fopen("admin-message.txt","r");
$Msg = trim(fgets($MsgFile,1000));
fclose($MsgFile);
if (strlen($Msg) && array_key_exists('UserInfo',$_SESSION) && in_array($_SESSION['UserInfo']['type'],array('System Administrator','Application Administrator','Financial','SuperUser'))) {
?>
<table width='<?php echo($twidth) ?>' cellpadding='3' cellspacing='1' border='0'>
<tr height='15'>
<td align='center' class='notice'><?php echo($Msg) ?></td>
</tr>
</table>
<?php
}
}
// Site messages
if (is_file("site-warning.txt")) {
$MsgFile = fopen("site-warning.txt","r");
$Msg = trim(fgets($MsgFile,1000));
fclose($MsgFile);
if (strlen($Msg)) {
?>
<table width='<?php echo($twidth) ?>' cellpadding='3' cellspacing='1' border='0'>
<tr height='15'>
<td align='center' class='warning'><b><?php echo($Msg) ?></b></td>
</tr>
</table>
<?php
}
}
if (is_file("site-message.txt")) {
$MsgFile = fopen("site-message.txt","r");
$Msg = trim(fgets($MsgFile,1000));
fclose($MsgFile);
if (strlen($Msg)) {
?>
<table width='<?php echo($twidth) ?>' cellpadding='3' cellspacing='1' border='0'>
<tr height='15'>
<td align='center' class='notice'><?php echo($Msg) ?></td>
</tr>
</table>
<?php
}
}
}
?>