Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

hidden_query

Quote Reply
hidden_query
What is this hidden_query I see everwere? I wondering if this is really needed for things like:

forum.pl?do=logout;<%hidden_query%>

Why is this tag here at the logout?

--------------------------------
Privacy Software
Quote Reply
Re: [BLOOD] hidden_query In reply to
<%hidden_query%> contains things that should get passed through all URL's. Two examples would be:

1. Your session id if you are not using cookies.
2. Your template set name if you are using a custom template set.

It should be included in all links.

Cheers,

Alex
--
Gossamer Threads Inc.
Quote Reply
Re: [Alex] hidden_query In reply to
In the forum there are several variables I would like to have passed through all URLs, and using "hidden_query" may be a good solution.

How do I add variables to "hidden_query"?

My session id already uses it because I don't use cookies.
Quote Reply
Re: [tora] hidden_query In reply to
There isn't an option like with glinks to add things to hidden_query, so it looks like you'll have to change the code to do this. If you open up GForum.pm, around line 388 (in sub request), there's a list of parameters that it preserves - just add your own ones to the list.

Adrian
Quote Reply
Re: [brewt] hidden_query In reply to
Did you mean sub_hidden? I don't find a sub_request in GForum.pm.
Here's what is probably the relevant code.

I want the variable called "fp" to be carried in the url along with the session id. fp should default to 6.
How do you insert that into this code?

Code:
my $needed = shift || "query";
my (@return, $return);
if ($needed eq 'query') {
for my $key (keys %HIDDEN) {
if (ref $HIDDEN{$key} eq 'ARRAY') {
for (@{$HIDDEN{$key}}) {
push @return, $IN->escape($key) . "=" . $IN->escape($_);
}
}
else {
push @return, $IN->escape($key) . "=" . $IN->escape($HIDDEN{$key});
}
}
$return = join "&", @return;
Quote Reply
Re: [tora] hidden_query In reply to
Oops, I was looking at gforum 2 code. Yes, you could also put it in there. Something like:
Code:
my $needed = shift || "query";
my (@return, $return);

$HIDDEN{fp} = $IN->param('fp') || 6;

...

Adrian
Quote Reply
Re: [brewt] hidden_query In reply to
  
Great, thanks.
So... after whatever about my fp variable, I then keep the rest of the code?

Then my fp variable is saved through the last line (below) - is that correct?
Code:
$return = join "&", @return;

(P.S. Our 9-hour time difference makes instant testing a bit of a challenge - maybe you're used to it!)

Thanks so much for your help!!!
Quote Reply
Re: [brewt] hidden_query In reply to
GForum2 is not out yet, is it?
(This is a parentheses, not meant to distract from my real reply, above.)
Thanks.

Last edited by:

tora: Oct 16, 2007, 3:02 PM
Quote Reply
Re: [brewt] hidden_query In reply to
This part works perfectly - thanks!

However, I cannot extract the fp part out.

Irrespective of which it is,

fp=7&guest=165221 or
fp=7;guest=165221

I cannot turn "fp" into a variable which I can change in the templates.

If I make a global "fp"
it gives me something starting with the word "SCALAR".
I tried to take a substring, to pick up the value of fp. "7" is the fourth character in the string, but it gives me "L" which is the fourth character in the word "SCALAR".

Code:
sub {
my $vars = shift;
if ($vars->{hidden_query}) {
my $fp = substr(($vars->{hidden_query}),3,1);
};
}



Quote Reply
Re: [tora] hidden_query In reply to
Quote:
Then my fp variable is saved through the last line (below) - is that correct?
Yes

Quote:
GForum2 is not out yet, is it?
Nope, not yet.

Adrian
Quote Reply
Re: [tora] hidden_query In reply to
hidden_query is probably a scalar reference. You need to dereference it first.

Anyways, you probably want to do:

Code:
my $fp = $IN->param('fp');

instead.

Adrian
Quote Reply
Re: [brewt] hidden_query In reply to
Works very well!!
Thanks SmileSmile