• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=gokiyono;40242234]Could anyone tell me how (if it is possible) to connect two divs so the colours will folow each other? [IMG]http://i.imgur.com/ERzfgIO.png[/IMG] (Just to demonstrate what I didn't want.)[/QUOTE] Do you mean that you want to get rid of that black background? You can do this: [CODE] div1, div2 { background: stuff_you_want_to_be_background; // This will apply to both div elements } [/CODE] Or [CODE] div2 { background-color:rgba(0,0,0,0); //makes the black background completely see-through; } [/CODE]
[QUOTE=Worre;40242875]Do you mean that you want to get rid of that black background? You can do this: [CODE] div1, div2 { background: stuff_you_want_to_be_background; // This will apply to both div elements } [/CODE] Or [CODE] div2 { background-color:rgba(0,0,0,0); //makes the black background completely see-through; } [/CODE][/QUOTE] I wanted to have the black and the white follow each other
[QUOTE=eternalflamez;40219082]This seems fine but you forgot one thing: [code] $('.desc-box').mouseover(function( e ) { e.preventDefault(); slideshow.pause(); clearTimeout(); }); $('.desc-box').mouseleave(function( e ) { e.preventDefault(); setTimeout(function () { slideshow.resume(); }, 3000); }); [/code] Setting the timeout on the resuming. You clear it but you never set it. Instead your piece of code would probably just do it instantaneously, right? Anyway if you use the code above it should work.[/QUOTE] Yeah, copied a wrong version before. Its working now partially. I want to reset the slideshow.resume() event when i hover over the div again. If i keep hovering over the div again and again the event is triggered several times, but i only want it only one time.
[QUOTE=Worre;40242875]Do you mean that you want to get rid of that black background? You can do this: [CODE] div1, div2 { background: stuff_you_want_to_be_background; // This will apply to both div elements } [/CODE] Or [CODE] div2 { background-color:rgba(0,0,0,0); //makes the black background completely see-through; } [/CODE][/QUOTE] Or just [css]div { background-color: transparent; }[/css] [editline]11th April 2013[/editline] [QUOTE=gokiyono;40243041]I wanted to have the black and the white follow each other[/QUOTE] I do not understand what you are trying to do
[QUOTE=jung3o;40243232]Or just [css]div { background-color: transparent; }[/css] [editline]11th April 2013[/editline] I do not understand what you are trying to do[/QUOTE] Hm... Why haven't I though about background-color:transparent before... I don't understand what he wants either.
[QUOTE=MarcoPixel;40243171]Yeah, copied a wrong version before. Its working now partially. I want to reset the slideshow.resume() event when i hover over the div again. If i keep hovering over the div again and again the event is triggered several times, but i only want it only one time.[/QUOTE] Oh right didn't notice the event names. Instead of [URL="http://api.jquery.com/mouseover/"]mouseover[/URL] you could use [URL="http://api.jquery.com/mouseenter/"]mouseenter[/URL]. It's as simple as replacing the word mouseover with mouseenter.
[QUOTE=jung3o;40243232]Or just [css]div { background-color: transparent; }[/css] [editline]11th April 2013[/editline] I do not understand what you are trying to do[/QUOTE] Have the top and bottom of the black box follow the top and bottom of the white one. (Make a black line that spans from top to bottom with text in.)
[QUOTE=gokiyono;40244404]Have the top and bottom of the black box follow the top and bottom of the white one. (Make a black line that spans from top to bottom with text in.)[/QUOTE] can you remake that in jsfiddle? then we might be able to help you since we don't know how ur code looks.
[QUOTE=jung3o;40244430]can you remake that in jsfiddle? then we might be able to help you since we don't know how ur code looks.[/QUOTE] [URL="http://jsfiddle.net/zgd22/2/"]Here[/URL]
Ooh, so basically you want the div with the days in it to be as large as the container? :v: [editline]11th April 2013[/editline] #nav { background-color:black; width:60px; margin-left:50px; height:100%; } Get that for a #nav, done.
[QUOTE=eternalflamez;40244858]Ooh, so basically you want the div with the days in it to be as large as the container? :v: [editline]11th April 2013[/editline] #nav { background-color:black; width:60px; margin-left:50px; height:100%; } Get that for a #nav, done.[/QUOTE] Exactly. [URL="http://jsfiddle.net/gokiyono/zgd22/5/"]Just one problem[/URL]. I tried both that and auto.
[CODE] #wrap{ background-color: rgba(255,255,255,0.6); width: 1000px; min-height: 100px; border-radius: 10px; position: relative; } #nav{ background-color: black; width: 60px; margin-left: 50px; position: absolute; height: 100%; top: 0; } [/CODE] Edit: added top: 0; to #nav to allow resizing.
[QUOTE=CBastard;40245593][CODE] #wrap{ background-color: rgba(255,255,255,0.6); width: 1000px; min-height: 100px; border-radius: 10px; position: relative; } #nav{ background-color: black; width: 60px; margin-left: 50px; position: absolute; height: 100%; } [/CODE][/QUOTE] You are an amazing person!
Why are the ratings returned by the facepun.ch API out of date?
[QUOTE=James xX;40247463]Why are the ratings returned by the facepun.ch API out of date?[/QUOTE] Because the guy who made the API doesn't work on it anymore.
[QUOTE=asantos3;40247552]Because the guy who made the API doesn't work on it anymore.[/QUOTE] Is there an alternative I can use?
On a garry's mod loading screen, how do I grab someones profile picture and user name? I have used [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexb59e.html"]this[/URL] to get the SteamID and Community ID.
[QUOTE=smithy285;40252813]On a garry's mod loading screen, how do I grab someones profile picture and user name? I have used [URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexb59e.html"]this[/URL] to get the SteamID and Community ID.[/QUOTE] [CODE]//Get the Steam Community ID from provided URL $communityid = $_GET["steamid"]; //Get response from the Steam API in json format $response = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=<insert you key here>&steamids=' . $communityid . '&format=json'); //Decode the json response $json = json_decode($response, true); //Get your player's username $nick = $json['response']['players']['0']['personaname']; //Get the URL of your player's avatar //You have 3 options here, avatar returns a 32x32 image, avatarmedium returns a 64x64 image, and avatarfull returns a 184x184 image $avatar = $json['response']['players']['0']['avatar']; $avatarmedium = $json['response']['players']['0']['avatarmedium']; $avatarfull = $json['response']['players']['0']['avatarfull'];[/CODE] [url]https://developer.valvesoftware.com/wiki/Steam_Web_API[/url]
[del]Best domain name registrar?[/del] Fuck it, used Gandi before and they have a sale on .me domains Any recommendations for web servers for linux? (PHP, not ruby or all that fancy stuff). Apache is easy, but I heard nginx is better, but is it more effort?
[QUOTE=Cep.;40254261][CODE]//Get the Steam Community ID from provided URL $communityid = $_GET["steamid"]; //Get response from the Steam API in json format $response = file_get_contents('http://api.steampowered.com/ISteamUser/GetPlayerSummaries/v0002/?key=<insert you key here>&steamids=' . $communityid . '&format=json'); //Decode the json response $json = json_decode($response, true); //Get your player's username $nick = $json['response']['players']['0']['personaname']; //Get the URL of your player's avatar //You have 3 options here, avatar returns a 32x32 image, avatarmedium returns a 64x64 image, and avatarfull returns a 184x184 image $avatar = $json['response']['players']['0']['avatar']; $avatarmedium = $json['response']['players']['0']['avatarmedium']; $avatarfull = $json['response']['players']['0']['avatarfull'];[/CODE] [url]https://developer.valvesoftware.com/wiki/Steam_Web_API[/url][/QUOTE] Instead of using file_get_contents you should be using [code] function get_data($url) { $ch = curl_init(); $timeout = 5; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $data = curl_exec($ch); curl_close($ch); return $data; } [/code] Sure it's more code but the few extra bytes it takes up has the tradeoff of making the entire process about 3-4X faster.
[QUOTE=01271;40256870] Sure it's more code but the [B][I]few extra [U]bytes[/U][/I][/B] it takes up has the tradeoff of making the entire process about 3-4X faster.[/QUOTE] DANG IT man, I just needed those 5kilobytes, I ran out of data bro [sp]It's not even that much, why even mention it?[/sp]
[QUOTE=Killervalon;40257171]DANG IT man, I just needed those 5kilobytes, I ran out of data bro [sp]It's not even that much, why even mention it?[/sp][/QUOTE] I don't know. Sometimes I don't like using code because it's longer than the function it's supposed to help. Kind of like why I don't want to include the entire jquery library just for one function. I AM SOMEWHAT SILLY THAT WAY.
[QUOTE=01271;40257499]I don't know. Sometimes I don't like using code because it's longer than the function it's supposed to help. Kind of like why I don't want to include the entire jquery library just for one function. I AM SOMEWHAT SILLY THAT WAY.[/QUOTE] Now, I can partly understand that. But 11 short lines of code?
How does this work? I have a CSS navigation (not using a list). [code] #navigation { background-image:url('img/nav_bg.png'); background-repeat:repeat-x; height:20px; margin:3px auto 3px auto; padding:8px 10px 5px 10px; font-size:12px; } #navigation a { text-shadow:0 1px 0 #1a1a1a; margin-right:5px; font-weight:bold; padding:8px 10px 10px 10px; border-radius:5px; -moz-border-radius:5px; -webkit-border-radius:5px; } #navigation #login { float: right; padding:0px 0px 0px 0px; } [/code] HTML: [code] <div id="navigation" class="round"> <a href="index.php">Home</a> <a href="/forums/?redirect=no">Forums</a> <a href="tutorials">Tutorials</a> <a href="projects">Projects</a> <a href="about">About</a> <a href="login" id="login">Login</a> </div> [/code] I wanted to move the login 'button' all the way to the right, which I got to work. By giving the login link an id. (#navigation #login) How exactly is this working? Is login 'deriving' from navigation? I got this to work by trial and error. I also had to set the padding to 0 0 0 0 to align it properly. Again, not sure why. I'm new to CSS.
Try if adding [B][I]display: inline-block;[/I][/B] to [B][I]#navigation a[/I][/B] and removing [B][I]padding:0px 0px 0px 0px;[/I][/B] helps. [editline]12th April 2013[/editline] Also, remove the padding property from [B][I]#navigation a[/I][/B] and [B][I]#navigation #login[/I][/B] [editline]12th April 2013[/editline] [URL="http://jsfiddle.net/A84kY/1/"]http://jsfiddle.net/A84kY/2/[/URL] [editline]12th April 2013[/editline] Removing the horizontal padding is not necessary, only the vertical padding.
OK so I am very confused right now. I developed this entire website with PHP using WAMP. Now I'm uploading it to my server and getting all sorts of very, very fucked up errors. For example, I have one form where I use a $_GET variable to decide which form to display. I can load the original page, but as soon as I reload the page with the $_GET in there, it causes a 403 Forbidden. My PDO queries are totally fucked too for some reason. When the page reloads, all of my queries simply won't go. Nothing is working and I'm so fucking confused and frustrated. Does anyone know a simple reason why PDO queries would fuck so hard with my code and functionality? In WAMP, everything worked perfectly. But now my server is fucking with this shit. I apologize for the bad language, I'm just pissed right now. As an example, this portion of code is causing a 403 Forbidden error for some fucking reason AND if I leave the form blank, when the sticky form loads, the client names query doesn't run and I end up with a blank selection drop-down: [PHP] <?php if ($_GET['a'] == '1') { /** Add Work **/ if(isset($_POST['clientName']) && $_POST['clientName'] != "") { if (countRows('clients', 'clientID', $_POST['clientName']) > 0) { $cid = $_POST['clientName'];}else{$error[6] = "The client selected does not appear to exist within the database"; } } else { $error[0] = "Please select the client for which this work is to be added to"; } if (isset($_POST['title']) && $_POST['title'] != "Film Title"){$title = strip_tags($_POST['title']);}else{$error[1] = "Film title is required";} if (isset($_POST['genre']) && $_POST['genre'] != "Genre"){$genre = strip_tags($_POST['genre']);}else{$error[2] = "Film genre is required";} if (isset($_POST['runtime']) && $_POST['runtime'] != "Runtime"){$runtime = $_POST['runtime'];}else{$error[3] = "Film runtime is required";} if (isset($_POST['desc']) && $_POST['desc'] != "Description (1500 Characters Max)"){$desc = strip_tags($_POST['desc']);}else{$error[4] = "Film description is required";} if (isset($_POST['preview']) && $_POST['preview'] != "Link to Preview"){$preview = strip_tags($_POST['preview']);}else{$error[5] = "Film preview is required";} /** After everything has been checked and validated **/ if (isset($cid) && isset($title) && isset($genre) && isset($runtime) && isset($desc) && isset($preview)) { $workSQL = $db->prepare("INSERT INTO portfolio (clientID, title, genre, runtime, preview, description) VALUES (:clientID, :title, :genre, :runtime, :preview, :description)"); $workSQL->bindParam(':clientID', $cid, PDO::PARAM_INT, 5);$workSQL->bindParam(':title', $title, PDO::PARAM_STR, 50);$workSQL->bindParam(':genre', $genre, PDO::PARAM_STR); $workSQL->bindParam(':runtime', $runtime, PDO::PARAM_STR, 25);$workSQL->bindParam(':preview', $preview, PDO::PARAM_STR, 100);$workSQL->bindParam(':description', $desc, PDO::PARAM_STR, 1500); if ($workSQL->execute()) { echo("Successfully submitted this film to the portfolio!"); } else { echo("There was an error submitting this film to the portfolio, please try again"); } } else { if (isset($error)) { foreach($error as $printed) { echo($printed . "<br />"); } ?> <!---------------- STICKY FORM ---------------------> <form name = "addClient" method = "POST" action = "addWork.php?a=1"> <select id = "clientName" name = "clientName"> <option value = "">Select Client</option> <?php $clientsSQL = $db->prepare("SELECT * FROM clients"); $clientsSQL->execute(); foreach ($clientsSQL as $client) { if (isset($_POST['clientName'])){if ($_POST['clientName'] == $client['clientID']) { echo("<option value = " . $client['clientID'] . " selected>" . stripslashes($client['name']) . "</option>"); } else { echo("<option value = " . $client['clientID'] . ">" . stripslashes($client['name']) . "</option>"); } } } ?> </select> <div id = "info"> <input type = "text" name = "title" id = "title" value = "<?php if (isset($_POST['title'])) { echo($_POST['title']); } else { echo("Film Title"); } ?>" size = "50"onfocus = "if (this.value=='Film Title') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Film Title' || this.value=='') { this.style.color='#9E9898'; this.value='Film Title'}" /> <br /> <input type = "text" name = "genre" id = "genre" value = "<?php if (isset($_POST['genre'])) { echo($_POST['genre']); } else { echo("Genre"); } ?>" size = "20"onfocus = "if (this.value=='Genre') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Genre' || this.value=='') { this.style.color='#9E9898'; this.value='Genre'}" /> <input type = "text" name = "runtime" id = "runtime" value = "<?php if (isset($_POST['runtime'])) { echo($_POST['runtime']); } else { echo("Runtime"); } ?>" size = "10"onfocus = "if (this.value=='Runtime') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Runtime' || this.value=='') { this.style.color='#9E9898'; this.value='Runtime'}" /> </div> <!-- /info --> <span class = "countdown"></span> <textarea name = "desc" id = "desc" rows = "10" class = "desc" cols = "70"onfocus = "if (this.value=='Description (1500 Characters Max)') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Description (1500 Characters Max)' || this.value=='') { this.style.color='#9E9898'; this.value='Description (1500 Characters Max)'}"><?php if (isset($_POST['desc'])) { echo($_POST['desc']); } else { echo("Description (1500 Characters Max)"); } ?></textarea> <input type = "text" name = "preview" id = "preview" value = "<?php if (isset($_POST['preview'])) { echo($_POST['preview']); } else { echo("Link to Preview"); } ?>" size = "50"onfocus = "if (this.value=='Link to Preview') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Link to Preview' || this.value=='') { this.style.color='#9E9898'; this.value='Link to Preview'}" /> <input type = "submit" id = "submit" value = "Add to Portfolio" /> </form> <?php } } } ?> [/PHP] Any help would be greatly appreciated. Thanks!
[QUOTE=Poo Monst3r;40259326]OK so I am very confused right now. I developed this entire website with PHP using WAMP. Now I'm uploading it to my server and getting all sorts of very, very fucked up errors. For example, I have one form where I use a $_GET variable to decide which form to display. I can load the original page, but as soon as I reload the page with the $_GET in there, it causes a 403 Forbidden. My PDO queries are totally fucked too for some reason. When the page reloads, all of my queries simply won't go. Nothing is working and I'm so fucking confused and frustrated. Does anyone know a simple reason why PDO queries would fuck so hard with my code and functionality? In WAMP, everything worked perfectly. But now my server is fucking with this shit. I apologize for the bad language, I'm just pissed right now. As an example, this portion of code is causing a 403 Forbidden error for some fucking reason: [PHP]if ($_GET['a'] == '1'){/** Add Work **/ if(isset($_POST['clientName']) && $_POST['clientName'] != ""){if (countRows('clients', 'clientID', $_POST['clientName']) > 0){$cid = $_POST['clientName'];}else{$error[6] = "The client selected does not appear to exist within the database";}}else{$error[0] = "Please select the client for which this work is to be added to";} if (isset($_POST['title']) && $_POST['title'] != "Film Title"){$title = strip_tags($_POST['title']);}else{$error[1] = "Film title is required";} if (isset($_POST['genre']) && $_POST['genre'] != "Genre"){$genre = strip_tags($_POST['genre']);}else{$error[2] = "Film genre is required";} if (isset($_POST['runtime']) && $_POST['runtime'] != "Runtime"){$runtime = $_POST['runtime'];}else{$error[3] = "Film runtime is required";} if (isset($_POST['desc']) && $_POST['desc'] != "Description (1500 Characters Max)"){$desc = strip_tags($_POST['desc']);}else{$error[4] = "Film description is required";} if (isset($_POST['preview']) && $_POST['preview'] != "Link to Preview"){$preview = strip_tags($_POST['preview']);}else{$error[5] = "Film preview is required";} /** After everything has been checked and validated **/if (isset($cid) && isset($title) && isset($genre) && isset($runtime) && isset($desc) && isset($preview)){$workSQL = $db->prepare("INSERT INTO portfolio (clientID, title, genre, runtime, preview, description) VALUES (:clientID, :title, :genre, :runtime, :preview, :description)");$workSQL->bindParam(':clientID', $cid, PDO::PARAM_INT, 5);$workSQL->bindParam(':title', $title, PDO::PARAM_STR, 50);$workSQL->bindParam(':genre', $genre, PDO::PARAM_STR);$workSQL->bindParam(':runtime', $runtime, PDO::PARAM_STR, 25);$workSQL->bindParam(':preview', $preview, PDO::PARAM_STR, 100);$workSQL->bindParam(':description', $desc, PDO::PARAM_STR, 1500); if ($workSQL->execute()){echo("Successfully submitted this film to the portfolio!");}else{echo("There was an error submitting this film to the portfolio, please try again");} }else{if (isset($error)){foreach($error as $printed){echo($printed . "<br />");}?><!---------------- STICKY FORM ---------------------><form name = "addClient" method = "POST" action = "addWork.php?a=1"> <select id = "clientName" name = "clientName"><option value = "">Select Client</option><?php$clientsSQL = $db->prepare("SELECT * FROM clients");$clientsSQL->execute();foreach ($clientsSQL as $client){if (isset($_POST['clientName'])){if ($_POST['clientName'] == $client['clientID']){echo("<option value = " . $client['clientID'] . " selected>" . stripslashes($client['name']) . "</option>");}else{echo("<option value = " . $client['clientID'] . ">" . stripslashes($client['name']) . "</option>");}}}?></select> <div id = "info"> <input type = "text" name = "title" id = "title" value = "<?php if (isset($_POST['title'])) { echo($_POST['title']); } else { echo("Film Title"); } ?>" size = "50"onfocus = "if (this.value=='Film Title') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Film Title' || this.value=='') { this.style.color='#9E9898'; this.value='Film Title'}" /> <br /> <input type = "text" name = "genre" id = "genre" value = "<?php if (isset($_POST['genre'])) { echo($_POST['genre']); } else { echo("Genre"); } ?>" size = "20"onfocus = "if (this.value=='Genre') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Genre' || this.value=='') { this.style.color='#9E9898'; this.value='Genre'}" /> <input type = "text" name = "runtime" id = "runtime" value = "<?php if (isset($_POST['runtime'])) { echo($_POST['runtime']); } else { echo("Runtime"); } ?>" size = "10"onfocus = "if (this.value=='Runtime') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Runtime' || this.value=='') { this.style.color='#9E9898'; this.value='Runtime'}" /> </div> <!-- /info --> <span class = "countdown"></span><textarea name = "desc" id = "desc" rows = "10" class = "desc" cols = "70"onfocus = "if (this.value=='Description (1500 Characters Max)') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Description (1500 Characters Max)' || this.value=='') { this.style.color='#9E9898'; this.value='Description (1500 Characters Max)'}"><?php if (isset($_POST['desc'])) { echo($_POST['desc']); } else { echo("Description (1500 Characters Max)"); } ?></textarea> <input type = "text" name = "preview" id = "preview" value = "<?php if (isset($_POST['preview'])) { echo($_POST['preview']); } else { echo("Link to Preview"); } ?>" size = "50"onfocus = "if (this.value=='Link to Preview') { this.value=''; this.style.color='#000'; }" onblur = "if (this.value=='Link to Preview' || this.value=='') { this.style.color='#9E9898'; this.value='Link to Preview'}" /> <input type = "submit" id = "submit" value = "Add to Portfolio" /> </form><?php}} }[/PHP][/QUOTE] indentation pls. :suicide:
[QUOTE=jung3o;40259483]indentation pls. :suicide:[/QUOTE] sorry. its not easy to post tidy code on facepunch. fixed it now though
[QUOTE=Poo Monst3r;40259540]sorry. its not easy to post tidy code on facepunch. fixed it now though[/QUOTE] check your logs. it's in ur wamp under the name of "log"
[QUOTE=jung3o;40259572]check your logs. it's in ur wamp under the name of "log"[/QUOTE] My WAMP version is working perfectly. It's when I upload it to my server that I have the issue. I will check my server logs. [editline]12th April 2013[/editline] I only see this in my server's error logs: [CODE] [Fri Apr 12 15:17:59 2013] [error] [client 99.231.39.145] File does not exist: /home/silvpow1/public_html/favicon.ico [Fri Apr 12 15:17:59 2013] [error] [client 99.231.39.145] File does not exist: /home/silvpow1/public_html/403.shtml, referer: http://silv3rfox.com/facfilms/admin/addWork.php?f=1 [Fri Apr 12 15:16:46 2013] [error] [client 99.231.39.145] File does not exist: /home/silvpow1/public_html/404.shtml [/CODE]
Sorry, you need to Log In to post a reply to this thread.