Now I have seen a few solutions in other posts that don't appear to work because my web host only supports the "exec cgi" command for SSI calls.
Any ideas are welcome.
Thanks,Jason
If you can't use the other SSI calls, you could display the SSI template in a iframe on your page.
Dan O.
------------------
code:# Get input Data# --------------sub getInput { my ($in,@in,$key,$val); my (@keys,%formvars); if ($ENV{'DOCUMENT_URI'}) { open(SSI,$BASE_DIR."ssi.txt"); while(<SSI> ) { chomp; ($key,$val) = ( /^\s*([^=]+)\s*=\s*"?(.*?)"?$/o ); $key =~ s|\s*$| |; $val =~ s|\s*$| |; next unless ($key); $in{$key} = $val; } close(SSI); $no_session = 1; } elsif ($ENV{'REQUEST_METHOD'}) { if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } @in = split(/&/,$in); # First get all the raw form vars foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; # Keep a record of their order, because later values take precendent push(@keys,$key); $formvars{$key} = $val; } # Process the special QUERY_STRING field, if it exists # These values come first and then might be over-written if ($formvars{'QUERY_STRING'}) { @in = split(/&/,$formvars{'QUERY_STRING'}); foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); if ($val ne "") { $in{$key} = $val; if ($in{'datestring'} && (($key eq 'year') | | ($key eq 'month') | | ($key eq 'date'))) { delete $in{'datestring'}; } if ($key eq "datestring") { delete $in{'year'}; delete $in{'month'}; delete $in{'date'}; } } } delete $formvars{'QUERY_STRING'}; } # Process all the new field values, over-writing the old ones foreach $key (@keys) { next if ($key eq "QUERY_STRING"); $in{$key} = $formvars{$key}; if ($in{'datestring'} && (($key eq 'year') | | ($key eq 'month') | | ($key eq 'date'))) { delete $in{'datestring'}; } if ($key eq "datestring") { delete $in{'year'}; delete $in{'month'}; delete $in{'date'}; } } # Form the query string from form input foreach $key (keys %in) { if (($key eq "command") | | ($key eq "username") | | ($key eq "password") | | ($key =~/^FIELD_/)) { delete $formvars{$key}; next; } if ($QUERY_STRING ne "") { $QUERY_STRING .= "&"; } $QUERY_STRING .= &URLEncode($key) . "=" . &URLEncode($in{$key}); } $FORM_QUERY = join('&', map {"$_=$formvars{$_}"} keys %formvars); } elsif ($#ARGV >= 0) { while ($in = shift(@ARGV)) { ($key,$val) = split(/=/,$in); $in{$key} = $val; } $no_session = 1; $no_header=1; } }################################## Here is all the dirty work... ##################################
# Get input Data# --------------sub getInput { my ($in,@in,$key,$val); my (@keys,%formvars); if ($ENV{'DOCUMENT_URI'}) { open(SSI,$BASE_DIR."ssi.txt"); while(<SSI> ) { chomp; ($key,$val) = ( /^\s*([^=]+)\s*=\s*"?(.*?)"?$/o ); $key =~ s|\s*$| |; $val =~ s|\s*$| |; next unless ($key); $in{$key} = $val; } close(SSI); $no_session = 1; } elsif ($ENV{'REQUEST_METHOD'}) { if ($ENV{'REQUEST_METHOD'} eq "GET") { $in = $ENV{'QUERY_STRING'}; } elsif ($ENV{'REQUEST_METHOD'} eq "POST") { read(STDIN,$in,$ENV{'CONTENT_LENGTH'}); } @in = split(/&/,$in); # First get all the raw form vars foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); $key =~ s/%(..)/pack("c",hex($1))/ge; $val =~ s/%(..)/pack("c",hex($1))/ge; # Keep a record of their order, because later values take precendent push(@keys,$key); $formvars{$key} = $val; } # Process the special QUERY_STRING field, if it exists # These values come first and then might be over-written if ($formvars{'QUERY_STRING'}) { @in = split(/&/,$formvars{'QUERY_STRING'}); foreach $i (0 .. $#in) { $in[$i] =~ s/\+/ /g; ($key, $val) = split(/=/,$in[$i],2); if ($val ne "") { $in{$key} = $val; if ($in{'datestring'} && (($key eq 'year') | | ($key eq 'month') | | ($key eq 'date'))) { delete $in{'datestring'}; } if ($key eq "datestring") { delete $in{'year'}; delete $in{'month'}; delete $in{'date'}; } } } delete $formvars{'QUERY_STRING'}; } # Process all the new field values, over-writing the old ones foreach $key (@keys) { next if ($key eq "QUERY_STRING"); $in{$key} = $formvars{$key}; if ($in{'datestring'} && (($key eq 'year') | | ($key eq 'month') | | ($key eq 'date'))) { delete $in{'datestring'}; } if ($key eq "datestring") { delete $in{'year'}; delete $in{'month'}; delete $in{'date'}; } } # Form the query string from form input foreach $key (keys %in) { if (($key eq "command") | | ($key eq "username") | | ($key eq "password") | | ($key =~/^FIELD_/)) { delete $formvars{$key}; next; } if ($QUERY_STRING ne "") { $QUERY_STRING .= "&"; } $QUERY_STRING .= &URLEncode($key) . "=" . &URLEncode($in{$key}); } $FORM_QUERY = join('&', map {"$_=$formvars{$_}"} keys %formvars); } elsif ($#ARGV >= 0) { while ($in = shift(@ARGV)) { ($key,$val) = split(/=/,$in); $in{$key} = $val; } $no_session = 1; $no_header=1; } }################################## Here is all the dirty work... ##################################
################################## Here is all the dirty work... ##################################
[This message has been edited by Jason S (edited August 27, 2003).]
I'm having the same problem. I tried your code, but it didn't work -- actually nothing came up in the SSI call and when I tried the calendar, I got an Internal Server Error.
I copied the code directly from your posting and it looked OK on the page -- I don't think I missed any brackets, semicolors, etc.
Any suggestions?
Thanks,
John
If the script isn't running, the SSI template won't work either.
** I copied the code directly from your posting **
This forum software adds spaces between double bars (| |) which shouldn't be there. At the very least it effects the following lines of the code posted previously, probably more lines as well.
$key =~ s|\s*$| |;$val =~ s|\s*$| |;
Jason
Thanks for the help.
Ethan
This second copy has been changed to call the correct template so it will not display the whole month as it does for you and should do when opening the calendar normally.
Search for "template=" in the calendar2.cgi file and change the template to what you want ( we use ssi_max_events ).
You can see our example on www.coliseumbooks.com.
[This message has been edited by shancock (edited November 08, 2003).]