Feature - Implemented make_url() with no arguments

rlbond86

Member
I'm having a problem with my Enhanced Inventory Spoilers script. I want to distinguish if somebody visits their inventory from the menu (in which case the url is "/inventory.php"), or if they visit it from a different inventory page (where the url will be "/inventory.php?which=N"). It would be quite helpful if make_url() worked with zero arguments, as this would solve my problem, though I am of course open to suggestion as to how to do this otherwise.
 

lostcalpolydude

Developer
Staff member
make_url() seems like a misleading function name in that case, since you want the URL that was last visited, rather than one that you have just made and could potentially submit.

This has an example of what you probably want to do.
 

rlbond86

Member
make_url() seems like a misleading function name in that case, since you want the URL that was last visited, rather than one that you have just made and could potentially submit.

The make_url() function already exists, just not with zero arguments.

I will try the form_field() function, I was unaware of its existence. However, it might still be useful to know what page will be called by visit_url().
 
Last edited:

lostcalpolydude

Developer
Staff member
I believe that can be completely determined by using form_fields(), plus knowing what page your relay override script is running on (the only context where visit_url() with no parameters makes sense).

However, it might still be useful to know what page will be called by visit_url().
visit_url() with no parameters does not visit a URL, it only returns the page contents for the last page visited.
 

matt.chugg

Moderator
Isn't the function to get the url of the page you are on get_path() ?

Its been a while since I worked on a relay override, but this is straight out of a global override I was working on:

Code:
	// get page name and postdata/querystring
	string pagename = get_path();
	string [string] fields = form_fields();

I thought that in a relay script, visit_url() with no parameters hit up the server for the content of the page?

Code:
	// get the page
	page.append(visit_url());

I'll probably stand very much corrected shortly!
 
Last edited:

lostcalpolydude

Developer
Staff member
Actually, it looks like get_path_full() just gives you the URL you last visited with no need to do anything fancy. get_path() and get_path_variables() give everything before and after ?, respectively. Those seem to be missing from the wiki currently.

It looks like the requested feature already exists then.
 

Theraze

Active member
Yeah... those got implemented back a year or so, to help facilitate master relay overrides... :)
 
Top