Hey guys....First off, I love this links script... =)
Second off: Has anyone ever had trouble getting their SSI tags called in on the cgi generated pages? Like add.html, add_success.html and so on? SSI Don't work on those pages, unless of course you want to do a bunch of crazy stuff....and I'm no scripter, so I found a perfectly awesome solution!
I was running through some scripts on the perl archive, and noticed one called "The Includer"...and checked it out....its for people that don't have SSI, and want the functions of SSI on their website...and of course, I was like ....WOW...cause I use SSI, but when I change a banner on my website, it changes on all pages that i've created, and all links pages....except of course the cgi generated pages...
So, I would simply change the banner in my text file, and then have to manually change the banner in all the cgi generated pages....add.html, add_success, modify, modify_success, search, and so on...what a pain...
BUT!!!!!!
This is the beauty of it....say for instance you want to change your bottom banner....and you have the bottombanner.txt file, that your SSI calls to update "MOST" of your pages...instead of manually editing all the rest, or of course...search this forum for snippets of code, that your can change your links all around, and hopefully it will work....or you use this simple little script, that works wonders...
I didn't design it, I'm not an advertiser, but people...this is cool as heck!! It works great!!
So, you can add a simple code into your templates, and whalla! It calls it just like SSI! Here is what tag you use to call the script:
<script src="http://yourdomain.com/cgi-bin/includer.cgi?bottombanner.txt"></script>
and here is the actual script...
#!/usr/bin/perl
##########################################################################
## ##
## The Includer ##
## ------------ ##
## by Jimmy (wordx@hotmail.com) ##
## http://www.smartCGIs.com ##
## ##
## This is a free script, if anyone sold it to you please contact me. ##
## Please DO NOT remove any of the copyrights or links to our site, ##
## they keep this CGI free for everyone. Thanks! ##
## ##
## (c) copyright 2000 The Mp3eCom Network ##
##########################################################################
#
# Instructions:
# ============
# Grab the content of any file and display it using a Javascript tag in the following format:
#
# <script src="includer.cgi?test.txt"></script>
#
# with test.txt being the file you are grabbing.
# If it's in a different directory, include the full unix path.
$file = $ENV{'QUERY_STRING'};
print "Content-type: text/html\n\n";
if($file eq "") {
print "document.writeln('<center><font color=red>Includer Error: No File Specified.</font>
');\n";
print "document.writeln('<small>Script by <a href=\"http://www.smartcgis.com\" target=\"_blank\">SmartCGIs.com</a></small></center>');\n";
exit;
}
open(DATA,"$file") || print "document.writeln('<center><font color=red>Includer Error: Could not open $file ($!).</font>
<small>Script by <a href=\"http://www.smartcgis.com\" target=\"_blank\">SmartCGIs.com</a></small></center>');";
@filecontent = <DATA>;
close(DATA);
foreach $line(@filecontent) {
chomp($line);
$line =~ s/\'/\\\'/g;
print "document.writeln('$line');\n";
}
Its so simple, just put your text file for the SSI call into your www directory, and also into your cgi-bin directory, and there you have it....
AWESOME I MUST SAY!!!! AWESOME!!!!!
Sorry, I'm so excited cause of this script, it saves me so much time it ain't funny!!!
*AuTo|V|aT|C*
Second off: Has anyone ever had trouble getting their SSI tags called in on the cgi generated pages? Like add.html, add_success.html and so on? SSI Don't work on those pages, unless of course you want to do a bunch of crazy stuff....and I'm no scripter, so I found a perfectly awesome solution!
I was running through some scripts on the perl archive, and noticed one called "The Includer"...and checked it out....its for people that don't have SSI, and want the functions of SSI on their website...and of course, I was like ....WOW...cause I use SSI, but when I change a banner on my website, it changes on all pages that i've created, and all links pages....except of course the cgi generated pages...
So, I would simply change the banner in my text file, and then have to manually change the banner in all the cgi generated pages....add.html, add_success, modify, modify_success, search, and so on...what a pain...
BUT!!!!!!
This is the beauty of it....say for instance you want to change your bottom banner....and you have the bottombanner.txt file, that your SSI calls to update "MOST" of your pages...instead of manually editing all the rest, or of course...search this forum for snippets of code, that your can change your links all around, and hopefully it will work....or you use this simple little script, that works wonders...
I didn't design it, I'm not an advertiser, but people...this is cool as heck!! It works great!!
So, you can add a simple code into your templates, and whalla! It calls it just like SSI! Here is what tag you use to call the script:
<script src="http://yourdomain.com/cgi-bin/includer.cgi?bottombanner.txt"></script>
and here is the actual script...
#!/usr/bin/perl
##########################################################################
## ##
## The Includer ##
## ------------ ##
## by Jimmy (wordx@hotmail.com) ##
## http://www.smartCGIs.com ##
## ##
## This is a free script, if anyone sold it to you please contact me. ##
## Please DO NOT remove any of the copyrights or links to our site, ##
## they keep this CGI free for everyone. Thanks! ##
## ##
## (c) copyright 2000 The Mp3eCom Network ##
##########################################################################
#
# Instructions:
# ============
# Grab the content of any file and display it using a Javascript tag in the following format:
#
# <script src="includer.cgi?test.txt"></script>
#
# with test.txt being the file you are grabbing.
# If it's in a different directory, include the full unix path.
$file = $ENV{'QUERY_STRING'};
print "Content-type: text/html\n\n";
if($file eq "") {
print "document.writeln('<center><font color=red>Includer Error: No File Specified.</font>
');\n";
print "document.writeln('<small>Script by <a href=\"http://www.smartcgis.com\" target=\"_blank\">SmartCGIs.com</a></small></center>');\n";
exit;
}
open(DATA,"$file") || print "document.writeln('<center><font color=red>Includer Error: Could not open $file ($!).</font>
<small>Script by <a href=\"http://www.smartcgis.com\" target=\"_blank\">SmartCGIs.com</a></small></center>');";
@filecontent = <DATA>;
close(DATA);
foreach $line(@filecontent) {
chomp($line);
$line =~ s/\'/\\\'/g;
print "document.writeln('$line');\n";
}
Its so simple, just put your text file for the SSI call into your www directory, and also into your cgi-bin directory, and there you have it....
AWESOME I MUST SAY!!!! AWESOME!!!!!
Sorry, I'm so excited cause of this script, it saves me so much time it ain't funny!!!
*AuTo|V|aT|C*