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
Mottie (MVP) 7/22/2010 5:59 PM EST : Access Level Popup Messages
GuildPortal MVP
Mottie
Posts: 3884
Zomgawsh Poster

Access Level Popup Messages

This script allows you to add a popup message (growl) that will show a different message depending on the user's access level (i.e. one message for the public, one for associates and another for members, etc.).

Code
Add the following code into a free form text/HTML widget on the page you want to display the growl message or add it to the footer to show on every page (but it's more annoying).
<!-- *** Popup message for different access levels *** -->
<div style="display: none">

<!-- PUBLIC -->
<div class="message-public">
 Public Message Here<br>
 <img src="my-image.jpg" />

</div>

<!-- ASSOCIATE -->
<div class="message-associate">
 Associate Message Here<br>
 <img src="my-image.jpg" />
</div>

<!-- MEMBER -->
<div class="message-member">
 Member Message Here<br>
 <img src="my-image.jpg" />
</div>

<!-- COUNCIL/OFFICER/ADMIN -->
<!-- leave div empty to not display a message -->

<div class="message-council message-officer message-superadmin"></div>

</div>
<script type="text/javascript">
$(document).ready(function(){
 // Change the amount of time the popup is shown in milliseconds (5000 = 5 seconds)
 $.growl.settings.displayTimeout = 5000;
 // Don't change anything below
 var access = "$block[userlevelname]".replace(/\s+/,'');
 var content = $.trim($('.message-' + access).html());
 if (content.length){ growl('', content); }
});
</script>
Customizing
  • Timing - Change the amount of time the growl popup is displayed by modifying the time in red (in milliseconds)
     // Change the amount of time the popup is shown in milliseconds (5000 = 5 seconds)
     $.growl.settings.displayTimeout = 5000;
  • Message - Replace the contents in blue above to change the message for each access level.
    <!-- PUBLIC -->
    <div class="message-public">
     Public Message Here<br>
     <img src="my-image.jpg" />
    </div>
  • Access Level Messages - The "message-{level name}" class for the specific access level is displayed. You can add individual messages for each level (like the Message example above) or combine them together as seen in the council/officer/admin block in the code.
    <!-- COUNCIL/OFFICER/ADMIN -->
    <div class="message-council message-officer message-superadmin">
    We Rock!
    </div>
  • No Message - Leave the contents of the <div> empty or don't add the "member-{level name}" class.
    <div class="message-superadmin"></div>
TopBottom

shadowstts (Guild Admin) 7/23/2010 7:59 AM EST : RE: Access Level Popup Messages
shadowstts
Posts: 364
Fingers of Fury!

cool thx

Asylum RULES!

TopBottom

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