Sign Up! Login: Password: New User? Forgot? Support
Top Mods!
Wowhead Search
by sonofsamedi
Digital Clock
by Wolfar15
Admin Forums
Welcome to the GuildPortal Help Community! These forums are for admin-to-admin help.
Available Forums
Forums : Feature Discussion > Vote pop-up?
Keilana55 (Guild Admin) 1/31/2011 9:24 AM EST : Vote pop-up?
Keilana55
Posts: 4537
Zomgawsh Poster

Is there a way to make a pop-up notification for voting like mottie made for mail notification pop-ups?

TopBottom

Keilana55 (Guild Admin) 2/2/2011 6:56 PM EST : RE: Vote pop-up?
Keilana55
Posts: 4537
Zomgawsh Poster

Does anyone have an idea?

TopBottom

Mottie (MVP) 2/19/2011 11:52 AM EST : RE: Vote pop-up?
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

Hi Keilana55!

Try this! 

Vote Notification Popup

Add this bit of code to your custom script (Control Panel > Custom HTML & Script > Custom Javascript/JQuery > Document Ready Event tab)
 var growl = true;
 var voteTitle = "<img src='http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/announce.png' align='left'>You Need to Vote!";
 var voteMessage = "You have %x new vote(s)";
 var voteTime = 5000; // in milliseconds

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

 var tmp, vimg = $('.WfTopMenu').find('img[src*=voteBlink.gif]');
 if (vimg.length){
  tmp = vimg.attr('alt').match(/\d/); // get # of votes
  voteMessage = voteMessage.replace(/%x/, tmp);
  if(growl) {
   $.growl.settings.displayTimeout = voteTime;
   $.growl(voteTitle, voteMessage);
  } else {
   jQuery.facebox(voteTitle + '<br>' + voteMessage);
  }
 }
Customizing
  • Setting the growl variable to true will open a growl window with your new mail message.
    Click here to test it (you can change the default style of the growl window - check out this post on how to do that).
    Setting it to false will open a facebox window with the same message.

    var growl = true;

  • The title of the popup window is set using the voteTitle variable. I've included an image in the title as an example:

    var voteTitle = "<img src='http://i201.photobucket.com/albums/aa236/Mottie1/testsite/icons/announce.png' align='left'>You Need to Vote!"; 

  • The content of the popup window is contained in voteMessage variable. The script will replace the "%x" with the number of votes they need to work on!

    var voteMessage = "You have %x new vote(s)";

  • The voteTime variable is used by the growl popup, it sets how long this window is displayed (in milliseconds) on screen before disappearing.

    var voteTime = 5000;

  • Note: The popup windows will continue to open on every page of your site until the user votes... so using the facebox option may be a bit annoying to your users.
TopBottom

Keilana55 (Guild Admin) 2/19/2011 7:02 PM EST : RE: Vote pop-up?
Keilana55
Posts: 4537
Zomgawsh Poster

Thanks a bunch Mottie!  Will this allow mail pop-ups to continue working as usual as well?

TopBottom

Mottie (MVP) 2/20/2011 9:08 AM EST : RE: Vote pop-up?
GuildPortal MVP
Mottie
Posts: 3883
Zomgawsh Poster

yes 
TopBottom

Keilana55 (Guild Admin) 2/20/2011 11:28 AM EST : RE: Vote pop-up?
Keilana55
Posts: 4537
Zomgawsh Poster

Mottie said:
yes 


You are awesome incarnate - thanks!

TopBottom

Admins Online
There are   members online.
So-and-so has logged on!
%title%
%message%