PDA

View Full Version : Trouble with Globalize


Michael Morris
12-27-2004, 01:24 AM
This is starting to get on my nerves. In forumdisplay.php there's this line of code.

globalize($_REQUEST , array('sortfield', 'sortorder' => STR_NOHTML));

Now if I understand what I've read this pulls the array sortfield and sort order out of the form in the forumdisplay template.

BUT THERE IS NO SORTFIELD OR SORTORDER ARRAY!!!!!!!!!!!

There is a sort array and an order array. Why, (how?) is globalize getting these values??

I'm trying to set up a new search technique for an extension database. I've successfully built the modules needed to enter new items, edit and display them. Now, at the last, I need to sort them. I need to perform sorts by up to two criteria (not one) in descending or ascending order, and allow a field search for term. That second part means I really need to use globalize to sanitize the incoming variable.

Any help would be appreciated - though I'm gonna continue plugging at this.

AN-net
12-27-2004, 03:11 AM
i would assume by vb's setup that sortfield is an array since its undefined and that sortorder is a str(DESC or ASC) ;)

globalize takes fields being submitted and transfers it from either $_POST or $_GET to $fieldname. It also allows you to evaluate certain types of criteria such as text, numbers, or strs.

hopefully this helps

Michael Morris
12-27-2004, 03:18 AM
:shrug:

I dunno - I figured out a workaround - directly reference the array you're looking for. But it still puzzles me that that particular instance works for them :\

Then again, it is their code :)

AN-net
12-27-2004, 03:22 AM
r u sure the form ur using is using $_REQUEST or $_GET?

Michael Morris
12-27-2004, 03:33 AM
That wouldn't matter - during init.php vbulletin moves $_GET over into $_REQUEST