Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Static Version : how to switch content for .html and .cgi pages

Quote Reply
Static Version : how to switch content for .html and .cgi pages
Is there a way to differentiate pages based on extension within static ouput like:

1. pages ending with .cgi (user.cgi, page.cgi, search.cgi.. etc)
2. pages ending with .php (.php is build extension)

I am wanting to use include function, however can't really use same include function on both .php and cgi pages. So if there is some option where I can use conditions like:

if cgipages
...use content one
elsif
... use content two

Thanks.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static Version : how to switch content for .html and .cgi pages In reply to
Hi,

Ironically, I was thinking of doing something like this today (for my advert plugin) - However, I couldn't really find a way to do it :( I thought maybe doing a check on a $ENV variable would do it - but for the dynamically built pages, it gives the wrong $ENV value (as its still being run via a script - nph-build.cgi, therefore it always returns true :()

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static Version : how to switch content for .html and .cgi pages In reply to
Right now the only solution I can think of is to:

1. Create two include file for each required function and use them separate file within .cgi and static build pages.

However for Software Devil, I am having about 150 template pages and having double file for each such feature increase chances of making an error.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static Version : how to switch content for .html and .cgi pages In reply to
There may well be a way of doing it - something like <%if is_script%> or something - but nothing came to me when trying to do this earler. Maybe GT have a suggestion.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static Version : how to switch content for .html and .cgi pages In reply to
There is no real way to use <%if is_script%> or other conditions on static pages.

The option that could be helpful is using ssi or php include (still trying to figure out on how though..), however I am still out of idea on how to make it work. (Right now I am able to use .html, .shtml & .php tags on static pages), however it might not be viable solution for your Advert plugin, as not everyone will be playing with their .htaccess file this much.

Vishal
-------------------------------------------------------
Quote Reply
Re: [SWDevil.Com] Static Version : how to switch content for .html and .cgi pages In reply to
Hi,

For my Advert plugin, I've actually just completed anothe version, which uses an IFRAME - so doesn't require mod_rewrite :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static Version : how to switch content for .html and .cgi pages In reply to
I know this cool guy Andy:

http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=248755

Last edited by:

Payooo: Sep 30, 2009, 6:07 AM
Quote Reply
Re: [Payooo] Static Version : how to switch content for .html and .cgi pages In reply to
hahah - already worked a way around it using a global :) Not as simple as doing <%if d%> (thats only when actually running via page.cgi, and having the whole site run dynamically)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Static Version : how to switch content for .html and .cgi pages In reply to
I was finally able to find a way around to get the function included, by using combination of ssi and pagi.cgi

Now back to code editor to fix IE issues.

Vishal
-------------------------------------------------------