• Questions That Don't Need Their Own Thread v3
    4,068 replies, posted
  • Avatar of Jelly
  • [TABLE="width: 0, align: center"][TR][TD][IMG]http://i.imgur.com/hDPDN.png[/IMG][/TD][/TR][/TABLE] Welcome to the Web Development's section very own [B]QTDNTOT[/B] 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. ▬ [B]Don't be a jerk.[/B] [B]Previous versions:[/B] ▬ [URL="http://www.facepunch.com/showthread.php?t=938504"]Version 2[/URL] ▬ [URL="http://www.google.com/"]Version 1 - MIA[/URL]
  • Avatar of commander204
  • 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.
  • Avatar of Crhem van der B
  • C'mon man.. There's more than enough slideshows available in the net: [url]https://www.google.com/search?sourceid=chrome&ie=UTF-8&q=jquery+slideshow[/url]
  • Avatar of lkymky
  • 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?
  • Avatar of commander204
  • [QUOTE=Crhem van der B;34012523]C'mon man.. There's more than enough slideshows available in the net: [url]https://www.google.com/search?sourceid=chrome&ie=UTF-8&q=jquery+slideshow[/url][/QUOTE] I know that, but I did not ask for any but for one that you would recommend.
  • Avatar of Alcapwne
  • jquery nivo Slider is great - the default theme is really classy and you can customise everything fairly easily
  • This is secure, right? [php] 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 - [/php] (I don't need an advanced system, I know how to make that)
  • Avatar of zzlawlzz
  • [QUOTE=Darkwater124;34015586]This is secure, right? [php] 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 - [/php] (I don't need an advanced system, I know how to make that)[/QUOTE] why not just make the 'somepass' into a variable.
  • Avatar of Murkrow
  • 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?
  • [QUOTE=zzlawlzz;34018769]why not just make the 'somepass' into a variable.[/QUOTE] True, doing that now. [editline]3rd January 2012[/editline] See the bottom of [URL="http://www.novaember.com/"]this[/URL] 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 [B]always[/B] 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) } [/code] [editline]3rd January 2012[/editline] On a side-note, awesome, figured out how the automerge worked!
  • Avatar of Sprite
  • 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?
  • [QUOTE=Sprite;34021587]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?[/QUOTE] Change date/time of post of the project?
  • [QUOTE=Darkwater124;34019479]True, doing that now. [editline]3rd January 2012[/editline] See the bottom of [URL="http://www.novaember.com/"]this[/URL] 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 [B]always[/B] thinks the login div is visible, even if it's hidden. Any ideas on how to fix this? [code] -codesnip- [/code] [editline]3rd January 2012[/editline] On a side-note, awesome, figured out how the automerge worked![/QUOTE] [code] $("#container").height($(document.body).height() - $("#not").outerHeight() - $("#header").outerHeight() - $("#smenu").outerHeight() - $("#footer").outerHeight() - ($("footer#login").is(':visible')&&$("footer#login").outerHeight()) - 20)[/code] Try this. Edit: Corrected, you have two elements with the ID of "login".
  • [QUOTE=deadeye536;34027220][code] $("#container").height($(document.body).height() - $("#not").outerHeight() - $("#header").outerHeight() - $("#smenu").outerHeight() - $("#footer").outerHeight() - ($("footer#login").is(':visible')&&$("footer#login").outerHeight()) - 20)[/code] Try this. Edit: Corrected, you have two elements with the ID of "login".[/QUOTE] Still doesn't work, but I can try something like this. [editline]3rd January 2012[/editline] It actually did work, I didn't call onResize after sliding it down. Thanks, Alot!
  • Is there any way to copy the text a user has selected to the clipboard [B]without[/B] using Flash?
  • Avatar of Alcapwne
  • how do I set the height of a div to be a percentage of the screen height? It doesn't seem to work :(
  • [QUOTE=Alcapwne;34033672]how do I set the height of a div to be a percentage of the screen height? It doesn't seem to work :([/QUOTE] Put the div directly in the body and set the body and html padding and margin to 0
  • Avatar of zzlawlzz
  • [QUOTE=Alcapwne;34033672]how do I set the height of a div to be a percentage of the screen height? It doesn't seem to work :([/QUOTE] 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.
  • Avatar of Alcapwne
  • [QUOTE=Darkwater124;34033877]Put the div directly in the body and set the body and html padding and margin to 0[/QUOTE] not working :( [editline]3rd January 2012[/editline] [QUOTE=zzlawlzz;34034024]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.[/QUOTE] works now, thanks!
  • Avatar of Sprite
  • [QUOTE=R1Z3;34027061]Change date/time of post of the project?[/QUOTE] I think that is stored server side... yeah. nothing I can access Oh shit. you're right... i clicked edit post. thanks bro
  • Avatar of Xonax
  • 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.
  • Avatar of Sprite
  • fix it [code] lastPostTime = 520; function juiceTheMoose() { $.ajax({ url: "c.php?t="+lastPostTime, cache: false, success: function(html){ if (parseInt(html)>(0)) { $("#komarza").html("&#8226;"); } else { setTimeout("juiceTheMoose()",10000); } } }); } </script> <body onLoad="setTimeout("juiceTheMoose()",10000);"> [/code] 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 &#8226; character in the #komarza span or it doesn't. does anything stick out horribly wrong? seot: orEXC62OpgnHOHlMA5zZ [editline]3rd January 2012[/editline] In addition... ... ... This URL rewrite stuff is running circles around me I need [url]http://sekwet.k8r.us/partner.php[/url] to be accessible by going to [url]http://sekwet.k8r.us/partner[/url] I must be doing something wrong. [CODE]Options +FollowSymLinks RewriteEngine on RewriteRule partner partner.php?[/CODE]
  • [QUOTE=Xonax;34035130]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.[/QUOTE] If you know the basic basics, I can help you with any problems you get.
  • Avatar of ManningQB18
  • 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>[/code] 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; } [/code] 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: [URL]http://puu.sh/ckTS[/URL]
  • Avatar of Xonax
  • [QUOTE=Darkwater124;34035943]If you know the basic basics, I can help you with any problems you get.[/QUOTE] I don't remember the basics, but if you can help me with them and other stuff, that would be nice.
  • Avatar of zzlawlzz
  • [QUOTE=ManningQB18;34038103]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>[/code] 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; } [/code] 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: [URL]http://puu.sh/ckTS[/URL][/QUOTE] 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 [img]http://jung3o.com/i/Screenshot-2012-01-03_18.44.59.png[/img] [editline]4th January 2012[/editline] [QUOTE=Xonax;34038710]I don't remember the basics, but if you can help me with them and other stuff, that would be nice.[/QUOTE] then try reading tutorials like [url]http://htmldog.com[/url] to refresh your memory
  • [QUOTE=Xonax;34038710]I don't remember the basics, but if you can help me with them and other stuff, that would be nice.[/QUOTE] 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.)
  • Avatar of ManningQB18
  • [QUOTE=zzlawlzz;34039238]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 [img]http://jung3o.com/i/Screenshot-2012-01-03_18.44.59.png[/img] [/QUOTE] 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.
  • Avatar of zzlawlzz
  • [QUOTE=ManningQB18;34039528]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.[/QUOTE] do display:inline-block; to the <a> and give us a fully working code on [url]http://jsfiddle.net/[/url] on what you have.
  • Avatar of ManningQB18
  • [QUOTE=zzlawlzz;34040057]do display:inline-block; to the <a> and give us a fully working code on [url]http://jsfiddle.net/[/url] on what you have.[/QUOTE] [url]http://jsfiddle.net/6cknY/[/url] 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.