Troxy
Junior Member
Song in the air, why should singer care when singer can be among song?
Posts: 321
inherit
126658
0
Apr 11, 2011 0:17:35 GMT -8
Troxy
Song in the air, why should singer care when singer can be among song?
321
June 2008
troxy
|
Post by Troxy on May 31, 2010 22:51:51 GMT -8
So, I know there is "home" and "boardindex" for the pb_action, but are there any others? What do they all mean, and where do they apply? Is there a list where I can find these things, or any way I can see what pb_action applies to a page by looking at the source?? I used this in a code before, and it got me really curious as to what else can be done with this magical little thing.
(BTW, I know "boardindex" can be used, but I dont know what it DOES. Any help??)
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on May 31, 2010 22:53:54 GMT -8
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on May 31, 2010 23:37:59 GMT -8
pb_action is a PB variable. It doesn't exactly match the "action=" in the URL. For example: support.proboards.com/index.cgi?board=programmingpb_action="boardindex" is the above. Your thread listing page. If you update your header/footer code, the URL on the page will say "action=headersfooters3". But pb_action will be equal to "admin" (it's the admin panel page) Using the pb_action is sometimes easier to find out exactly what page you are on. pb_action="home" will always be "home" if you are on the main page. Even if you logout or do a "mark all boards read". Much more convenient for location checks for some codes. If you want to play with it, put this in your global header on a test forum and go to different pages of your forum. <script type="text/javascript"> <!-- document.write("<center><b>PB Action = "+pb_action+"</b></center>"); //--> </script> Regards, SubDevo
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Jun 1, 2010 8:06:28 GMT -8
I'm glad Sub showed me the pb_action variable! I hate doing location checks.
|
|
Troxy
Junior Member
Song in the air, why should singer care when singer can be among song?
Posts: 321
inherit
126658
0
Apr 11, 2011 0:17:35 GMT -8
Troxy
Song in the air, why should singer care when singer can be among song?
321
June 2008
troxy
|
Post by Troxy on Jun 1, 2010 8:50:37 GMT -8
aheehee, I'm gonna have fun with that. I'm a dork yes, but I'm excited. This is gonna let me do stuff I didn't think I could. Thanks for the knowledge SubDevo and iPokemon :]
|
|
inherit
77753
0
Jul 18, 2024 12:23:50 GMT -8
Bob
2,623
April 2006
bobbyhensley
|
Post by Bob on Jun 1, 2010 10:03:07 GMT -8
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Jun 1, 2010 10:03:45 GMT -8
I'm not iPokemon. >=[
Blast him and his avatar.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Jun 1, 2010 10:58:00 GMT -8
Tee hee ^.^
|
|
Troxy
Junior Member
Song in the air, why should singer care when singer can be among song?
Posts: 321
inherit
126658
0
Apr 11, 2011 0:17:35 GMT -8
Troxy
Song in the air, why should singer care when singer can be among song?
321
June 2008
troxy
|
Post by Troxy on Jun 1, 2010 13:24:22 GMT -8
oh, sorry mister Stover!! D: Please accept my most humble of apologies
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Jun 1, 2010 14:00:15 GMT -8
lol, no thanks to me :cry:
|
|
inherit
134992
0
May 26, 2012 2:38:57 GMT -8
SubDevo
Creator of LSD...
3,861
December 2008
subdevo
|
Post by SubDevo on Jun 1, 2010 18:30:19 GMT -8
I'm not sure if it is actually assumed and removed by default. I believe the "action=boardindex" is just ignored. Just like if you add "&type=2" to the end of the URL in your example. It still works. No errors. It is just ignored. Then again if I change the action to "home", it ignores the "board=" part and does the action. support.proboards.com/index.cgi?action=home&board=programmingOf course if you put something not understood in for the action it pukes. Click the above! It brings you to the main page, BUT the nav tree still reflects this board! Interesting... Either way my point was that you don't need to use location.href for everything. It still has it's pros and cons just like ONLY using pb_action. You need to decide which to use based upon the pages your code will be affecting. For some pages, I still prefer to check for the existance of a form name. The most useful is "home" and "boardindex". We have all seen this or similar for checking for the main page: if(location.href.match(/\.com(\/|.+cgi(\?|#.+|\?\w+=home)?)?$/i)){ Now you can just use if(pb_action=="home"){ Regards, SubDevo
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Jun 1, 2010 20:11:36 GMT -8
boardindex is assumed. If you try changing it to something else, you either get an error (e.g. action=test) or that page (e.g. action=home).
|
|
inherit
16846
0
Nov 19, 2012 15:20:20 GMT -8
Chris
3,036
December 2003
cddude
|
Post by Chris on Jun 3, 2010 14:02:30 GMT -8
When did pb_action get added?... and why didn't anyone tell me?!
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Jun 3, 2010 15:41:46 GMT -8
Lol, Proboards is slowly trickling in new features, Chris.
|
|
inherit
100824
0
May 13, 2012 5:37:49 GMT -8
Michael
14,585
March 2007
wrighty
|
Post by Michael on Jun 7, 2010 14:06:10 GMT -8
Lol, Proboards is slowly trickling in new features, Chris. No. They're testing things!
|
|