Scripsit Slain:
I need to add the above line in each of the html files, before the
text "<\head>". All the HTML files have this text
Oh, you mean </head>. Are you sure? Well, then you could write a Perl
few-liner to do the job, or ask someone to write it for you. You would still
need to learn how to run a Perl program _on the server_. The program could
be something like the following (untested):
undef $/;
while(<*.html>) {
$filename = $_;
open(FILE,"<$filename")
|| die "Can't open file \"$filename\":\n $!";
$stuff = <FILE>;
$stuff =~ s?</head>?<script language=JavaScript
src="./highlight.js"></script></head>?;
close(FILE);
open(FILE,">$filename")
|| die "Can't open file \"$filename\" for writing:\n $!";
print FILE $stuff;
close(FILE);
}
Of course, this isn't real about authoring in HTML. The c.i.w.a.tools group
would have been more suitable. And of course you might find an editor with a
built-in multi-file string replace feature that could be used for the job.
On similar lines, the text below goes towards the end.
Well, of course it would be similar, with similar solutions, though
detecting the end is non-trivial. But...
var mailDisplay = 'Click here to email this topic.';
document.write(
'<a href="mailto:Yo******@YourAddress.com'
+ '?subject=' + escape(mailSubject)
+ '&body=' + escape(mailBody)
+ '">' + mailDisplay + '</a>'
);</script></p>
This sounds like a _very_ clueless method of giving some users some poor way
of contacting you, instead of simply telling all users your email address.
So if you do something _so_ stupid, at least do it via some server-side
include feature, so that when you come to your senses, you won't have to fix
a zillion files again but can simply fix the included file.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/