Forum Moderators: coopster & phranque

Message Too Old, No Replies

Help, how do I do it?

Changing wwwboard script to add ads to posts

         

AnglerEd

8:23 am on Feb 17, 2002 (gmt 0)

10+ Year Member



I am using the bulletin board script from Matt's Script Archive.
I would like to edit the script to add advertisements to each post.
Thanks

sugarkane

10:15 am on Feb 18, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld Angler Ed

Your question is pretty specialised - it's not something I've ever done but hopefully I can offer a starting point.

From a quick look at the source of wwwboard.pl, it looks as if you could modify the following lines to insert some HTML of your own that called up a banner rotation script (or whatever advertising solution you're using):

[perl]
#####################
# New File Subroutine

sub new_file {

open(NEWFILE,">$basedir/$mesgdir/$num\.$ext") ¦¦ die $!;
print NEWFILE "<html>\n";
print NEWFILE " <head>\n";
print NEWFILE " <title>$subject</title>\n";
print NEWFILE " </head>\n";
print NEWFILE " <body>\n";
# etc
[/perl]

Just find an appropriate place in the HTML that's being printed out, and insert:

[perl]
print NEWFILE "<your own HTML here>\n";
[/perl]

Hope this helps, let us know how you get on!

AnglerEd

4:17 am on Feb 19, 2002 (gmt 0)

10+ Year Member



Well, that didn't work either.
I just get an internal error message.
Your suggestion seems to make sense but we must be missing something.
Itried adding it to the exisiting New Subroutine as well as adding a new one.