Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Main Page (global and main footers) location.href.match(/action=home/) || !location.href.match(/(action|board)=/)

OR

!location.href.match(/action=(?!home)|board=/)




Main Page and Sub-Boards (if in global footer) location.href.match(/action=home/) || !location.href.match(/action=/)

OR

!location.href.match(/action=(?!home)/)




Posting Page/PM Page document.postForm && document.postForm.message



Modify Profile Page document.modifyForm



MiniProfile location.href.match(/action=(display|(calendar|pm)?view)/) || document.title.match(/\s-\s(Search|Preview)/i)


Last Edit: Mar 9, 2008 6:08:58 GMT by Chris

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Just as a heads up, I've up some of these for v4.5 compatibility.

Michael

Michael Avatar
*Has a custom title*



1,462


October 2007
Which have changed? Might be worth pointing that ouT! :P

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
The first three. :P I also updated the last one, but that's not a PBv4.5 fix.

Michael

Michael Avatar
*Has a custom title*



1,462


October 2007
surely:

location.href.match(/action=(change|home)/i) || !location.href.match(/(action|board)=/i)

That is only global not main?

main would be:
location.href.match(/action=(change|home)/i) || !location.href.match(/action=/i)

?

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
It's labeled like that saying the code's location. It will work in both spots with no hitches. :P

Michael

Michael Avatar
*Has a custom title*



1,462


October 2007
:P I'm just being picky! :P

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
I've done some major updating to the list of checks. :P

Updated
- Main page (Both)
- Miniprofile

Miniprofile has been simplified. I removed the i parameter from the RegExp for them and main page. I also added two new main page ones. Both fairly effective.

Zac

Zac Avatar

****
Senior Member

430


January 2008
What's it do Chris?

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
zac said:
What's it do Chris?


This board is for things for coders, not users looking for codes.

But what these do is they help you make sure you're on a specific page before executing coding, just to make the coding faster.

Devin

Devin Avatar

**
Official Member

90


August 2007
I'm going to be adding a few as I mess around with them.

Posting Page (New Thread/Modify first post of the thread)
document.postForm && (!document.postForm.thread || document.postForm.post && document.postForm.post.value == 1)
AFK Aug 2011 - ???

I'll be actively developing codes, tutorials, and templates when I return, later this year.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
&& document.postForm.post.value == 1)

Only the first post ever made on a forum will have the ID of 1 though... so that doesn't work unfortunately. =/

Devin

Devin Avatar

**
Official Member

90


August 2007
Chris Avatar
&& document.postForm.post.value == 1)

Only the first post ever made on a forum will have the ID of 1 though... so that doesn't work unfortunately. =/

Oh of course they wouldn't make it that easy convenient way. >:( I guess that idea would have to be scrapped. I suppose the only way to find the modify post page of the first post in a thread would have to be using the topic summary or something. Lovely ::)

Edit: I suppose I could have the first instance of the modify post button pass along some info in the URL. Guess that wouldn't qualify too well as a location check though.


Last Edit: Mar 1, 2009 17:34:17 GMT by Devin
AFK Aug 2011 - ???

I'll be actively developing codes, tutorials, and templates when I return, later this year.

Chris

Chris Avatar

******
Head Coder

19,519


June 2005
Devin Avatar
Chris Avatar
&& document.postForm.post.value == 1)

Only the first post ever made on a forum will have the ID of 1 though... so that doesn't work unfortunately. =/

Oh of course they wouldn't make it that easy convenient way. >:( I guess that idea would have to be scrapped. I suppose the only way to find the modify post page of the first post in a thread would have to be using the topic summary or something. Lovely ::)

Edit: I suppose I could have the first instance of the modify post button pass along some info in the URL. Guess that wouldn't qualify too well as a location check though.


It would not unfortunately. :( But yeah, it's possible to do it that way.

As for the topic summary idea: Topic summary only shows the last page... so if they're on the 2nd page, it's SoL.

newBookmarkLockedFalling