Gossamer Forum
Home : Products : Gossamer Links : Development, Plugins and Globals :

using SSI within a dynamic directory..

(Page 1 of 2)
> >
Quote Reply
using SSI within a dynamic directory..
Hi

I am using SSi to present the latest forum on my search pages..

the problem whenever the page is a dynamic page (search results, add, modify...) the ssi contents will not show up..

I know that this is how SSI works but is there a way around so the SSI tag will work on dynamic pages too?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
You could create a global like the following:

sub {
my $forum = `/foo/root/youraccount/cgi-bin/forumscript.cgi`;
return $forum;

}

You could call the global something like RecentForumPosts.

Then use <%RecentForumPosts%> throughout your template pages.

-OR-

You could use the following:

<script src="/cgi-bin/forumscript.cgi">

Of course with this option, you'd have to remove the HEADERS (Content/Type) in your .cgi script, or create a new sub in that script that doesn't print HEADERS and add an URL parameter in the script like "nonssi=1". Then you can change the above codes to:

<script src="/cgi-bin/forumscript.cgi?nonssi=1">

-OR-

Create a global that queries your forum database rather than using a separate CGI script via SSI.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
Thanks Stealth..

i will try all 4 options and let you know which one works..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
All of the options should work (have them working in my site with a banner script). The only thing you have to really test is what option is the easiest for you to set-up and maintain.

Keep in mind that the SCRIPT SRC method will only work in javascript enabled browsers.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
Hi

I am trying to use :

<!--#include virtual="/cgi-bin/forum/gforum.cgi?do=search_results&search_forum=all&search_string=&search_type=AND&search_fields=sb&search_time=1m&search_user_username=&mh=5&t=ssi"-->

which works on static not dynamic pages only..

With your suggestion a global to return it will be:

sub {

my $forum = `/pathto/cgi-bin/forum/gforum.cgi?do=search_results&search_forum=all&search_string=&search_type=AND&search_fields=sb&search_time=1m&search_user_username=&mh=5&t=ssi`; return $forum;

}

But that is returning a blank page...What Am I doing wrong here please..?
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
First of all, the SSI directives, like "include virtual" (although you should be using "exec cgi"), do not work in CGI scripts.

For the sub option that I provided, you will need to take out an CONTENT\TYPE header type of codes in that "ssi" sub that you have in your forum script.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
Great..

thanks
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
>>
First of all, the SSI directives, like "include virtual" (although you should be using "exec cgi"), do not work in CGI scripts.
<<

Well just a point to note, he _shouldn't_ have been using exec cgi. When using a query string exec cgi will not work, what he had was fine.
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
I disagree, Paul. He is still "executing" a CGI script, thus the exec cgi is the directive to use in this case.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
Eliot trust me, include virtual is correct.
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
Trust you? That's a big laugh. Show me some proof...and I might reconsider my previous statement. But I stand by what I've already posted.
========================================
Buh Bye!

Cheers,
Me
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
Hi

I have been using include for a long long time.. and it works just fine..

Thanks for the advice though!
See my home page the Last posts on the left..

the news on the bottom are all SSi using include and all from CGi script..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory

Last edited by:

katabd: Jul 31, 2002, 12:31 PM
Quote Reply
Re: [Stealth] using SSI within a dynamic directory.. In reply to
>>
Trust you? That's a big laugh.
<<

Hehe no, what's funny is the fact that you are wrong but can't see it :)

>>
Show me some proof...
<<

http://gossamer-threads.com/...forum.cgi?post=63140

Last edited by:

Paul: Jul 31, 2002, 1:19 PM
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
Did you fix your problem above or are you still working on it?
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
Can we get back to the topic?

What I would like to know is the following: I can execute a cgi script from the shell, and pass arguments as follows
Code:
$ /path/to/script.cgi foo=bar key=value
How do I do this from within a global in Links SQL?
Code:
sub { `/path/to/script.cgi foo=bar key=value`; }
does not work, and neither does
Code:
sub { `/path/to/script.cgi?foo=bar;key=value`; }
Any ideas?

Ivan
-----
Iyengar Yoga Resources / GT Plugins
Quote Reply
Re: [yogi] using SSI within a dynamic directory.. In reply to
>>
Can we get back to the topic?
<<

>>
Did you fix your problem above or are you still working on it?
<<

Im trying :)

I've tried everything I can think of but can't get the query string to pass...I'm sure there must be a way.
Quote Reply
Re: [yogi] using SSI within a dynamic directory.. In reply to
I found this but can't seem to get it to work...

Code:
$ENV{'REQUEST_METHOD'} = "POST";
$ENV{'CONTENT_LENGTH'} = length($cgi_input);
$ENV{'CONTENT_TYPE'} = "application/x-www-form-urlencoded";

open(PIPE, "| test.cgi");
print PIPE $cgi_input;
close(PIPE);

There was a GET version too which didn't work either...maybe it was my script though :(

Last edited by:

Paul: Jul 31, 2002, 1:52 PM
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
Hi Paul

Searched all over google...

and could not find a way to get the SSi to show within a dyanamic page generated through CGI..Mad

May be some of GT staff will have some input.. I know some web sites I came across have this working but could not figure out how..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
>>
and could not find a way to get the SSi to show within a dyanamic page generated through CGI..
<<

Its not possible, SSI cannot be used in any html passed through a cgi script. You need to find alternate methods such as a system command....eg....

<!--#exec cgi="script.cgi"-->

Is the same as:

sub {
return qx/script.cgi/;
}
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
Thanks Paul

I have tried several globals and none seems to work...

I will keep trying... and i will post the global here if i get something to work..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
Essentially the solution is easy but the query string is the problem. I've not found anything that works yet...I bet Alex will put us out of our misery ;)
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
Hi Paul

If we can find such a solution we can integrate Gforum and Links SQl templetes (ffoter, Header, banners, ...) so sharing contents and updating sites will become extremly easy....

I have tried two more options and no luck..
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [katabd] using SSI within a dynamic directory.. In reply to
Can you just clarify what url/script you want to include into links sql?
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
<!--#include virtual="/cgi-bin/forum/gforum.cgi?do=search_results&search_forum=all&search_string=&search_type=AND&search_fields=sb&search_time=1m&search_user_username=&mh=5&t=ssi"-->
Regards
KaTaBd

Users plug In - Multi Search And Remote Search plug in - WebRing plug in - Muslims Directory
Quote Reply
Re: [Paul] using SSI within a dynamic directory.. In reply to
I did some testing.

The following script prints the GForum signup page:
Code:
#!/usr/bin/perl
my $ref = sub { print `/path/to/gforum.cgi do=user_signup`; };
&$ref;
But, the same thing in a global prints the GForum main page:
Code:
sub { print `/path/to/gforum.cgi do=user_signup`; }
So it seems to be something related to the way the coderefs are handled by the template parser....

Ivan
-----
Iyengar Yoga Resources / GT Plugins
> >