So I noticed in the config.pl file, you can have rotating title images (title image = banner?). But all it says is to point TITLEIMG to a script. And I couldn't find anywhere anything about what said script should do. A friend thought that it's supposed to return the filename of the image, so I decided to set out to write a script to do so.
Then the problem is I don't know any Perl. So I had another friend who knows some Perl to help me out. Together we came up with the following:
#!/usr/bin/perl -w
sub getRandImage {
srand;
my $randomnumber = int(rand(6));
my $filename;
if ($randomnumber == 0){
$filename = 'banner1.gif';
}
if ($randomnumber == 1){
$filename = 'banner2.gif';
}
if ($randomnumber == 2){
$filename = 'banner3.gif';
}
if ($randomnumber == 3){
$filename = 'banner4.gif';
}
if ($randomnumber == 4){
$filename = 'banner5.gif';
}
if ($randomnumber == 5){
$filename = 'banner6.gif';
}
return $filename;
}
1;
And in config.pl, I have:
require 'banner.pl';
use constant TITLEIMG => getRandImage;
And, lo and behold, it doesn't work (as might be expected?). Can anyone tell me what's wrong and what I should have done instead?
Thanks in advance.
Oh, by the way, this is in Wakaba. I don't know if Kareha has the same option, but I don't want to confuse you.
There's a thread somewhere over on 4-ch discussing this... Here we go: http://4-ch.net/tech/kareha.pl/1102969545/
I recommend http://4-ch.net/tech/kareha.pl/1102969545/6, of course.
>posting a reply to a thread from 2005
>on an dead imageboard