Cool - it works i think
thats my random.cgi
Quote:
#!/usr/local/bin/perl
$display = 5;
open (FILE, "admin/data/keywords.txt");
@file = <FILE>;
close FILE;
$start = int rand $#file;
if ($start+$display > $#file) {
@queries = @file[$start .. $#file];
push (@queries, @file[0 .. $display-($#file-$start)-2]);
}
else { @queries = @file[$start .. $start+$display-1]; }
foreach (@queries) {
chomp; $output .= qq~"~ . (split(/\|/, $_))[0] . qq~",~;
}
chop $output;
print "Content-type: text/plain\n\n";
print $output;
And thats the JavaScript:
Quote:
<script language="JavaScript">
<!--
var text = new Array(<!--#exec cgi="cgi-bin/easy/random.cgi"--> )
var i = 0;
function scroll() {
if (text.length > -1) {
if (document.topsearch) {
document.topsearch.query.value = text[i++];
if (i == text.length) i = 0;
}
}
setTimeout ("scroll()", 7000);
}
// -->
</script>
But I can not implemet it on my templates - they are no shtml files !
What do I have to do to change all templates to shtml ?
Nikolai