[Remind-Fans] making your .reminders visible on a web site

Paul M. Foster paulf at quillandmouse.com
Tue Oct 5 21:43:29 EDT 2021


I didn't see the beginning of this thread. But I built a PHP application 
to display a calendar based on your reminders file. See 
https://gitlab.com/paulmfoster/calendar . You're welcome to download, 
use and make comments. Administration is done through editing your 
reminders file (in a terminal).

Paul

On 10/5/21 8:23 PM, Ian! D. Allen via Remind-fans wrote:
> 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
>


More information about the Remind-fans mailing list