This was reported in
RandomQuotePluginDev:
I think I've found some small bugs in the way the plugin reads the random quotes page. It seems to be leaving a "\n" following the %STARTINCLUDE%, resulting in a empty quote. Since the size of the quotes list is off, it also allows a quote for the table header to be displayed. These are both quickly seen if you have a quotes page with 1 entry.
-- SethTaplin - 30 Jul 2003
and
AurelioAHeckert provided a fix which was never incorporated into the code.
I make a little change that works:
in the line 312:
was:
# remove everything before %STARTINCLUDE% and after %STOPINCLUDE%
$topicText =~ s/.*?%STARTINCLUDE%//s;
now is:
# remove everything before %STARTINCLUDE% and after %STOPINCLUDE%
$topicText =~ s/.*?%STARTINCLUDE%\n[^\n]*\n//s;
and in the line 319:
was:
srand(time ^ 22/7);
my $quote = int (rand(@quotes)) + 1;
now is:
srand(time ^ 22/7);
my $quote = int (rand(@quotes));
Now the plugin gets only the quotes (whithout the frist table line) and do not exist the blank quote.
-- AurelioAHeckert - 04 Apr 2005
Apparently the line numbers mentioned by
AurelioAHeckert have since changed. I made the changes to my own copy of RandomQuotePlugin.pm as shown below:
% diff RandomQuotePlugin.pm RandomQuotePlugin.pmDIST
106c106
< $topicText =~ s/.*?%STARTINCLUDE%\n[^\n]*\n//s;
---
> $topicText =~ s/.*?%STARTINCLUDE%//s;
112c112
< my $quote = int (rand(@quotes));
---
> my $quote = int (rand(@quotes)) + 1;
--
TWiki:Main/VickiBrown - 2013-05-23