** Can the Admin be set up to view a different template to the anonymous user. **
Not to my knowledge. You can however exclude/include different parts of the template code depending on different conditions like for example if the Administrator is the current user or just if the user is actually logged in or not (among a plethora of other possibilities).
** If I remove all the if else clauses **
I did say "Alternately you could conditionally exclude most of the if/elsif blocks", the key phase being conditionally.
If you changed the first if statement:
if ($VIEW eq "Month") { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); }
to:
if ($User->{username} eq "anonymous") { # meaning not logged in
$db = $main:
BEvents;
# Keep form values to populate form fields
foreach (keys %in) {$name = $_; if ($name =~ s/^FIELD_//) { $search_params->{$name} = $in{$_}; } }
$VIEW = "Search";
}
elsif ($VIEW eq "Month") { &getEvents( { 'range'=>'month' , 'month'=>$MONTH } ); }
It would do the search thing for anyone not logged in.
Dan O.
------------------
BTW. the code
$main:
BEvents;
should be
$main : : D B E v e n t s ;
without any spaces between the characters.
------------------
[This message has been edited by DanO (edited December 06, 2003).]