Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

SSI for USER personlization..

Quote Reply
SSI for USER personlization..
ok.. well.. i'm not planning on use page.cgi for all of my pages (only plan to use it for dynamic categories and detailed pages) so i just made a simple script to use for the users.. it uses the cookies to get the username and all the info..

http://www.pdamania.com/ssi.txt

you'll need to to add this to HTML_Templates.pm:

Code:
sub site_html_home_ssi {
# --------------------------------------------------------
# MOD: Displays USER Information via SSI.
#
my ($user) = @_;
(ref $user eq 'HASH') or croak "HTML_TEMPLATES: Argument '$user' must be hash reference";

print &load_template ('home_ssi.html', {
%$user,
%GLOBALS
}, undef, undef);
}

as well as &site_html_home_ssi to @EXPORT..

then you need to make home_ssi.html. something like this

Code:
<%if Username%>
Hi <%Username%>!
<%endif%>
<%ifnot Username%>
Welcome to our site!
<%endif%>

it also works with the category editor thingy.. you just need to make another copy and change the subroutine (yea.. that's a reason why it sucks Smile).. and then do the similiar for html_templates.pm and then make a different template.. with if isEditor

in the category one.. if you need the category ID.. just add $category_id to the subroutine call.. and add $category_id to the sub in html_templates.pm as well..

the most effective way to use this is adding DYNAMIC => $dynamic, to all of the template loading variables thingy.. and then in the template use

Code:
<%if DYNAMIC%>
<%if Username%>
Hi <%Username%>!
<%endif%>
<%ifnot Username%>
Welcome to our site!
<%endif%>
<%endif%>
<%ifnot DYNAMIC%>
<!--#exec cgi="/ssi.cgi"-->
<%endif%>

sorry.. too lazy for more detailed instructions Smile

jerry
Quote Reply
Re: SSI for USER personlization.. In reply to
But this requires you to be serving dynamic pages, with SSI, right?
Quote Reply
Re: SSI for USER personlization.. In reply to
no...

the other thing people could do which i just thought of is use SSI on an index.html page to page.cgi Smile

all this does is get the user information.. (which is currently only availible using page.cgi)..

btw.. look at the post Links SQL 1.1b3.. you might want to fix your cookies first before you use this

jerry
Quote Reply
Re: SSI for USER personlization.. In reply to
I tried to acess pdamania.com/ssi.txt and I got a 404 error.
Widgetz, or anyone else that have it, can you post it again for me here?
thanks