[Remind-Fans] making your .reminders visible on a web site
Ian! D. Allen
idallen at idallen.ca
Tue Oct 5 20:23:33 EDT 2021
Hello Brian -
On Tue, Oct 05, 2021 at 04:51:44PM -0400, Brian Flaherty via Remind-fans wrote:
> Ian! D. Allen, would you be willing to share your process of getting your
> remind calendar on a visible website?
I have a web page (below) with embedded PHP that sets a $months variable
and then calls remind -p and sends the output into rem2html.
rem2html is from /usr/share/doc/remind/examples/www/rem2html.gz
See Also /usr/share/doc/remind/examples/www/README.rem2html
rem-default.css is from /usr/share/doc/remind/examples/www/rem-default.css
with my own customization styles added for my web reminders. I have
added a lot of custom styles for reminders in the calendar that I use
with class= attributes in "SPECIAL HTML" lines like this:
PUSH-OMIT-CONTEXT
OMIT Jul 11 2021
FSET t() _StartT(120) + " iOpener Dance "
set d "++99 AT 10:00 SUN SKIP"
REM [d] MSG %"%"[t()] [_End()]%
REM [d] SPECIAL HTML <a class="ian-dance" href="http://www.iopenerdance.com"
>[t()]</a>
POP-OMIT-CONTEXT
I have _Start() and _End() functions that mess with how the date/time
is displayed depending on how far into the future the reminder is.
This page below needs the latest remind from git to use the -u+ and -+ options.
--- CUT HERE
<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<?php
$months = @ $_GET['months'];
if ( $months == "" ) {
$months = 2;
}
# this < 1 sanitizes $months and prevents injection attacks
if ( $months < 1 ) {
$months = 1;
}
if ( $months > 18 ) {
$months = 18;
}
?>
<title>Calendar</title>
<meta http-equiv="REFRESH" content="3600">
<link rel="stylesheet" href="/rem-default.css" type="text/css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="max-width: none">
<h1>Public <?php print $months; ?>-Month Calendar</h1>
<form method="GET" action="remcal.php">
<p>
Select number of calendar months to display:
<select name="months" onchange="submit()">
<?php
for( $i=1; $i <= 18; $i++ ){
if ( $i == $months ) {
$sel = ' selected';
} else {
$sel = '';
}
print "<option value=\"$i\"$sel>".$i."</option>\n";
}
?>
</select>
</p>
</form>
<?php
# Use -q not to background-queue timed reminders.
# Use -b2 to turn off automatic showing of times on reminders.
# Use -u+idallen to set idallen environment vars and leave RUN ON
# Use -+idallen to trust idallen-owned .reminders file
system("remind -u+idallen -+idallen -q -b2 -p".$months." /home/idallen/.reminders-example \
| /home/idallen/bin/rem2html --imgbase='images' --tableonly ");
?>
</body>
</html>
--- END CUT
--
| Ian! D. Allen, BA, MMath - idallen at idallen.ca - Ottawa, Ontario, Canada
| Home: www.idallen.com Contact Improvisation Dance: www.contactimprov.ca
| Former college professor (Free/Libre GNU+Linux) at: teaching.idallen.com
| Improve democracy: www.fairvote.ca and Defend digital freedom: www.eff.org
More information about the Remind-fans
mailing list