Voting javascript popup for website

Page 1 of 2 12 LastLast
Results 1 to 25 of 28
  1. #1
    Apprentice Laseen is offline
    MemberRank
    Nov 2006 Join Date
    13Posts

    Voting javascript popup for website

    Well,I had done that work for a mu server but I did it for free. The code is not mine but the graphics are ;) So I guess I have all the rights to make a guide about that since the code is free! :P

    step 1.
    You must add the following line in the HEAD tag of your mainpage:

    Code:
    <head> 
    ....blah blah blah...
    <script type="text/javascript" src="YOUR_PATH_HERE/votebox.js"></script>
    
    </head>

    step 2.
    save the following code as a file with name "votebox.js" and put it in the folder you named as YOUR_PATH_HERE ( you get what i mean. I hope.. :p )

    Code:
    /******************************************
    * Popup Box- By Jim Silver @ jimsilver47@yahoo.com
    * Visit http://www.dynamicdrive.com/ for full source code
    * This notice must stay intact for use
    ******************************************/
    
    var ns4=document.layers
    var ie4=document.all
    var ns6=document.getElementById&&!document.all
    
    //drag drop function for NS 4////
    /////////////////////////////////
    
    var dragswitch=0
    var nsx
    var nsy
    var nstemp
    
    function drag_dropns(name){
    if (!ns4)
    return
    temp=eval(name)
    temp.captureEvents(Event.MOUSEDOWN | Event.MOUSEUP)
    temp.onmousedown=gons
    temp.onmousemove=dragns
    temp.onmouseup=stopns
    }
    
    function gons(e){
    temp.captureEvents(Event.MOUSEMOVE)
    nsx=e.x
    nsy=e.y
    }
    function dragns(e){
    if (dragswitch==1){
    temp.moveBy(e.x-nsx,e.y-nsy)
    return false
    }
    }
    
    function stopns(){
    temp.releaseEvents(Event.MOUSEMOVE)
    }
    
    //drag drop function for ie4+ and NS6////
    /////////////////////////////////
    
    
    function drag_drop(e){
    if (ie4&&dragapproved){
    crossobj.style.left=tempx+event.clientX-offsetx
    crossobj.style.top=tempy+event.clientY-offsety
    return false
    }
    else if (ns6&&dragapproved){
    crossobj.style.left=tempx+e.clientX-offsetx+"px"
    crossobj.style.top=tempy+e.clientY-offsety+"px"
    return false
    }
    }
    
    function initializedrag(e){
    crossobj=ns6? document.getElementById("showimage") : document.all.showimage
    var firedobj=ns6? e.target : event.srcElement
    var topelement=ns6? "html" : document.compatMode && document.compatMode!="BackCompat"? "documentElement" : "body"
    while (firedobj.tagName!=topelement.toUpperCase() && firedobj.id!="dragbar"){
    firedobj=ns6? firedobj.parentNode : firedobj.parentElement
    }
    
    if (firedobj.id=="dragbar"){
    offsetx=ie4? event.clientX : e.clientX
    offsety=ie4? event.clientY : e.clientY
    
    tempx=parseInt(crossobj.style.left)
    tempy=parseInt(crossobj.style.top)
    
    dragapproved=true
    document.onmousemove=drag_drop
    }
    }
    document.onmouseup=new Function("dragapproved=false")
    
    ////drag drop functions end here//////
    
    function hidebox(){
    crossobj=ns6? document.getElementById("showimage") : document.all.showimage
    if (ie4||ns6)
    crossobj.style.visibility="hidden"
    else if (ns4)
    document.showimage.visibility="hide"
    }


    Now the system knows WHERE the file is and knows WHAT to do. But it does not know HOW and WHEN to do it. so we go to step 3.

    Step 3.
    Add right after the BODY tag of your html page (or the index.php page you have) the following code:

    Code:
    <div id="showimage" style="position:absolute;width:300px;left:90px;top:370px">
    
    <table border="0" width="1000px" height="300px"  bgcolor="#453734" cellspacing="0" cellpadding="2">
      <tr>
        <td width="100%">
        	
        	<table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0"
        height="25px">
          <tr>
            <td id="dragbar" style="cursor:hand; cursor:pointer" width="100%" height ="22px" onMousedown="initializedrag(event)"><ilayer width="100%" onSelectStart="return false"><layer width="100%" onMouseover="dragswitch=1;if (ns4) drag_dropns(showimage)" onMouseout="dragswitch=0"><font face="Verdana" size="4" 
            color="#d9952b"><strong><small>Vote for us - If you experience problem of black page, download and run Firefox Browser</small></strong></font></layer></ilayer></td>
            <td style="cursor:hand" height ="25px" ><a href="#" onClick="hidebox();return false"><img src="http://img214.imageshack.us/img214/2522/closeox4.gif" width="21px"
            height="21px" border="0px"></a></td>
          </tr>
          <tr>
            <td width="100%" align="center" valign="middle" bgcolor="#eeeedd" style="padding:4px" colspan="2">
    
    <!-- PUT YOUR CONTENT BETWEEN HERE -->
    <center>
    <IFRAME SRC="http://digg.com" WIDTH="1000" HEIGHT="300"></IFRAME>
    <!-- END YOUR CONTENT HERE -->
    <!-- Credits for the layout and graphics: Laseen @ ragezone, 
    mail: Caveman_gr@yahoo_REMOVETHIS.com -->
    </td>
          </tr>
        </table>
        
        </td>
      </tr>
    </table>
    </div>

    Tadaaa! You are done! Instead of IFRAME you may add anything you want. Internet explorer freaks out with the IFRAME so you'd better use firerox of opera if you use that tag.

    Now there is another tweak you must do if you have flash in your page. If there is flash loaded with the EMBED tag your votebox will not be drag-able. That happens because EMBED is not standard HTML. You have 2 choises:

    1)either use standard XHTML for loading the flash objects you have
    OR
    2)make a quick&addition to the embed tag like that:

    Code:
    <embed name="movie" wmode="transparent" swliveconnect="true" src="YOUR_SWF_SOURCE" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="YOUR_HEIGHT" width="YOUR_WIDTH"></embed>
    the extra addition is the wmode="transparent" part that makes your flash object go to the bottom layer of the browser's render ;)

    If you dont use flash then obviously you dont have to make any flash-tweaking :P



    Credits for the layout and graphics:
    Laseen @ ragezone,
    mail: Caveman_gr@yahoo_REMOVETHIS.com

    Credits for code as referred in the votebox.js:
    * Popup Box- By Jim Silver @ jimsilver47@yahoo.com
    * Visit Dynamic Drive DHTML(dynamic html) & JavaScript code library for full source code
    * This notice must stay intact for use
    Last edited by Laseen; 22-08-07 at 02:03 PM.


  2. #2
    Account Upgraded | Title Enabled! LoveGod18 is offline
    MemberRank
    Nov 2006 Join Date
    658Posts

    Re: [Guide] Voting javascript popup for website

    doesnt work for me

  3. #3
    Apprentice Laseen is offline
    MemberRank
    Nov 2006 Join Date
    13Posts

    Re: [Guide] Voting javascript popup for website

    pffff.....:bomb:

    I attach a sample file with all necessary code.... use that!
    Attached Files Attached Files
    Last edited by Laseen; 22-08-07 at 02:01 PM.

  4. #4
    Account Upgraded | Title Enabled! hermes is offline
    MemberRank
    Jun 2006 Join Date
    0 125 125Location
    737Posts

    Re: [Guide] Voting javascript popup for website

    What comes for blablabla... ?

  5. #5
    Account Upgraded | Title Enabled! Lithic is offline
    MemberRank
    May 2007 Join Date
    588Posts

    Re: [Guide] Voting javascript popup for website

    Try not being such an asshole next time...


    It works, although PHP is still a better way to go. (and considering you didn't write the code you shouldn't be such an asshole about it)
    Can easily disallow js and this won't work.

  6. #6
    Account Upgraded | Title Enabled! hermes is offline
    MemberRank
    Jun 2006 Join Date
    0 125 125Location
    737Posts

    Re: [Guide] Voting javascript popup for website

    well, for me didnt worked :S

  7. #7
    Apprentice Laseen is offline
    MemberRank
    Nov 2006 Join Date
    13Posts

    Re: [Guide] Voting javascript popup for website

    blah blah blah= TITLE, meta,other scripts .... ;)

    smartass Lithic with PHP its *impossible* to do a floating iframe.

    Yes its javascript, but if you disable the javascript you will not be able to do other javascript tasks e.g. reseting your character using mutoolz. So, think twice before speaking.

    A way of blocking it, is adding the votebox.js to the blocked content of your browser. But its really so much easier to click the "X" button....

    hermes the .zip works fine. Unzip it in a folder and open the .html file! You should get a floating frame of digg.com :)

  8. #8
    Loss is a relative term. Silvers is offline
    MemberRank
    Sep 2006 Join Date
    RomaniaLocation
    685Posts

    Re: [Guide] Voting javascript popup for website

    for me works :rofl:

    /edit : i fixed it a little xD
    Attached Thumbnails Attached Thumbnails works.jpg  

  9. #9
    Account Upgraded | Title Enabled! LoveGod18 is offline
    MemberRank
    Nov 2006 Join Date
    658Posts

    Re: [Guide] Voting javascript popup for website

    Quote Originally Posted by Laseen View Post
    pffff.....:bomb:

    I attach a sample file with all necessary code.... use that!
    ok thx worked now-_- but u know what, you shouldnt start insulting ppl here because we're not all php coders, and you better go to physiatrist not me.

  10. #10
    Loss is a relative term. Silvers is offline
    MemberRank
    Sep 2006 Join Date
    RomaniaLocation
    685Posts

    Re: [Guide] Voting javascript popup for website

    this is js & html not php xD

  11. #11
    Apprentice Laseen is offline
    MemberRank
    Nov 2006 Join Date
    13Posts

    Re: [Guide] Voting javascript popup for website

    Quote Originally Posted by Trolly_G-M View Post
    ok thx worked now-_- but u know what, you shouldnt start insulting ppl here because we're not all php coders, and you better go to physiatrist not me.
    I visit one every Sunday. Do you need his address? ^_^
    And btw, I dont believe i insulted you.

    If someone should feel insulted is Lithic. :P


    @silvers: nice dude!!

  12. #12
    Account Upgraded | Title Enabled! Lithic is offline
    MemberRank
    May 2007 Join Date
    588Posts

    Re: [Guide] Voting javascript popup for website

    Quote Originally Posted by Laseen View Post
    blah blah blah= TITLE, meta,other scripts .... ;)

    smartass Lithic with PHP its *impossible* to do a floating iframe.

    Yes its javascript, but if you disable the javascript you will not be able to do other javascript tasks e.g. reseting your character using mutoolz. So, think twice before speaking.

    A way of blocking it, is adding the votebox.js to the blocked content of your browser. But its really so much easier to click the "X" button....

    hermes the .zip works fine. Unzip it in a folder and open the .html file! You should get a floating frame of digg.com :)

    Mmhm...
    Look around at other posts buddy, theres all kinds of PHP shit around here.
    If anyone actually uses this then they are going to be disappointed because a lot of people in foreign countries use programs like Peer Guardian or they have cookies and JS blocked.
    Not even worth the time to add it in if no one ever sees it now is it?
    And most servers are using SQL and PHP, not javascript. So maybe you should think twice before posting.

    Read the rules, no spamming other sites. Next time just show a blank box and not some gay ass site.


    Quote Originally Posted by Laseen View Post
    I visit one every Sunday. Do you need his address? ^_^
    And btw, I dont believe i insulted you.

    If someone should feel insulted is Lithic. :P


    @silvers: nice dude!!

    Why would I be insulted by a dumbass n00b?
    Hmm....
    Yea I'm not.

  13. #13
    Apprentice Laseen is offline
    MemberRank
    Nov 2006 Join Date
    13Posts

    Re: [Guide] Voting javascript popup for website

    You are retarted. And lack programming knowledge. Actually i believe you know a shit about programming. Its pointless to keep talking.

  14. #14
    I'll take you all on. Liselotte is offline
    MemberRank
    May 2004 Join Date
    Sector 7Location
    5,800Posts

    Re: [Guide] Voting javascript popup for website

    gezz, can you guys stop?

    anyway, thanks.

    to those ppl who paid for this kind of shit, YOU JUST WASTING YOUR MONEY.

  15. #15
    Account Upgraded | Title Enabled! Lithic is offline
    MemberRank
    May 2007 Join Date
    588Posts

    Re: [Guide] Voting javascript popup for website

    Quote Originally Posted by Liselotte View Post
    gezz, can you guys stop?

    anyway, thanks.

    to those ppl who paid for this kind of shit, YOU JUST WASTING YOUR MONEY.
    Lmao they dont know how to use google....

  16. #16
    Account Upgraded | Title Enabled! <-LoRD-> is offline
    MemberRank
    Aug 2006 Join Date
    In Your Dream Baby !Location
    211Posts

    Re: [Guide] Voting javascript popup for website

    yep works perfect :P :D

    but i hate tittle "use fire fox" :D

    fire fox :'(

    Opera :)


  17. #17
    Account Upgraded | Title Enabled! RisingKing2010 is offline
    MemberRank
    Feb 2006 Join Date
    loc( 'RisingKing', 'USA' );Location
    1,362Posts

    Re: [Guide] Voting javascript popup for website

    ppl dont vote if u force em... unless they are idiots lol XD
    these scripts generally decrease server popularity...

  18. #18
    Spewing Logic Since 93 RapidBlue is offline
    MemberRank
    May 2007 Join Date
    The CityLocation
    700Posts

    Re: [Guide] Voting javascript popup for website

    yeh RK thats right but some times people don't vote for u at all witch sux xD anyway good job

  19. #19
    Valued Member sawiukas is offline
    MemberRank
    Oct 2006 Join Date
    LithuaniaLocation
    138Posts

    Re: [Guide] Voting javascript popup for website

    Not bad but i daresay its bater :)
    <SCRIPT language=JavaScript type=text/javascript>
    <!--
    var detStatus=confirm("Plz Vote !");
    if (detStatus)
    window.location = "http://mu.hopzone.net/vote.php?site=6161";
    else
    document.write("");

    //-->
    </SCRIPT>

  20. #20
    Banned leway21 is offline
    BannedRank
    Dec 2004 Join Date
    OregonLocation
    456Posts

    Re: [Guide] Voting javascript popup for website

    How do i make it so the links that you click on in the java window open in a new tab or window.

  21. #21
    Retired Old Man Shatter is offline
    MemberRank
    Jun 2008 Join Date
    NowhereLocation
    1,884Posts

    Re: [Guide] Voting javascript popup for website

    works! and yes, this is html, not php eh :scratch:

  22. #22
    Alpha Member john_d is offline
    MemberRank
    Feb 2004 Join Date
    PhilippinesLocation
    2,868Posts

    Re: [Guide] Voting javascript popup for website

    my box kicks ur box our of the water. ^^

    this js script is kinda outdated lol

  23. #23
    Valued Member starmu is offline
    MemberRank
    Jul 2008 Join Date
    NEW YORKLocation
    108Posts

    Re: [Guide] Voting javascript popup for website

    john.? release source? or new pop-BOX

  24. #24
    Alpha Member john_d is offline
    MemberRank
    Feb 2004 Join Date
    PhilippinesLocation
    2,868Posts

    Re: [Guide] Voting javascript popup for website

    ill make something later ^^

  25. #25
    Novice lynns is offline
    MemberRank
    Jan 2009 Join Date
    4Posts

    Re: [Guide] Voting javascript popup for website

    doesn't work for my web...


    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\xampp\htdocs\index.php:1) in C:\xampp\htdocs\index.php on line 2

    Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\index.php:1) in C:\xampp\htdocs\index.php on line 4



Page 1 of 2 12 LastLast

Advertisement