PDA

View Full Version : Filter This!


The Geek
12-13-2006, 02:43 PM
Please note that this tutorial pertains to GARS 2.1.1 and GARS 2.1.2
Earlier versions will not have the filter module and later versions may be slightly different (but how the hell do I know that as I haven't written any newer versions yet!).

The custom field

The filter module is a new module and feature in GARS that will enable you to filter a forum by a custom field. The custom field MUST be a 'Select Box' type. A select box is a drop down list of pre-defined text. You define the text when you create (or edit) a Select Box custom field

652
A select box custom field

Adding to your type

Then your type must have the select box custom field associated with it. To do this, edit the correct type and scroll to the bottom. You will notice that there will be a tick box to associate the custom field to your type. There will also be an additional tick box (only available with select box custom fields) to allow users to filter by the field.

653
Allow users to filter by field

Setting up the module

You need to add the filter module to your module set in order for it to appear. It is important to note that the filter module only works on forumdisplay pages so don't add it to the showthread page!

654
Editing the modules settings

You can currently only filter by 1 select field at a time.

Want an example? The forum this tutorial in is set up to filter between GARS, GAL and GAB tutorials :)

nJoy

phlogiston
12-14-2006, 07:38 AM
not working for me in firefox 1.5

Problem seems to be the same as something else I saw where using & rather than & in urls for javascript's document.location gives an incorrect url.

ie. I'm being left with http://www.thevbgeek.com/forumdisplay.php?f=12&filter[20]=GAB

IE quick swaps the url in the address bar from what I can see, dunno which browser is doing the "right" thing though!

goyo
12-14-2006, 08:01 AM
not working for me in firefox 1.5

Problem seems to be the same as something else I saw where using & rather than & in urls for javascript's document.location gives an incorrect url.

ie. I'm being left with http://www.thevbgeek.com/forumdisplay.php?f=12&filter[20]=GAB

IE quick swaps the url in the address bar from what I can see, dunno which browser is doing the "right" thing though!

I had the same problem, here's the solution:
http://www.thevbgeek.com/showthread.php?p=14716#post14716

:)

The Geek
12-14-2006, 10:34 AM
hmmm. Youre right. FF doesnt like it unless its an &... Ill mark it as a bug. In the meantime, check the post above for a fix

Ramses
12-14-2006, 02:20 PM
I can confirm this, it's only working if change as described above, but still not filtering words containing ü ä ö etc.
B.t.w. this filtering thing is a very cool idea, thanks geek.

goyo
12-14-2006, 04:55 PM
I can confirm this, it's only working if change as described above, but still not filtering words containing ü ä ö etc.
B.t.w. this filtering thing is a very cool idea, thanks geek.

Yeah it doesn't work with other characters like: ()
It should be stated somewhere... :D

Otherwise GARS is not "just" an article/review system anymore...it's soooo flexible :)

The Geek
12-14-2006, 07:07 PM
Ill look into the special character issue. Im suprised it doesnt, but I will have to run tests with it to figure out why. Im sure another minor update will make an appearence within the next week :)

Tigratrus
12-14-2006, 07:25 PM
Heh. In time for Xmas! Actually, having the Filters pretty much already qualifies as an extra Xmas present... We were talking about ways to do exactly what the filter provides just the night before you released it. I'm thinkin the Geek must be psychic... Or Psycho... Or something like that ;-).

We've been using the filters quite a bit setting up a whole slew of GARS enabled forums of different flavors, and they're working great so far. Once we figured out the quirks... Nice addition to the tutorial btw!

James

trana
12-14-2006, 09:32 PM
It doesn't seem to be working for me. I have the filter module enabled and in the module set. Also the fields are selected within the module edit screen. I cleaned my module cache as well.

Any ideas?

The Geek
12-15-2006, 07:33 AM
Can you provide a URL trana?

gldtn
12-15-2006, 07:55 AM
Geek,

I know this might sound like a dumb question, but maybe I'm missing something and I'm a bit lazy to do a upgrade right now and find out for myself.. I'm using GARS v2.1.1 and noticed a few changes in your tutorial screenshots , but I went ahead and followed it anyways, but I couldn't get the filter custom field to show. Is this new feature only working on the lastest release of v2.1.2?

Thanks!

The Geek
12-15-2006, 08:04 AM
The screenshots should be the same for 2.1.1 what are you seeing thats different?

gldtn
12-15-2006, 04:07 PM
The screenshots should be the same for 2.1.1 what are you seeing thats different?

While adding the module to the forum display, under settings.. I don't see the options to "Include this container" neither the "Other module settings" "Vertical"

The Geek
12-15-2006, 05:06 PM
hmmm... but it registred itself?

gldtn
12-16-2006, 12:08 AM
Yes, it don't even appear on forumdisplay, but if I added to showthread it appears with the correct filter that I selected while creating the thread.

The Geek
12-16-2006, 07:53 AM
hmmm... It sounds like it is a corrupt file cache.

I assume you are using the 'cache settings' options. If so, delete all .php files from geek/gars/cache and its subfolders. Then go into your gars settings page and click save to rebuild your cache. Let me know if it helps.

gldtn
12-16-2006, 07:42 PM
Setting up the module

You need to add the filter module to your module set in order for it to appear. It is important to note that the filter module only works on forumdisplay pages so don't add it to the showthread page!


Stupid of my part, I totally missed that FILTER Module and added it as a custom field, thats why it was not appearing, and the screenshots looked a bit different.

sorry!

The Geek
12-17-2006, 08:48 PM
whew. Thats great as I was mega confused :D glad its sorted for you now!

trana
01-17-2007, 07:51 PM
You can currently only filter by 1 select field at a time.

Any idea when we might see multiple filter options?

<cough>with AJAX updates?</cough>

Thanks!

The Geek
01-20-2007, 03:15 PM
:) no, not yet. I implimented it as it is as many were asking for the basic functionality. I will need to rethink the code to allow for multiple options which is tough because it requires more creative javascript (because its in a nested table).

Not sure how ajax would work with this?