Sign Up! Login: Password: New User? Forgot? Support
Code 
 
 
Forums 
Forums : Archive > Wow Calendar on GP
Dethmaul (Member) 8/16/2010 12:06 PM EST : Wow Calendar on GP
Dethmaul
Posts: 987

0
Like

0
Dislike

I was looking for a way to link the wow calendar similar to the way the XSL tranform version of the roster worked.

I gave up on that, but I found this interesting bit of code that is wonderful.

<div style="text-align: center;">
<script type="text/javascript">                       
function get_game_calendar()                       
{                       
   var name=prompt("Please enter your charcter name","");                       
   if (name!=null && name!="")                       
   {                       
      window.open("http://www.wowarmory.com/vault/character-calendar.xml?r=Arathor&cn="                       
      + name + "&gn=The+Underground");                       
   }                       
}                       
</script>
<a href="javascript:get_game_calendar();"><img alt="" src="http://a.imageshack.us/img840/1174/armory.png" /></a></div>
<br />
<div style="text-align: center;">Click on the image above , type your character name in the prompt, then login and it will take you straight to the calendar for that character. </div>


My question is, is there a way to make this embed into the window it is in or maybe another on the same GP tab?

I want people to be able to edit their calendar WITHOUT navigating away from the site.

This topic was moved from forum Calendar & Events to forum Archive on 2/25/2011 5:38 PM by Mottie.
TopBottom

Mottie (SuperAdmin) 8/16/2010 7:05 PM EST : RE: Wow Calendar on GP
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Dethmaul!

I changed the code around a bit to add a frame with the armory instead of opening a new window. I hope that is what you wanted 

WoW Calendar on GuildPortal

GuildPortal admin site link to the original post

Add the following code into a free form text/HTML type widget while in HTML mode.

Code
<script type="text/javascript">
$(document).ready(function(){

 var guildName = "The Guild Name";
 var realm = "Arathor";

 var useFrame = true;
 var frameWidth = "100%";
 var frameHeight = "600";

/******************************
  Don't change anything below
 ******************************/

  $('.wowcharcal').click(function(){
  var f, name = prompt("Please enter your charcter name","");
  if ( name != null && name != '' ){
   if (useFrame) {
    f = "<iframe width=\"" + frameWidth + "\" height=\"" + frameHeight + "\" src=\"http://www.wowarmory.com/vault/character-calendar.xml?r=" +
     realm.replace(/\s/g,'+') + "&gn=" + guildName.replace(/\s/g,'+') + "&cn=" + name + "\" scrolling=\"auto\" frameborder=\"0\" align=\"top\" " +
     "allowtransparency=\"true\"></iframe>";
    $('.wowcal').html(f);
   } else {
    f = "http://www.wowarmory.com/vault/character-calendar.xml?r=" + realm.replace(/\s/g,'+') + "&cn=" + name + "&gn=" +
     guildName.replace(/\s/g,'+')
    window.open(f);
   }
  }
  return false;
 });
});
</script>
<div class="wowcal" style="text-align:center">
 <a class="wowcharcal" href="#"><img alt="" src="http://www.axiomfiles.com/Files/278466/icon-armory.png" /></a>
 <br />
 <div>Click on the image above , type your character name in the prompt, then login and it will take you straight to the calendar for that character.</div>
</div>
Customizing
  • If the value of "useFrame" is true, the calendar will open in an iframe in place of the button. If false, the calendar will open in a new window/tab.
  • Change the text in blue to match your Guild Name and Realm; include spaces and apostrophes.
  • Adjust the frame size in red to better match your site. The width of the armory is a bit over 1000 pixels, so you should put it in a tab where there are no side zones.
Updated (11/17/2010): Added "useFrame" variable.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Dethmaul (Member) 8/17/2010 12:15 PM EST : RE: Wow Calendar on GP
Dethmaul
Posts: 987

0
Like

0
Dislike

Thanks so much.. That works wonderful.


I did notice that when you signup for an event, it will not refresh the calendar to reflect it, you  have to manually refresh the page, but I dont think it is an error with the scripting because I had to do the same thing when directly logged into the wowarmory.
TopBottom

Mottie (SuperAdmin) 8/17/2010 1:34 PM EST : RE: Wow Calendar on GP
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Dethmaul!

The script is working in Firefox and Chrome without any problems, but to make it work properly in IE, you need to set the security settings to low... just another reason I don't use IE.

Also, you should be able to right click inside the frame and choose "reload" or "refresh" to get a fresh copy from the server.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

shadowstts (Member) 8/20/2010 5:29 AM EST : RE: Wow Calendar on GP
shadowstts
Posts: 364

0
Like

0
Dislike

hi mottie is there way that u could combine ur script that made a new widget row and this script? making it less needing to scroll sidewards.

also how dose it work? cuase i thought all guild calenders wer epassword protected. when i try it all i get is accsess denied u require to log in

Asylum RULES!

TopBottom

Mottie (SuperAdmin) 8/20/2010 6:35 PM EST : RE: Wow Calendar on GP
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Shadowstts!

This script takes you to the wow armory calendar page, when it gets there, the armory makes you log in to see the calendar. So yes, you do need to log in, just make sure you have the right user name and guild name. As for the sideways scrolling, you can fix this one of three ways:
  1. Add this widget to a page that doesn't have any side zone content.
  2. Add a way to hide the side content widgets (this post).
  3. Make a new widget row (this post).
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Gavendo (Applicant) 11/17/2010 11:02 AM EST : RE: Wow Calendar on GP
Gavendo
Posts: 2679

0
Like

0
Dislike

Would it be possible to change the code so that the button takes you to the armory in a new window (or just as a separate link) rather than an iframe? I just can't find a good way to make the iframe fit well into the design of our site but I really do like the idea of the button and the "type in your char name" part.

Cheers for any response!

/Gav
TopBottom

Mottie (SuperAdmin) 11/17/2010 7:07 PM EST : RE: Wow Calendar on GP
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Gavendo!

I've updated the original post with new code - addied "useFrame" variable & more code - set it to false to open the calendar in a new tab.
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

Dethmaul (Member) 2/25/2011 1:39 PM EST : RE: Wow Calendar on GP
Dethmaul
Posts: 987

0
Like

0
Dislike

Mottie,

Any chance of this working with the new battle.net armory changes?
TopBottom

Mottie (SuperAdmin) 2/25/2011 3:27 PM EST : RE: Wow Calendar on GP
ACK!
Mottie
Posts: 3883

0
Like

0
Dislike

Hi Dethmaul!

The battle.net calendar doesn't appear to be the same as the old one... log into battle.net then click this link: https://us.battle.net/wow/en/vault/guild/event

It should take you to the event page, but from looking at the url, I'm not sure where to enter the realm or guild name. If that link just "knows" it's you and your guild/realm, then it should be too hard to update the script. Could you verify this for me? 
Characters: Mottie Motty Mortie Ooshiny Mot Fudgems
TopBottom

 
 
Key 
New posts No new posts
New posts ( popular ) No new posts ( popular )
New posts ( sticky ) No new posts ( sticky )
New posts ( locked ) No new posts ( locked )
 
 
Who's Online 
There are   members online.
 
 
So-and-so has logged on!
%title%
%message%