#eb7100
33409
0
1
May 16, 2024 19:58:36 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Dec 14, 2015 10:29:34 GMT -8
They can only be obtained if they're already on the page to begin with. If not, then you're unfortunately out of luck in that regard.
|
|
inherit
114253
0
Apr 1, 2024 6:38:35 GMT -8
Teg
Can't Wait for V6
3,138
November 2007
teg
|
Post by Teg on Dec 14, 2015 10:37:47 GMT -8
They can only be obtained if they're already on the page to begin with. If not, then you're unfortunately out of luck in that regard. Could it, possibly, be done with a plugin?
|
|
#eb7100
33409
0
1
May 16, 2024 19:58:36 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Dec 14, 2015 10:44:34 GMT -8
A plugin cannot obtain that data unless it's already on the page. Plugins use HTML, CSS, and Javascript similar to what you already have in place. They do not have database access.
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Dec 14, 2015 11:45:49 GMT -8
Hey, Brian! You've been totally totally awesome so far <3 I see now that plugins, or anything really, can't access data that aren't already on a page (this post doubles as a feature request ), so things such as the status tracker plugin, for example, must poll statues as they're being displayed on the user's profile, stored in a key, and it's then that key that's read on other other pages. In this case, the key acts as the intermediary, storing the data when it's displayed, caching it, if you will, they displaying it wherever. My question then: Can this method be used to show the online statuses for specific members, on a different page? I'm thinking when the home page is loaded, the member list is polled as is usual for that template. In the foreach loop for the member list, if we get to the user ID for the member we're interested in, store their online status in a variable. On all other pages, read that variable and display the online status. I realise this won't show LIVE data again until the current user navigates back to the home page, and that variable is refreshed. But would this work? Would the variable have to go in the global/forum header section? Or would the value be lost anyway on page refreshed?
|
|
#eb7100
33409
0
1
May 16, 2024 19:58:36 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Dec 14, 2015 11:51:39 GMT -8
My question then: Can this method be used to show the online statuses for specific members, on a different page? I'm thinking when the home page is loaded, the member list is polled as is usual for that template. In the foreach loop for the member list, if we get to the user ID for the member we're interested in, store their online status in a variable. On all other pages, read that variable and display the online status. I realise this won't show LIVE data again until the current user navigates back to the home page, and that variable is refreshed. But would this work? Would the variable have to go in the global/forum header section? Or would the value be lost anyway on page refreshed? Plugin keys can only be set based on a user interaction with an element on a page rather than a page load, so those are a no-go since you won't be able to update them automatically. Javascript variables are lost once you navigate away from the page. You'd need to use either cookies or localStorage in order to retain values across different pages.
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Dec 14, 2015 12:38:20 GMT -8
Ah, I didn't know that about plugin keys Would variables be lost even if they were declared in the global header? I'll look into the localstorage thing. It would only need to be session dependant. Thank you for all your help Are you into Harry Potter? You should totally join when we're live
|
|
inherit
114253
0
Apr 1, 2024 6:38:35 GMT -8
Teg
Can't Wait for V6
3,138
November 2007
teg
|
Post by Teg on Dec 14, 2015 12:55:51 GMT -8
Azy seems to think that I have some sort of pull with you and that I can get you to Skype us and become part of an uber extensive and custom HP role play (skype: theteggers) haha Seriously though, We really appreciate all your help.
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Dec 14, 2015 13:04:27 GMT -8
Well you're all kinds of awesome Amanda, and Brian is all kinds of awesome, too, I really thought he'd add you or me (skype: azayles) so we could all chat it up Maybe he doesn't think we're cool enough, or maybe our combined awesome would just overwhelm him
|
|
#eb7100
33409
0
1
May 16, 2024 19:58:36 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Dec 14, 2015 13:33:55 GMT -8
Ah, I didn't know that about plugin keys Would variables be lost even if they were declared in the global header? I'll look into the localstorage thing. It would only need to be session dependant. Thank you for all your help Are you into Harry Potter? You should totally join when we're live Variables only exist on the page they were declared on. Once you navigate away from that page the variable no longer exists, so the only way to retain variables across pages using Javascript exclusively is through the use of cookies or localStorage, both of which are stored in the browser itself. I like the Harry Potter series, but I'm not into it. Certainly not a talking point for me.
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Dec 14, 2015 13:54:42 GMT -8
I guess the header, even global header is refreshed on pageload along with everything inside it, as it makes up the whole DOM structure. Gah! The PB dev monkeys sure don't make it easy for us other dev monkeys Thanks a lot, Brian You've been a darling!
|
|
inherit
114253
0
Apr 1, 2024 6:38:35 GMT -8
Teg
Can't Wait for V6
3,138
November 2007
teg
|
Post by Teg on Dec 14, 2015 15:43:53 GMT -8
Is there anyway to return the Exact URL the Current User is on?
|
|
#eb7100
33409
0
1
May 16, 2024 19:58:36 GMT -8
Brian
48,129
November 2004
smashmaster3
|
Post by Brian on Dec 14, 2015 15:58:41 GMT -8
Everything tied to the current URL of the browser can be found in the location object. www.w3schools.com/jsref/obj_location.asplocation.href returns the full URL while location.pathname just returns the path.
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Dec 14, 2015 16:35:38 GMT -8
Everything tied to the current URL of the browser can be found in the location object. www.w3schools.com/jsref/obj_location.asplocation.href returns the full URL while location.pathname just returns the path. YOU BEAUTIFUL BASTARD! This is exactly what I need I'd marry you if I wasn't already crazy for someone else - Ok, SO, what I plan to do: - Use location.href to parse the url and work out if a member is visiting /forum or /forum?about - If they go to /forum, load the page as normal, but if they go to /forum?About, trap that with an if statement then load up an About page where the forum would normally go (all in the same template, no iframes or embedding or other weirdness) - Use the loops and variables of the home template (now situated on /forum because it isn't our home page) to loop through members, as the infocenter block does anyway, pull out the members we're after using more if statements, and display their online status. Store this in a variable for each member. - Now display the members, hardcoded on the page as normal, but refer to our variables to see which of those members are online, and display a status as such. It's messy. Messy af in fact. Or glorious. I've not decided!
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Dec 15, 2015 4:46:13 GMT -8
Gah! The PB dev monkeys sure don't make it easy for us other dev monkeys I know you meant that in a fun joking way. But I have to say, things for version 5 are a ton easier compared to pre version 5 for devs.
|
|
inherit
224260
0
Nov 1, 2020 15:13:16 GMT -8
Azy
632
August 2015
azayles
|
Post by Azy on Dec 15, 2015 7:14:21 GMT -8
Gah! The PB dev monkeys sure don't make it easy for us other dev monkeys I know you meant that in a fun joking way. But I have to say, things for version 5 are a ton easier compared to pre version 5 for devs. Indeed, I have nothing but love for dev guys really It's been frustrating at times, but massively rewarding when get things working, the things I learn!
|
|