Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#25 2011-03-03 22:04:31

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_gps – Extract GET & POST variables

Hi John,

I don’t think a plus sign is allowed in a URL A plus sign is coded as a space – you’d have to it feed through as ‘%2b’ if you want it to stay a plus. For example:

?mail=john%2b2011-03-03_16-40-47@my.tld

In PHP, urlencode() might be useful for you.

Last edited by gomedia (2011-03-03 22:17:57)

Offline

#26 2011-03-04 03:18:32

johnstephens
Plugin Author
From: Woodbridge, VA
Registered: 2008-06-01
Posts: 999
Website

Re: adi_gps – Extract GET & POST variables

That completely solved my issue. Thanks, Adi!

Offline

#27 2012-01-30 06:23:22

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_gps – Extract GET & POST variables

Version 0.2 is now available. Thanks to Gocom for his recommendations.

Changes:

  • improved security
    • ‘txpvar’ & ‘global’ attributes removed (see below)
    • ‘list’ & ‘debug’ attributes removed – debug information now in tag trace (when Production Status = debugging)
    • HTML characters now escaped by default
  • ‘name’ attribute now accepts comma separated list of vars

Upgrade:

In principle, you should only need to install the new version of the plugin. However, there are a couple of considerations:

1) The ‘global’ attribute is no longer available, so if you’re using it for example:

<txp:adi_gps global="1" />
<txp:php>
	global $myvar;
	...
</txp:php>

Then this will achieve the same result:

<txp:adi_gps />
<txp:php>
	global $variable;
	$myvar = $variable['myvar'];
	...
</txp:php>

2) I’m not sure how much use the ‘txpvar’ attribute is now, so it’s been taken out. Let me know if I’m being a bit too presumptuous.

3) The ‘post’ attribute is deprecated, as POST vars are now extracted automatically by default. If you’re using it then it’ll be ignored (i.e. you won’t get an error) but the functionality should still be effectively the same. If you only want to extract POST vars then you can use the new type="post" attribute.

Offline

#28 2012-06-06 21:44:19

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: adi_gps – Extract GET & POST variables

Hi Adi, I used adi_gps here to send variables from thumbnail page to image display page. I then used adi_calc to help me navigate among the images. I had to use smd_lately to make a link back to the thumbs page from anywhere within the image navigation. As I see it, (and you know I find coding difficult so I might be completely off) if @adi_gps could store a variable semi-permanently it would help a lot.

To explain: if I send variable page_url from thumbs page section to photos page section and adi_gps would then store that variable until the next time a page_url variable arrives from outside the photos section, this semi-permanent variable would then be very useful. So if adi_gps had an option to “keep variable until…” that would be perfect for this sort of situation. Is this feasible, possible, and not causing you too much work? I’m happy with the way of displaying images, thanks to adi_gps and adi_calc but if there was a way to remove the reliance on smd_lately which itself relies on Visitor Logs being set to fully on, that would be even better.


BB6 Band My band
Gud One My blog

Offline

#29 2012-06-06 22:16:55

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,578
Website

Re: adi_gps – Extract GET & POST variables

Peter, from your description, it sounds like you’re trying to store the page you came from (or category you were last browsing). In that case cookies might be what you are after. They persist beyond pages until you reset or expire them.

The GET and POST variables that the gps plugins use exist only for as long the page exists. To keep them you have to pass them on to the next page. Same goes for txp:variable.

If you want to go back to exactly the last page, you could trigger the browser’s back button with javascript, or use something like:

<txp:php> header("Location: " . $_SERVER['HTTP_REFERER']);</txp:php>

See here for more, or google around.

Last edited by jakob (2012-06-06 22:17:06)


TXP Builders – finely-crafted code, design and txp

Offline

#30 2012-06-06 22:17:19

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: adi_gps – Extract GET & POST variables

You could either store the variable you want to keep in a cookie or put it back in the url of links to pages you need it on.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#31 2012-06-07 01:35:36

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_gps – Extract GET & POST variables

zero wrote:

… if @adi_gps could store a variable semi-permanently it would help a lot.

Hi Peter. jakob & MattD are right in what they suggest (thanks guys). Either use a cookie (which may now have a pain-in-the-arse knock-on effect with the new EU legislation) or store the pertinent information of where to go back to in the URL. You can make up the URL & vars manually or perhaps adi_link may be of assistance.

It would be technically feasible to store data from URLs but it would have to be made session specific & then I’d effectively be reinventing cookies – and being British, I’d call them biscuits …

Offline

#32 2012-06-07 18:48:54

zero
Member
From: Lancashire
Registered: 2004-04-19
Posts: 1,470
Website

Re: adi_gps – Extract GET & POST variables

Thanks, Adi, Jakob and Matt. I struggled but got there in the end. Cheers!


BB6 Band My band
Gud One My blog

Offline

#33 2012-08-02 21:40:25

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_gps – Extract GET & POST variables

Guys, guys – this is the adi_gps forum thread!

I’m glad you sorted out the initial problem (which I wasn’t able to get to in time) but please discuss non-adi_gps issues elsewhere! Like here, if it’s about etc_query.

Offline

#34 2012-08-02 21:41:22

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,373

Re: adi_gps – Extract GET & POST variables

Thanks Uli, I see you’ve had the same thought.

Offline

#35 2012-08-02 21:44:13

progre55
Member
Registered: 2006-05-02
Posts: 668

Re: adi_gps – Extract GET & POST variables

gomedia:

Sorry for the thread which started in one direction but then moved in another. I should have added that without your plugin getting to the solution would not have been possible. I will definitely be highlighting and featuring it in the “How To Filter Articles USing Drop Downs and Multi-Selects” Now all I need to do is write it. :)

progre55

Offline

#36 2012-08-04 13:19:52

etc
Developer
Registered: 2010-11-11
Posts: 5,028
Website GitHub

Re: adi_gps – Extract GET & POST variables

Sorry for the unintentional flood, Adi and all, and thanks to Uli for keeping the forum clean. Everything between the problem statement and the final 4-5 posts can be safely trashed, I think.

Adi, can adi_gps import GET/POST arrays?

Offline

Board footer

Powered by FluxBB