[sf-lug] fixed: Re: https://www.sf-lug.org/ September 01st

Michael Paoli Michael.Paoli at cal.berkeley.edu
Wed Aug 28 12:15:24 PDT 2019


Thanks, fixed.

references/excerpts:
$ diff -U 0 .index.php.BAK index.php
--- .index.php.BAK      2019-05-23 04:34:21.567189468 +0000
+++ index.php   2019-08-28 19:08:19.955357114 +0000
@@ -20 +20 @@
-echo "The next meeting is on <b>" . date('l F dS', $meeting);
+echo "The next meeting is on <b>" . date('l F jS', $meeting);
$ curl -s http://www.sf-lug.org/ | sed -ne 's/^.*\(The next  
meeting.*Cafe Ench.*[^.]*\.\).*$/\1/p'
The next meeting is on <b>Sunday September 1st, from 11:00 AM till  
1:00 PM</b>, at the Cafe Enchante, on Geary at 26th Ave in San  
Francisco.
$

> From: "Akkana Peck" <akkana at shallowsky.com>
> Subject: Re: [sf-lug] https://www.sf-lug.org/ September 01st
> Date: Wed, 28 Aug 2019 08:42:27 -0600

> I'm only an occasional PHP programmer, but googling PHP date found this:
> https://www.php.net/manual/en/function.date.php
> The first argument to date() is a format string.
>
> In the code you quoted:
> echo "The next meeting is on <b>" . date('l F dS', $meeting);
>
> So it's calling date with 'l F dS' as a format string. Scrolling
> down to where it documents the format strings:
>
> l (lowercase 'L')  A full textual representation of the day of the week
> F  A full textual representation of a month, such as January or March
> d  Day of the month, 2 digits with leading zeros
> S  English ordinal suffix for the day of the month, 2 characters
>
> Note those leading zeros on the description of d. Two lines below it,
> they list:
> j  Day of the month without leading zeros
>
> So try changing the format string to 'l F jS' and see if that helps.
>
> PHP, whatever its other faults may be, does have pretty good online
> documentation.
>
>         ...Akkana
>
> Michael Paoli writes:
>> https://www.sf-lug.org/ September 01st
>> So, ... maybe someone wants to fix that PHP code?  Or
>> suggest exactly what needs to be changed in it?
>> (I am not a PHP programmer).
>>
>> Or better yet, as Jim suggested long ago, don't use PHP, but
>> have a crontab job update static page.
>>
>> I think there's 'bout half a dozen folks (... yes, 5) with
>> sufficient login+sudo access to be able to implement
>> either of those solutions.
>> Y'all don't need to have me do *everything*.  ;-}
>>
>> references/excerpts:
>> $ sed -ne '/next meeting/,/Cafe Enchante/p'  
>> /var/www/www.sf-lug.org/index.php
>> echo "The next meeting is on <b>" . date('l F dS', $meeting);
>> if (date('l', $meeting) == "Sunday") {
>>         $mtg_time = "11:00 AM till 1:00 PM";
>>
>>         } else {
>>         $mtg_time = "6:00 PM till 8:00 PM";
>>
>> }
>>
>> echo ", from $mtg_time</b>, at the Cafe Enchante, on Geary at 26th Ave in
>> San Francisco.";
>> $
>> $ hostname --fqdn; sudo sh -c '(cd /etc/sudoers.d/ && for u in [!Rl]*; do
>> sudo -l -U "$u" | sed -ne '\''/^User .* may run/,${/^User
>> /{p;n};/chsh/d;/sflugwww/p;/ ALL$/p}'\'' ; done)'
>> balug-sf-lug-v2.balug.org
>> User grantbow may run the following commands on balug-sf-lug-v2:
>>     (root) /bin/su - sflugwww
>> User jstockford may run the following commands on balug-sf-lug-v2:
>>     (root) /bin/su - sflugwww
>> User kdavalos may run the following commands on balug-sf-lug-v2:
>>     (root) /bin/su - sflugwww
>> User mpaoli may run the following commands on balug-sf-lug-v2:
>>     (ALL) NOPASSWD: ALL
>> User thawley may run the following commands on balug-sf-lug-v2:
>>     (root) /bin/su - sflugwww
>> $




More information about the sf-lug mailing list