Vote popup menu

Shout-Out

User Tag List

Thread: Vote popup

Results 1 to 1 of 1
  1. #1
    Intu's Avatar Banned
    Reputation
    95
    Join Date
    Feb 2009
    Posts
    303
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Vote popup

    Well I was in need of a vote popup and could never find one, so here is one that I wrote last night.


    Insert this into your page

    Code:
    <script src="js/vote.js"></script>
    
    <div id="vote_popup" style="width: 100%; height: 100%; position: fixed; left: 0px; right: 0px; top: 0px; bottom: 0px; background: url(http://www.backroundurl here) repeat; color: #F0F0F0; font-size: 9px; text-align: center; z-index: 99999; display: none;"><div style="margin-top: 300px;width: 470px;margin-left: auto;margin-right: auto;display: block;positon: absolute;background-color: #000000;">
    <p>
    <a href="vote extension(vote page)" onclick="createCookie('voted','yes','720');" title="">
    <img src="http://www.image url" border="1" style="border-color: #000000; background-color: #333333" alt="" title="Vote for WoW Enforcers!" /></a>
    <br>
    <span onclick="hide_vote_popup();">
    <font size="2" face="Tahoma"><div align="center">Vote later</div></font></span></a>
    </p>
    </div>
    </div>

    Then save that in your php file of set it as php code in dreamweaver.
    Now the cool part, the JScript.

    Here is the code, just save the file as (vote.js)- Must be vote.js for it to work.


    Code:
    // Votepopup
    
    function getInternetExplorerVersion()
    // Returns the version of Internet Explorer or a -1
    // (indicating the use of another browser).
    {
    var rv = -1; // Return value assumes failure.
    if (navigator.appName == 'Microsoft Internet Explorer')
    {
    var ua = navigator.userAgent;
    var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
    if (re.exec(ua) != null)
    rv = parseFloat( RegExp.$1 );
    }
    return rv;
    }
    
    function readCookie(name) {
    var nameEQ = name + "=";
    var ca = document.cookie.split(';');
    for(var i=0;i < ca.length;i++) {
    var c = ca[i];
    while (c.charAt(0)==' ') c = c.substring(1,c.length);
    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    }
    return null;
    }
    
    function createCookie(name,value,min) {
    if (min) {
    var date = new Date();
    date.setTime(date.getTime()+(min*60*1000));
    var expires = "; expires="+date.toGMTString();
    }
    else var expires = "";
    document.cookie = name+"="+value+expires+"; path=/";
    }
    
    
    window.onload = function vote_popup() {
    
    // w00t w00t HAX!
    var ver = getInternetExplorerVersion();
    if(navigator.appName == 'Microsoft Internet Explorer' && ver < 7.0)
    {
    return;
    }
    
    voted = readCookie('voted');
    
    if (voted == null) {
    document.getElementById('vote_popup').style.display = "block";
    }
    
    }
    
    function hide_vote_popup() {
    createCookie('voted','yes','10');
    document.getElementById('vote_popup').style.display = "none";
    document.getElementById('vote_popup').innerHTML = "";
    };
    You will not need to edit any of that, if you need help, let me know.

    Vote popup

Similar Threads

  1. How to add a vote popup to your emu website!
    By Kael'Thas in forum WoW EMU Guides & Tutorials
    Replies: 44
    Last Post: 05-21-2008, 03:56 PM
  2. [Request] Donation page and a php vote popup
    By *Alexz* in forum World of Warcraft Emulator Servers
    Replies: 19
    Last Post: 03-17-2008, 09:05 PM
  3. [Release] Unique Voting Popup - Version 2.0!
    By Hellgawd in forum World of Warcraft Emulator Servers
    Replies: 26
    Last Post: 02-04-2008, 07:20 PM
  4. How Do you make an vote popup on your private server wbsite like that one wowscape ha
    By project anthrax in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 01-28-2008, 12:41 AM
  5. I have A Voting Popups Question
    By PsycoDisciples in forum Community Chat
    Replies: 2
    Last Post: 01-19-2008, 09:38 PM
All times are GMT -5. The time now is 09:45 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search