Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#16 2009-03-17 08:59:15

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

Re: adi_gps – Extract GET & POST variables

ijarinz wrote:

it doesnt work with my 4.0.8 . is it so or am just an idiot?

It works with my 4.0.8, which bit isn’t working for you?

Offline

#17 2009-08-15 18:13:24

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: adi_gps – Extract GET & POST variables

Do you have an uncompressed version Adi please? I can’t install the current download.


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#18 2009-08-19 11:39:53

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

Re: adi_gps – Extract GET & POST variables

thebombsite wrote:

Do you have an uncompressed version Adi please? I can’t install the current download.

I sent you an email but I guess it didn’t get through. Have a go with this one.

Offline

#19 2009-08-19 16:08:53

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: adi_gps – Extract GET & POST variables

Ahh. Thanks for that Adi. :)

I did get your email but when I spotted it, for whatever reason, I decided that it was just a form mail from the forum telling me someone had added a post to this thread so I dismissed it, then came here only to find that I was wrong. Doh! ;)


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#20 2010-02-14 23:51:44

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: adi_gps – Extract GET & POST variables

Hi!
Steff pointed me to this plugin for something I am building.
I am creating a Realestate website, with a complex search.
I need to do the following and I am not sure if its posible using adi_gps (dont have any sql or php knowhow)
This is what I am doing: (all fields are custom_fields)

A Search form with 2 Select boxes, the first SELECT is “Type” (apartment, house….) the second SELECT is “Option” (Rent, Sale…).
After the user selects the type and the option and hit “Search”, they will see a Map (I will use Tooltip JS to make the “Regions” of the map show the number of articles found for each of the “Regions”.

- So in this first step, what I need is some way to search for those fields and organize the results in different lists depending on the custom_fields “Region”.

The user can then click on a “Region” on the map and see the list of articles only from that Region he selected.

There is more…
After selecting the Region, if only 5 or less results are found, it will show those results, and on another list it will show similar results to the one selected by the user.
If he searches for A+B in REGION 1 and gets 3 results.
It will show those 3 results in one list, and the results from A+B in REGION 2 and A+B in REGION 3 in another list.

-I guess this second part has nothing to do with this plugin at all…

Any help or clues on how to acomplish something like this?
thanks!

Last edited by mlarino (2010-02-14 23:53:59)

Offline

#21 2010-02-15 23:44:07

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

Re: adi_gps – Extract GET & POST variables

Hi mlarino,

adi_gps would be able to pull out the POST variables for you, so when the user clicks on the search button you can process the “Type” and “Option” vaues.

You can test it by using something like:

<txp:adi_gps post="1" list="1" />

and see what you get after clicking your search button.

WRT advising you on coding the website functionality, sorry but I don’t have the spare time for that. If you’re stuck, try the How do I? forum.

Regards,

Adi

Offline

#22 2010-02-23 23:55:37

mlarino
Member
Registered: 2007-06-29
Posts: 367

Re: adi_gps – Extract GET & POST variables

Hi!
Hope you can help me out on this one!

I created a form, with TYPE and OPTION. (to make a search of articles)
then the results are counted and I get a list of the articles sorted by regions.

each number on the list is a link to display the articles.

MY problem is that the $POST from the form is lost in the 3rd page loaded, and I wanted to know if adi_gps can help me save that $POST information so I can use it in the 3rd page.

I am trying not to use $Session

www.mlarino.com/asesoria/inmobiliaria

Thanks

Last edited by mlarino (2010-02-24 00:12:58)

Offline

#23 2010-02-24 02:36:00

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

Re: adi_gps – Extract GET & POST variables

mlarino wrote:

MY problem is that the $POST from the form is lost in the 3rd page loaded, and I wanted to know if adi_gps can help me save that $POST information so I can use it in the 3rd page.

adi_gps automatically saves the GET/POST variables as TXP variables. So a POST variable “ABC” should be available as a TXP variable, which you can access:

<txp:variable name="ABC" />

To see what TXP variables have been set:

<txp:php>print_r($GLOBALS['variable']);</txp:php>

Offline

#24 2011-03-03 21:41:55

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

Re: adi_gps – Extract GET & POST variables

Hi! I’m trying to get adi_gps to display an email address passed via URL variable on the page— like this:

?mail=john@my.tld

That works fine. Using <txp:variable name="mail"/> displays the address correctly.

However, when the email address includes a plus sign (which is a common method used my gmail users to filter messages), a blank space is substituted. Like this:

?mail=john+2011-03-03_16-40-47@my.tld

XHTML output of variable tag:

john 2011-03-03_16-40-47@my.tld

Why is the plus sign ignored? Is there any way to get it to pass the plus sign through?

Offline

#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: 1,000
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,475
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.


Dozy P My attempt at music

Offline

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

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,192
Website GitHub

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

Board footer

Powered by FluxBB