1. Post #1
    secretly a furry
    Jelly's Avatar
    April 2011
    2,023 Posts
    [TABLE="width: 0, align: center"][TR][TD][/TD][/TR][/TABLE]

    Welcome to the Web Development's section very own QTDNTOT thread.

    To keep things running smoothly (until our inevitable demise), please try to abide by these very simple rules:

    ▬ Don't be a jerk.
    ▬ Keep your hands inside the thread at all times.
    Don't be a jerk.

    Previous versions:

    Version 2
    Version 1 - MIA
    Reply With Quote Edit / Delete Windows 7 Australia Show Events Artistic Artistic x 3Programming King Programming King x 1 (list)

  2. Post #2
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    Reposting from the old thread:

    Does anyone have any suggestions for a free javascript static slideshow? I searched on the net but found nothing that would fit what I need. It would have it's own page and needs thumbnails.
    Reply With Quote Edit / Delete Windows 7 France Show Events Funny Funny x 1 (list)

  3. Post #3
    Gold Member
    Crhem van der B's Avatar
    January 2010
    1,691 Posts
    C'mon man.. There's more than enough slideshows available in the net:
    https://www.google.com/search?source...uery+slideshow
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 1 (list)

  4. Post #4
    lkymky's Avatar
    December 2007
    653 Posts
    Ever since jQuery happened it seems impossible to find javascripts that don't rely on the library; I'm guessing commander204 wants a simple javascript (no jquery) one though based upon the wording in the post. Right?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  5. Post #5
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    C'mon man.. There's more than enough slideshows available in the net:
    https://www.google.com/search?source...uery+slideshow
    I know that, but I did not ask for any but for one that you would recommend.
    Reply With Quote Edit / Delete Windows 7 France Show Events

  6. Post #6
    Gold Member
    Alcapwne's Avatar
    May 2010
    3,518 Posts
    jquery nivo Slider is great - the default theme is really classy and you can customise everything fairly easily
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Useful Useful x 2 (list)

  7. Post #7
    This is secure, right?
    	session_start()
    	if(@$_SESSION['pass'] == 'somepass') {
    		// Nothing to do, move on.
    	} elseif(@$_POST['pass'] == 'somepass') {
    		$_SESSION['pass'] = $_POST['pass'];
    	} else {
    		header("Location: /admin/mysql/?wrong"); // Gtfo.
    		exit();
    	}
    
    - Content -
    
    (I don't need an advanced system, I know how to make that)
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  8. Post #8
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    This is secure, right?
    	session_start()
    	if(@$_SESSION['pass'] == 'somepass') {
    		// Nothing to do, move on.
    	} elseif(@$_POST['pass'] == 'somepass') {
    		$_SESSION['pass'] = $_POST['pass'];
    	} else {
    		header("Location: /admin/mysql/?wrong"); // Gtfo.
    		exit();
    	}
    
    - Content -
    
    (I don't need an advanced system, I know how to make that)
    why not just make the 'somepass' into a variable.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Agree Agree x 2 (list)

  9. Post #9
    Gold Member
    Murkrow's Avatar
    April 2005
    4,883 Posts
    I'm making an account system and since I don't want to have an absolute mess, I'll use classes and PDO for database connections. But pretty much all classes will require database access. What's the best way to do this? Just use database connections as separate class and call it when doing stuff with the database, or just make it global and start a pdo session at start of the script and terminate at the end?

    I hate it when I pretty much find the answer right when writing a question. I guess a static function/class would work swell, along with a check if the database connection is established yet?


    And I had another question and I already forgot it. Great.

    EDIT: Oh right, second questions.


    I'll be handling sessions with the database for various reasons. What would be the best way to generate unique session IDs?
    Reply With Quote Edit / Delete Windows 7 Slovenia Show Events

  10. Post #10
    why not just make the 'somepass' into a variable.
    True, doing that now.

    Edited:

    See the bottom of this site and then click login.
    Now go to the top and click the (X) on the right.

    Dafuq?

    What shoud happen:


    I'm using jQuqery to give the container the appropiate height. It does so by taking the height of the body, then subtracting the height of the notification, header, menu, footer and login div.
    However, it always thinks the login div is visible, even if it's hidden.

    Any ideas on how to fix this?

    Code:
    $(function () {
        $("footer#login").hide()
    
        onResize()
        $(window).resize(onResize)
    
        $("header#not a img").click(function () {
            var timer = setInterval(onResize, 50)
            $("header#not").slideUp(500, function () {
                $(this).remove()
                clearInterval(timer)
                onResize()
            })
            return false
        })
        $("#login").click(function () {
            $("footer#login").slideDown()
            return false
        })
        $("html").contextmenu(function (){
            $("html")
                .css("-webkit-transform", "rotate(180deg)")
            $("#container")
                .text("Don't mess with my site, bro.")
                .css("-webkit-transform", "rotate(180deg)")
            return false
        })
    })
    function onResize() {
        $("div#container").height($(document.body).height() -
            $("header#not").outerHeight() -
            $("header#header").outerHeight() -
            $("nav#smenu").outerHeight() -
            $("footer#footer").outerHeight() -
            $("footer#login").outerHeight() -
            20)
    }
    Edited:

    On a side-note, awesome, figured out how the automerge worked!
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  11. Post #11
    Sprite's Avatar
    October 2011
    294 Posts
    using tumblr as a progress blog. I want to list my projects on the /projects page, but i don't want them chronologically ordered...
    is there a way to change the order the posts appear?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  12. Post #12
    R1Z3's Avatar
    December 2009
    335 Posts
    using tumblr as a progress blog. I want to list my projects on the /projects page, but i don't want them chronologically ordered...
    is there a way to change the order the posts appear?
    Change date/time of post of the project?
    Reply With Quote Edit / Delete Mac United States Show Events

  13. Post #13
    Gold Member
    deadeye536's Avatar
    February 2008
    1,541 Posts
    True, doing that now.

    Edited:

    See the bottom of this site and then click login.
    Now go to the top and click the (X) on the right.

    Dafuq?

    What shoud happen:


    I'm using jQuqery to give the container the appropiate height. It does so by taking the height of the body, then subtracting the height of the notification, header, menu, footer and login div.
    However, it always thinks the login div is visible, even if it's hidden.

    Any ideas on how to fix this?

    Code:
    -codesnip-
    Edited:

    On a side-note, awesome, figured out how the automerge worked!
    Code:
        $("#container").height($(document.body).height() -
            $("#not").outerHeight() -
            $("#header").outerHeight() -
            $("#smenu").outerHeight() -
            $("#footer").outerHeight() -
            ($("footer#login").is(':visible')&&$("footer#login").outerHeight()) -
            20)
    Try this.

    Edit: Corrected, you have two elements with the ID of "login".
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  14. Post #14
    Code:
        $("#container").height($(document.body).height() -
            $("#not").outerHeight() -
            $("#header").outerHeight() -
            $("#smenu").outerHeight() -
            $("#footer").outerHeight() -
            ($("footer#login").is(':visible')&&$("footer#login").outerHeight()) -
            20)
    Try this.

    Edit: Corrected, you have two elements with the ID of "login".
    Still doesn't work, but I can try something like this.

    Edited:

    It actually did work, I didn't call onResize after sliding it down. Thanks, Alot!
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  15. Post #15
    Is there any way to copy the text a user has selected to the clipboard without using Flash?
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  16. Post #16
    Gold Member
    Alcapwne's Avatar
    May 2010
    3,518 Posts
    how do I set the height of a div to be a percentage of the screen height? It doesn't seem to work :(
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  17. Post #17
    how do I set the height of a div to be a percentage of the screen height? It doesn't seem to work :(
    Put the div directly in the body and set the body and html padding and margin to 0
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events Dumb Dumb x 1Disagree Disagree x 1 (list)

  18. Post #18
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    how do I set the height of a div to be a percentage of the screen height? It doesn't seem to work :(
    make sure you have a min-height.
    also, make sure the height of html,body is 100% (min-height:100%;height:100%;)

    height:100% is for ie compatibility.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  19. Post #19
    Gold Member
    Alcapwne's Avatar
    May 2010
    3,518 Posts
    Put the div directly in the body and set the body and html padding and margin to 0
    not working :(

    Edited:

    make sure you have a min-height.
    also, make sure the height of html,body is 100% (min-height:100%;height:100%;)

    height:100% is for ie compatibility.
    works now, thanks!
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  20. Post #20
    Sprite's Avatar
    October 2011
    294 Posts
    Change date/time of post of the project?
    I think that is stored server side... yeah. nothing I can access
    Oh shit. you're right... i clicked edit post. thanks bro
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  21. Post #21
    Gold Member
    Xonax's Avatar
    October 2010
    5,121 Posts
    Is there someone who could help me with making my own site? If so, I will add you.
    I have made a site one time years ago, I just forgot how to.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  22. Post #22
    Sprite's Avatar
    October 2011
    294 Posts
    fix it
    Code:
    lastPostTime = 520;
    function juiceTheMoose()
    {
    $.ajax({
      url: "c.php?t="+lastPostTime,
      cache: false,
      success: function(html){
    	if (parseInt(html)>(0))
    		{
                     $("#komarza").html("•");
    		}
    	else
    		{
    		setTimeout("juiceTheMoose()",10000);
    		}
      }
    });
    }
    </script>
    
    <body  onLoad="setTimeout("juiceTheMoose()",10000);">
    I'm kidding.
    The issue I'm having is that it's not working.

    Let's assume that c.php will return a number from 00 to 99. Let's just assume that page works.

    Now let's look at the javascript & html.
    If I have this right. I should use the moose juicer after 10 seconds.
    it then makes an ajax call to "http://mysite.co/c.php?t=520"
    with it's result it then creates the • character in the #komarza span or it doesn't.

    does anything stick out horribly wrong?

    seot: orEXC62OpgnHOHlMA5zZ

    Edited:

    In addition... ... ...
    This URL rewrite stuff is running circles around me
    I need
    http://sekwet.k8r.us/partner.php
    to be accessible by going to
    http://sekwet.k8r.us/partner

    I must be doing something wrong.
    Code:
    Options +FollowSymLinks
    RewriteEngine on
    
    RewriteRule partner partner.php?
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  23. Post #23
    Is there someone who could help me with making my own site? If so, I will add you.
    I have made a site one time years ago, I just forgot how to.
    If you know the basic basics, I can help you with any problems you get.
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  24. Post #24
    Gold Member
    ManningQB18's Avatar
    April 2009
    9,855 Posts
    I have some buttons that I want to center, but the width element does fuck all for some reason.
    Structured like this
    Code:
    <div class="menubar">
        <a href="#"><div class="menuitem">Science</div></a>
        <a href="#"><div class="menuitem">Science</div></a>
        <a href="#"><div class="menuitem">Science</div></a>
        <a href="#"><div class="menuitem">Science</div></a>
    </div>
    And my CSS code is
    Code:
    .menubar{
    background-image: -webkit-linear-gradient(top, #4372AA, #104E8B);
    height: 30px;
    width: 100%;
    margin-top: 160px;
    position: absolute;
    }
    
    .menuitem{
    border-left: thin solid #104E8B;
    border-right: thin solid #104E8B;
    font-family: monospace;
    width: 25%;
    text-align: center;
    height: 30px;
    color: white;
    font-size: 26px;
    padding: 0px 5px;
    display: inline;
    }
    I want each menuitem button to take up 25% of the bar, but it doesn't obey for no visible reason.
    I also tried 24% and 23% to see if it was some sort of weird rounding error, but that didn't get it either.
    It looks like this in chrome: http://puu.sh/ckTS
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  25. Post #25
    Gold Member
    Xonax's Avatar
    October 2010
    5,121 Posts
    If you know the basic basics, I can help you with any problems you get.
    I don't remember the basics, but if you can help me with them and other stuff, that would be nice.
    Reply With Quote Edit / Delete Windows 7 Australia Show Events

  26. Post #26
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    I have some buttons that I want to center, but the width element does fuck all for some reason.
    Structured like this
    Code:
    <div class="menubar">
        <a href="#"><div class="menuitem">Science</div></a>
        <a href="#"><div class="menuitem">Science</div></a>
        <a href="#"><div class="menuitem">Science</div></a>
        <a href="#"><div class="menuitem">Science</div></a>
    </div>
    And my CSS code is
    Code:
    .menubar{
    background-image: -webkit-linear-gradient(top, #4372AA, #104E8B);
    height: 30px;
    width: 100%;
    margin-top: 160px;
    position: absolute;
    }
    
    .menuitem{
    border-left: thin solid #104E8B;
    border-right: thin solid #104E8B;
    font-family: monospace;
    width: 25%;
    text-align: center;
    height: 30px;
    color: white;
    font-size: 26px;
    padding: 0px 5px;
    display: inline;
    }
    I want each menuitem button to take up 25% of the bar, but it doesn't obey for no visible reason.
    I also tried 24% and 23% to see if it was some sort of weird rounding error, but that didn't get it either.
    It looks like this in chrome: http://puu.sh/ckTS
    find out how much each buttons takes up space by adding all the paddings and margins and border (the right and left) then (button px/max px)*100


    % dont work because you have padding and margins


    Edited:

    I don't remember the basics, but if you can help me with them and other stuff, that would be nice.
    then try reading tutorials like http://htmldog.com to refresh your memory
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  27. Post #27
    I don't remember the basics, but if you can help me with them and other stuff, that would be nice.
    Okay, but I just saw a problem... You live in Australia, right? I'm from the Netherlands so the timezones may be a problem.. You can add me, anyway. (Profile can be found under my avatar.)
    Reply With Quote Edit / Delete Netherlands Show Events

  28. Post #28
    Gold Member
    ManningQB18's Avatar
    April 2009
    9,855 Posts
    find out how much each buttons takes up space by adding all the paddings and margins and border (the right and left) then (button px/max px)*100


    % dont work because you have padding and margins
    Doesn't work, the width tag does nothing to the menuitem under any circumstance. I also checked to see if there were any inherited traits causing it, but no.
    Playing around some more, it appears that removing display: inline fixes the width problem, but then it's in block form, which has obvious problems.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  29. Post #29
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    Doesn't work, the width tag does nothing to the menuitem under any circumstance. I also checked to see if there were any inherited traits causing it, but no.
    Playing around some more, it appears that removing display: inline fixes the width problem, but then it's in block form, which has obvious problems.
    do display:inline-block; to the <a>

    and give us a fully working code on http://jsfiddle.net/ on what you have.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  30. Post #30
    Gold Member
    ManningQB18's Avatar
    April 2009
    9,855 Posts
    do display:inline-block; to the <a>

    and give us a fully working code on http://jsfiddle.net/ on what you have.
    http://jsfiddle.net/6cknY/
    Unfortunately, I'm optimizing only for webkit browsers right now because I'm still learning, so Firefox and Opera will have to open Chrome or Safari

    Images aren't necessary.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  31. Post #31
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    you dont need that extra span. <a> also uses display:inline;
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  32. Post #32
    Gold Member
    ManningQB18's Avatar
    April 2009
    9,855 Posts
    you dont need that extra span. <a> also uses display:inline;
    I switched it, but the width tag is still not working
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  33. Post #33
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    i know that wasnt suppose to help but it's something that you should know.

    Edited:

    http://jsfiddle.net/zzlawlzz/6cknY/3/

    the % is based on window size and the borders mess that up. so it's going to be like 24% with a lot of decimal numbers. I suggest deleting borders.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  34. Post #34
    Gold Member
    ManningQB18's Avatar
    April 2009
    9,855 Posts
    i know that wasnt suppose to help but it's something that you should know.

    Edited:

    http://jsfiddle.net/zzlawlzz/6cknY/3/

    the % is based on window size and the borders mess that up. so it's going to be like 24% with a lot of decimal numbers. I suggest deleting borders.
    I'll do that, I tried removing all borders and such earlier, but I must have screwed something up. Thank you for all of your help.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #35
    italian
    TerabyteS_'s Avatar
    June 2011
    2,645 Posts
    Is it possible to make a css3 gradient repeat instead of stretching out to fill the entire width/height of the container?
    Reply With Quote Edit / Delete Windows 7 Anonymous Proxy Show Events

  36. Post #36
    Is it possible to make a css3 gradient repeat instead of stretching out to fill the entire width/height of the container?
    AFAIK, CSS sees a gradient as an image, so I think that would be possible, yes.
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  37. Post #37
    zzlawlzz's Avatar
    July 2010
    1,750 Posts
    how would I make a "container" for http://jung3o.com/asd/ so it stays up?

    Edited:

    Oh and this isn't mine I'm just making it for someone.
    Reply With Quote Edit / Delete Windows XP United States Show Events

  38. Post #38
    how would I make a "container" for http://jung3o.com/asd/ so it stays up?

    Edited:

    Oh and this isn't mine I'm just making it for someone.
    Up?

    Edited:

    Once again, can anyone tell me how to copy something using Javascript? I'm so desperate that Flash is okay too o_o
    Reply With Quote Edit / Delete Windows 8 Netherlands Show Events

  39. Post #39
    Gold Member
    Murkrow's Avatar
    April 2005
    4,883 Posts
    Is there a way to implement php timezones (and with that dst) using a selection that isn't just a massive list of cities not sorted in any order whatsoever?

    Preferably in a way that doesn't make me want to go kill myself

    EDIT: Nevermind, I ended up just using this: http://www.ultramegatech.com/blog/20...-zones-in-php/
    Reply With Quote Edit / Delete Windows 7 Slovenia Show Events

  40. Post #40
    lkymky's Avatar
    December 2007
    653 Posts
    is there a way to get a single portion of a webpage to update live smoothly without full page reloading with JavaScript?
    Reply With Quote Edit / Delete Windows 7 United States Show Events