Welcome to Gaia! ::

Keist's & Highpass's Gaia Modifications

Back to Guilds

Home of the Gaia Enhancement Suite! Come check out our mods, and join to receive updates via PM about new tweaks. 

Tags: modifications, tweaks, scripts, styles, javascript 

Reply Old threads
How to Use: Thread Title Filter

Quick Reply

Enter both words below, separated by a space:

Can't read the text? Click here

Submit

Lowpass
Vice Captain

4,350 Points
  • Megathread 100
  • Invisibility 100
  • Mark Twain 100
PostPosted: Thu Jun 24, 2010 7:20 pm


So I get a lot of questions along the lines of "so, uh, how exactly do I use this script?"

So I figured I'd make some threads for the more complicated ones, starting with the Thread Title Filter script. I'll explain it to the best of my abilities in the first post, and if you have any further questions, please post them here.


This script has two functions. One is to limit the number of pages a thread can have and still show up in the forum listing. In other words, say you change the maximum page to 4. If a topic has more than 4 pages of replies, then it will be removed from the forum listing. That's easy enough to understand.


The second function is much more powerful, but also much more difficult to use. It involves something known as regular expressions. You can find tutorials of this online, but I'll try to explain some concepts here with concrete examples.

Let's look at some filters that I use, going from simpler to more complex. For the record, any forward slashes (/) should really be back slashes (). Gaia does weird things with backslashes so I like to avoid them.

/bhangout/b
This is the simplest example I can come up with, shy of just a plain word by itself--which you don't want. /b means "word boundary". In this case, I doubt "hangout" would be encased in any other word, but I like to have the /bs there anyways. Any thread with the word hangout in the title will be filtered.

/bregs?/b
This is very close to the same as before, with one addition: the ?. A question mark means "either once or not at all". It only applies to the preceeding character or subpattern. So in this case, it only applies to the s. This will match "reg" and "regs" but not "regular", "superego", or "aggregate", thanks to the word boundaries.

(giveaway|gift giving)
This is an example of a subpattern. The | in the middle means "or". So, this matches "giveaway" and/or "gift giving". I didn't use word boundaries on this one. You can if you want, but, like hangout above, I doubt either match would be embedded in another word.

/bbump(in('|g)?)?/b
The first somewhat complicated one, but break it down and you'll find it not that hard to understand. First, it matches "bump". However, there's a subpattern after that (with a question mark--meaning 0 or 1), which will make it also match "bumpin". Lastly, there is yet another subpattern, nested in the other, which will let it also match "bumpin'" or "bumping".

/b(thousand|[a-z]+illion) pages/b
This begins with a subpattern to match either thousand, or something else. [a-z] means any character from a to z. If you want numbers, you can do [a-z0-9]. Any other characters can also go inside the square brackets. It will match anything contained within it. The plus sign outside of it means "at least one". This does NOT mean it has to be the same character repeated over and over. In this way, it will match "billion", "trillion", "zillion", or even "gajillion". Outside of the subpattern, there's a space and "pages".

/b50(th)? (post(er|s)?|repl(y|ies))/b
Everything in here should be explained above, so let's just see some examples of what this matches:
  • 50 posts
  • 50th reply
  • 50th poster


If you want to know more about the syntax of regular expressions, this site has some more detailed information.

......................................................................................

To get to the settings, click on the "# Topics Filtered" above the forum pagination--should look something like
Quote:
24 Topics Filtered
Displaying topics up to Today @ 40 Topics per page
«Y «M «W «D «H Today

Right. Once you click that, a settings screen will pop up. There, you can change the page cutoff value and manage your filters.

You'll also see, at the top, a box labeled "Forums". This lets you specify which forums it will (or won't) apply to.

First, if you want to specify the forums that it DOES apply to, then check "Include". If you want it to apply to most forums EXCEPT those you list, check "Exclude". This functionality is mutually exclusive (think about it.)

Then, to specify the forums (not) affected, add their IDs in a list, separated by commas. What is the forum ID, you ask?

When you go to a forum, look at the URL. You'll see "f.##" towards the end. That number is the ID. For example, the Chatterbox is ID #23, and General Discussion is #2.

So, if you wanted the script to only run on the CB and GD, you'd check Include, and put
23,2
in the box.

Be sure to save your settings once your done!
PostPosted: Thu Jun 24, 2010 7:34 pm


where do i put it now? and how would i filter out the invisible threads? that would be

/binvisible/b right?

creed of odin


Lowpass
Vice Captain

4,350 Points
  • Megathread 100
  • Invisibility 100
  • Mark Twain 100
PostPosted: Thu Jun 24, 2010 7:38 pm


SRGNT FGGT
where do i put it now? and how would i filter out the invisible threads? that would be

/binvisible/b right?


Under User Script Commands, there should be a "Add New Filter" option. That will open up a little prompt box. Type the filter in there.

Also, make sure you use backslashes instead of forward slashes.
Reply
Old threads

 
Manage Your Items
Other Stuff
Get GCash
Offers
Get Items
More Items
Where Everyone Hangs Out
Other Community Areas
Virtual Spaces
Fun Stuff
Gaia's Games
Mini-Games
Play with GCash
Play with Platinum