|
From: <tra...@hu...> - 2001-06-13 03:55:57
|
So, can anyone provide any insight on this?
Thanks!
---------- Forwarded message ----------
Date: Sun, 10 Jun 2001 13:47:31 -0500 (EDT)
Subject: Fortune/MOTD Slash 2.0.0
From: tra...@hu...
Reply-to: tra...@hu...
To: sla...@li...
As everyone probably knows, Slash 2.0.0 just has "Bite my shiny metal ass!
-- Bender" hardcoded for the MOTD template. After seeing this and reading
the comments in that particular template, I'm assuming that for whatever
reason, the Fortune/MOTD function is not operational upon the initial install.
Question is, what is the proper way to get this function working?
I've messed around with setting it up as a Block as the comments hint at,
but can't figure out how to get that displayed in the index page when not
logged in as an Admin.
So, I tried setting it up as a variable (motd) and had Slashd update that
field in the 'vars' table with the following code:
sub newmotd {
return unless -x '/usr/games/fortune';
chomp(my $t = `/usr/games/fortune -s`);
$slashdb->setVar('motd', $t);
}
I've edited the footer templates to:
[% constants.motd %]
instead of
[% INCLUDE motd %]
since it should be getting the text from the var motd instead of the template.
The field in the 'vars' table gets updated just fine when Slashd runs the
code, but the index page doesn't get updated unless I stop and restart Slash
AND Apache.
Another question I suppose is is this a good way of doing it? Or is there
a better way?
Any words of wisdom will be appreciated.
Thanks.
Free, encrypted, secure Web-based email at www.hushmail.com |