| We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
- Pages:
- 1
- 2
| [ C ] Code to get a link from a profile field. | |
|---|---|
| Tweet Topic Started: Jul 19 2013, 08:05 PM (862 Views) | |
| RichardInTN | Jul 19 2013, 08:05 PM Post #1 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
Board Address: Great Escape Board Software: ZetaBoards Description: I have the following code created by HolySavior of ZNR (with my links in it, obviously) What I'd ideally like to add to it is a link line (this would be either "idrop[6]" or I might re-number them and make the new one "idrop[0]") that would get an address from a profile field labelled "My Radio Station" and then open a new pop-BEHIND (or popped up, but instantly minimized) window for that radio station's live broadcast. I'd like the link in the menu, when created, to be named "My Radio". Here's an example of a link that would be found in the "My Radio Station" profile field (it's my local station, that I listen to): http://www.wimz.com/sites/wimz/wimz.html Is this possible? Edited by RichardInTN, Jul 19 2013, 08:07 PM.
|
![]() |
|
| Cory | Jul 20 2013, 03:53 AM Post #2 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
I don't have the window/tab focus operational at the moment, but this is a start:
|
![]() |
|
| RichardInTN | Jul 20 2013, 04:13 AM Post #3 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
In the Javascript window shouldn't actually be so it matches the "My Radio Station" profile field? Other than that, it looks great so far. I'll wait to implement it though, until you say you've got the window focus set up. Edited by RichardInTN, Jul 20 2013, 04:29 AM.
|
![]() |
|
| Cory | Jul 20 2013, 04:17 AM Post #4 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Indeed, make sure your profile field name and link name is the same, or if you don't want them the same just a few things in the script will need to be modified. |
![]() |
|
| RichardInTN | Jul 20 2013, 04:29 AM Post #5 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
Also, when I do install the javascript you are writing... where will it go in relation to HolySavior's script? It's in "Above the Board"... will your script be added before or after HolySavior's? |
![]() |
|
| Cory | Jul 20 2013, 04:36 AM Post #6 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Above or below the code should be fine. It's a click function, so it doesn't need to be placed in a specific location in relation to the code to parse correctly. |
![]() |
|
| RichardInTN | Jul 20 2013, 08:03 PM Post #7 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
I changed my mind, and decided to go ahead and add it (I can always update it with the window focus). I found a glitch. When it's clicked, it takes me to the "Edit Profile" page instead of going to the radio station's site. ETA: Would it matter that (because I'm getting close to my character limit) I saved the script as a file and "called it" using (That's how I call HolySavior's code as well) Edited by RichardInTN, Jul 20 2013, 09:49 PM.
|
![]() |
|
| Cory | Jul 21 2013, 03:06 AM Post #8 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You'll need to change the link name to My Live Radio as well or change this:To this:
|
![]() |
|
| RichardInTN | Jul 21 2013, 04:56 AM Post #9 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
Changing the link name fixed it. I thought you meant only the variable attached to the name had to be the same. I misunderstood. Thanks for your efforts so far, I hope you can get the focus to work so it opens behind everything else OR opens minimized. Encountered an unexpected problem (nothing to do with your code though) that gave me an idea. My local station (the link in the OP) goes to "dead air" when they are broadcasting (over antenna) subcontracted content (no live DJ at their station)... like, right now, "the House of Hair" (80's heavy metal "hair bands") is being broadcast by antenna, but there's nothing on the on-line broadcast but an notation that they are broadcasting "House of Hair"... So... would a SECOND choice be possible? I'm thinking with completely separate and independent profile fields (make them "My Live Radio 1" and "My Live Radio 2") and separate "idrop[#]" entries in the "Helpful Links" drop down menu? Edited by RichardInTN, Jul 21 2013, 09:41 PM.
|
![]() |
|
| Cory | Jul 22 2013, 03:07 AM Post #10 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
First things first, I'm not sure about the window/tab focus. In a way, the possibility of doing this sounds like it could be a security breach, meaning any site can set their website window/tab to focus, while all other websites are blurred making it where their site is always viewable. Using window.open() to open a popup doesn't seem doable because so many browsers allow or enable popup blockers by default because they are generally considered intrusive, especially when it comes to advertising. I was taking a peek at some of the answers on Stack Overflow about this window/tab focus issue and most of the answers said it wasn't possible or practical. I have an idea myself though: You can create a webpage and have an input box and submit button. In the input box users can insert their radio station link and when the form is submitted the link will either open in a new tab/window or open in an iFrame on the webpage itself. All links on this webpage can have the 'target' attribute set to _blank so the links will open in a new tab/window and the user won't be navigated away from their radio station and it will basically be playing in the background while they are browsing other parts of the forum. Or, scratch the insertion of the radio link in the input box idea and make it so the radio link is grabbed from their Editing Profile page and all they have to do is click a button on the webpage to turn it on using the methods described above. |
![]() |
|
| RichardInTN | Jul 22 2013, 03:17 AM Post #11 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
Well, the window focus wasn't a "necessity" so much as it would have been a "niceity". There's always the standby of RIGHT-CLICK on the link in the menu and tell it "Open link in new window", then just minimize the window (that's how I personally use it now). ETA: that didn't sound "clear" to me... so, to be clear, the code you already wrote works perfectly if the user RIGHT-Clicks. Edited by RichardInTN, Jul 22 2013, 03:19 AM.
|
![]() |
|
| Cory | Jul 22 2013, 06:11 AM Post #12 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
You could try something like this I guess:
|
![]() |
|
| RichardInTN | Jul 22 2013, 06:59 AM Post #13 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
It's o.k. ... don't worry about that alert. I have "How to" pages for certain things... I wrote one for this, so RIGHT-Clicking is already covered. The only thing really needed now is a second link for a second station (just in case the first one is dead air)... and whatever coding in your Javascript to make the second link work. |
![]() |
|
| Cory | Jul 23 2013, 06:57 AM Post #14 |
|
Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]()
|
Try this:
|
![]() |
|
| RichardInTN | Jul 24 2013, 01:30 AM Post #15 |
|
I believe in I.D.I.C.
![]() ![]() ![]() ![]() ![]()
|
Works perfectly Cory. You are a RockStar dude. |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| Go to Next Page | |
| « Previous Topic · Closed Requests · Next Topic » |
- Pages:
- 1
- 2
| Track Topic · E-mail Topic |
3:03 PM Jul 11
|


![]](http://b1.ifrm.com/0/1/0/p601690/pipright.png)


3:03 PM Jul 11