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

user's favourite category

Quote Reply
user's favourite category
I created a new field called user_lastcategory, which contains the number of the last category the user viewed the last time he/she was online.

How do I send the user to that category when he/she logs in?

I looked at the login part of user.pm but the various combinations I tried did not work. The original code is below - is this what has to be changed, and if so, how? Thank you very much for your help.

$COMPILE{login} = __LINE__ . <<'END_OF_SUB';

sub login {

shift; # Discard the package

my ($do, $func) = splice @_, 0, 2;

my $tags = ref $_[0] eq 'HASH' ? shift : {};

my $url = $CFG->{cgi_root_url} . "/" . $IN->url();

$url =~ s/(?:[;&]?(?:login_(?:username|password|attempt)|url|session|guest)=[^&;]*|\b(?:login_(?:username|password|attempt)|url|session|guest)=[^&]*)//g;

$url =~ s/\bdo=log(?:in|out)\b//g;

$url =~ s/\?/?login_attempt=1&/ or $url .= "?login_attempt=1";

$tags->{url} = $url;

delete @GForum::HIDDEN{qw/guest login_username login_password session/};

return(

$CFG->{functions}->{login}->{page}->{login},

$tags

);

}

END_OF_SUB
Quote Reply
Re: [tora] user's favourite category In reply to
What about;

print "Location: xxxx \n\n";

Cheers

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] user's favourite category In reply to
Thanks, but that does not help.

There has to be a change to the url the user goes to after logging in. Now all users go to the main category listing. I want my users to be able to go to their favourite category automatically.