• Web Dev Questions That Don't Need Their Own Thread v4
    5,001 replies, posted
[QUOTE=Coffeee;42314732]How does the Facebook mobile app work? Is it just the Facebook mobile website with a browser that has tweaked settings?[/QUOTE] [QUOTE=KmartSqrl;42315982]It's a native app that communicates with an API on facebook's end. Definitely not just a web browser with a different face.[/QUOTE] I know that question is a bit old, but I just wanted to point this out [url=https://m.facebook.com/]https://m.facebook.com/[/url]
[QUOTE=xaviergmail;42356070]I know that question is a bit old, but I just wanted to point this out [url=https://m.facebook.com/]https://m.facebook.com/[/url][/QUOTE] I think he meant [url]https://play.google.com/store/apps/details?id=com.facebook.katana&hl=en[/url]
[QUOTE=xaviergmail;42356070]I know that question is a bit old, but I just wanted to point this out [url=https://m.facebook.com/]https://m.facebook.com/[/url][/QUOTE] He said the mobile app, not the mobile website. In that context app = native.
I need some quick help from you CSS guru's! I'm making this little calendar in php which will be populated with values containing information about glass montaging jobs and when those jobs are scheduled. Now, each worker that has access to the calendar has its own color. Let's say theres a job on Friday the 4th October at 10 AM that a worker named "Eric" is going to do. Eric's color is red, and I want to apply that color to the job that is displayed for that very day and time. All values will be inside a table. I made a little preview of how I'm picturing it would look like: [IMG]http://puu.sh/4E9xk.jpg[/IMG] Red: Eric Blue: Mike etc Each value is a link that redirects the user to the job page that contains detailed information about the job.
[QUOTE=Svenskunganka;42356999]I need some quick help from you CSS guru's! I'm making this little calendar in php which will be populated with values containing information about glass montaging jobs and when those jobs are scheduled. Now, each worker that has access to the calendar has its own color. Let's say theres a job on Friday the 4th October at 10 AM that a worker named "Eric" is going to do. Eric's color is red, and I want to apply that color to the job that is displayed for that very day and time. All values will be inside a table. I made a little preview of how I'm picturing it would look like: [IMG]http://puu.sh/4E9xk.jpg[/IMG] Red: Eric Blue: Mike etc Each value is a link that redirects the user to the job page that contains detailed information about the job.[/QUOTE] put each link in a block and give it a class equal to the employee's name. In the stylesheet or a separate css file (if you want to keep it clean) list the classes with background-colors inside. So in the table [code] <div class='Eric'> <a>Glass job</a> </div> [/code] And in the stylesheet [code] .Eric { background:red; } [/code]
[QUOTE=Svenskunganka;42356999]I need some quick help from you CSS guru's! I'm making this little calendar in php which will be populated with values containing information about glass montaging jobs and when those jobs are scheduled. Now, each worker that has access to the calendar has its own color. Let's say theres a job on Friday the 4th October at 10 AM that a worker named "Eric" is going to do. Eric's color is red, and I want to apply that color to the job that is displayed for that very day and time. All values will be inside a table. I made a little preview of how I'm picturing it would look like: [IMG]http://puu.sh/4E9xk.jpg[/IMG] Red: Eric Blue: Mike etc Each value is a link that redirects the user to the job page that contains detailed information about the job.[/QUOTE] That's mostly a PHP job. CSS will only do 1/4 of that. .EricJob{background-color=RED;} .MikeJob{background-color=BLUE;} and the rest will rely on php. $class = ""; if today is a day that eric works, $class = 'class="EricJob"'; $linkToJob = link; and then make a div or a table data echo'<td ' . $class . '> information about job '. $linkToJob . ' </td>';
[QUOTE=01271;42357118]That's mostly a PHP job. CSS will only do 1/4 of that. .EricJob{background-color=RED;} .MikeJob{background-color=BLUE;} and the rest will rely on php. $class = ""; if today is a day that eric works, $class = 'class="EricJob"'; $linkToJob = link; and then make a div or a table data echo'<td ' . $class . '> information about job '. $linkToJob . ' </td>';[/QUOTE] All the PHP stuff is already complete, I was just in need of something that can add a background color to the job. Although, if the company adds another worker they have to go into the source codes and add another JohnJob{background-color=GREEN;}. I want to be able to echo the link with the RGB color specified in the database for that worker. Eg: [CODE] $color = "SELECT color FROM workers WHERE name=eric"; // Let's say this returned the actual RGB color from the table, so this is now red. echo '<a href="something.php?jobid=2" style="background-color:$color">Text</a>'; [/CODE]
Is PHP [I]really [/I]as bad as people make it out to be here? Should I stop bothering and go Python/Ruby?
[QUOTE=Cowabanga;42357533]Is PHP [I]really [/I]as bad as people make it out to be here? Should I stop bothering and go Python/Ruby?[/QUOTE] It works, but I really do think it's an inferior tool. Not only because it has some pretty big flaws of it's own, but because the ecosystem that exists around Ruby is a lot nicer, IMO. We have nice things like this: [url]https://github.com/charliesome/better_errors[/url] for ruby. I don't even think you could do the whole live REPL at any stack frame thing that that does in PHP, which is [B]incredibly[/B] handy. I would [I]definitely[/I] try ruby/rails out. If you've never used it before you can't know what you prefer.
[QUOTE=Svenskunganka;42357532]All the PHP stuff is already complete, I was just in need of something that can add a background color to the job. Although, if the company adds another worker they have to go into the source codes and add another JohnJob{background-color=GREEN;}. I want to be able to echo the link with the RGB color specified in the database for that worker. Eg: [CODE] $color = "SELECT color FROM workers WHERE name=eric"; // Let's say this returned the actual RGB color from the table, so this is now red. echo '<a href="something.php?jobid=2" style="background-color:$color">Text</a>'; [/CODE][/QUOTE] If you use single quotes for the html and double quotes for the echo, it will work. [php] $var = "some text"; //Outputs "$var" echo '$var'; echo "<br>"; //Outputs "some text" echo "$var"; [/php]
[QUOTE=Cowabanga;42357533]Is PHP [I]really [/I]as bad as people make it out to be here? Should I stop bothering and go Python/Ruby?[/QUOTE] Not really, and no. It's fine, it mostly seems like elitism and that it is easy to learn bad practice (a lot of mysql_* functions are still easy to find) And no, don't stop bothering with other languages, it's a good thing to have more in your notebook. [editline]30th September 2013[/editline] [QUOTE=eternalflamez;42357674]If you use single quotes for the html and double quotes for the echo, it will work. [php] $var = "some text"; //Outputs "$var" echo '$var'; echo "<br>"; //Outputs "some text" echo "$var"; [/php][/QUOTE] There's also the [PHP] echo "<string>" . $var . "</string>"; [/PHP] (It doesn't really matter (as far as I know). I just think it is easier to read)
[QUOTE=KmartSqrl;42357641]It works, but I really do think it's an inferior tool. Not only because it has some pretty big flaws of it's own, but because the ecosystem that exists around Ruby is a lot nicer, IMO. We have nice things like this: [url]https://github.com/charliesome/better_errors[/url] for ruby. I don't even think you could do the whole live REPL at any stack frame thing that that does in PHP, which is [B]incredibly[/B] handy. I would [I]definitely[/I] try ruby/rails out. If you've never used it before you can't know what you prefer.[/QUOTE] What about Python/Django? It seems pretty neglected for some reason and I like Python's syntax a bit more than Ruby. [editline]30th September 2013[/editline] (even though I hate whitespace-dependent languages but I have no other choice apparently)
[QUOTE=Cowabanga;42357758]What about Python/Django? It seems pretty neglected for some reason and I like Python's syntax a bit more than Ruby. [editline]30th September 2013[/editline] (even though I hate whitespace-dependent languages but I have no other choice apparently)[/QUOTE] Don't have much experience with it myself. When I was deciding between ruby/rails and python/django there was some funky stuff going on with django or with python that made me lean towards ruby more but I can't recall what it was off the top of my head.
[QUOTE=eternalflamez;42357674]If you use single quotes for the html and double quotes for the echo, it will work. [php] $var = "some text"; //Outputs "$var" echo '$var'; echo "<br>"; //Outputs "some text" echo "$var"; [/php][/QUOTE] I don't think you understood me correctly. That was just some quick code I put together so you can understand what I need. Disregard to any syntax errors in that code as I wasn't thinking of writing a fully working code for my example.
[QUOTE=Svenskunganka;42358023]I don't think you understood me correctly. That was just some quick code I put together so you can understand what I need. Disregard to any syntax errors in that code as I wasn't thinking of writing a fully working code for my example.[/QUOTE] Well, that would work though? :v: This works for me (changing the text to red): [php] // Change so it gets collected by mysql $color = "#FF0000"; // Outputs a red "Hello" echo "<p style='color: $color'>Hello</p>"; // Outputs the same, but this might be easier to change later on echo "<p style='color: " . $color . "'>Hello</p>"; [/php]
[QUOTE=Svenskunganka;42357532]All the PHP stuff is already complete, I was just in need of something that can add a background color to the job. Although, if the company adds another worker they have to go into the source codes and add another JohnJob{background-color=GREEN;}. I want to be able to echo the link with the RGB color specified in the database for that worker. Eg: [CODE] $color = "SELECT color FROM workers WHERE name=eric"; // Let's say this returned the actual RGB color from the table, so this is now red. echo '<a href="something.php?jobid=2" style="background-color:$color">Text</a>'; [/CODE][/QUOTE] If you have your workers in the database, their id, and their colour, why not fetch both the id and the colour into an array? [PHP] $color = "SELECT worderId, color FROM workers WHERE name=eric"; // Somehow run the query and plop the results into an array // Maybe make it look something like this $result = array("id" => $workId, "color" => "#something"); // Then echo it // (Mind the quotes) echo "<a href='something.php?jobid=" . $result['id'] . "' style='background-color:" . $result['color'] . "'>Text</a>"; [/PHP] Now I hope I didn't misread this time. [editline]30th September 2013[/editline] Is there any danger in using an stdClass instead of an associative array?
Currently I'm still working on my server monitoring site, and I have an overview page that looks like this(wip): [t]http://tbx.me/46lCS.png[/t] I've been given an idea to colour part of the circles, depending on the percentage of use on each part. A friend drew this to show it: [t]http://tbx.me/Ie_dDx.png[/t] Is this easily possible through CSS? The circles are currently just plain CSS here: [t]http://tbx.me/-SjN0.png[/t] If anyone has an idea if this is possible, it'd be great!
[QUOTE=eternalflamez;42358246]Well, that would work though? :v: This works for me (changing the text to red): [php] // Change so it gets collected by mysql $color = "#FF0000"; // Outputs a red "Hello" echo "<p style='color: $color'>Hello</p>"; // Outputs the same, but this might be easier to change later on echo "<p style='color: " . $color . "'>Hello</p>"; [/php][/QUOTE] This is more of what I need, but not quite it. I know the PHP part, and everything works as it should, I just need to add a [B]box[/B] behind the text that's based on the color column in the workers table. Thank you all for the help!
[QUOTE=Snakess;42359119]Currently I'm still working on my server monitoring site, and I have an overview page that looks like this(wip): [t]http://tbx.me/46lCS.png[/t] I've been given an idea to colour part of the circles, depending on the percentage of use on each part. A friend drew this to show it: [t]http://tbx.me/Ie_dDx.png[/t] Is this easily possible through CSS? The circles are currently just plain CSS here: [t]http://tbx.me/-SjN0.png[/t] If anyone has an idea if this is possible, it'd be great![/QUOTE] Google brought me this: [url]http://css-tricks.com/css-pie-timer/[/url] Looks like it could be of use to you?
[QUOTE=mobrockers;42359444]Google brought me this: [URL]http://css-tricks.com/css-pie-timer/[/URL] Looks like it could be of use to you?[/QUOTE] Had a quick look at pie charts before, I just could not work out how to still have the middle empty with the text inside it. [editline]edit[/editline] Seen these two now.. [URL]http://codepen.io/gabrielcatalin/pen/egtxo[/URL] [URL]http://codepen.io/kurthanson/pen/JhIyv[/URL] Getting closer
[QUOTE=Snakess;42359545]Had a quick look at pie charts before, I just could not work out how to still have the middle empty with the text inside it.[/QUOTE] You could just wrap the circles in a container element that has [code] position: relative; [/code] Then draw the pie chart as a regular pie chart and make an element with a white background and 50% border-radius and then absolutely position that over the pie chart. When you use absolute positioning inside a parent that has relative positioning, the absolute positioning is relative to the parent, not the entire document, so it's [I][B]really[/B][/I] handy for doing stuff like this.
[QUOTE=Svenskunganka;42359229]This is more of what I need, but not quite it. I know the PHP part, and everything works as it should, I just need to add a [B]box[/B] behind the text that's based on the color column in the workers table. Thank you all for the help![/QUOTE] Oh, instead of color, use background-color. While I scrolled up to find the original answer, this guy has it correct as well: [QUOTE=MuffinZerg;42357105]put each link in a block and give it a class equal to the employee's name. In the stylesheet or a separate css file (if you want to keep it clean) list the classes with background-colors inside. So in the table [code] <div class='Eric'> <a>Glass job</a> </div> [/code] And in the stylesheet [code] .Eric { background:red; } [/code][/QUOTE]
I've faced another issue! When I echo something, the script automatically forces line-breaks if it's two diffrent html "types". For example: [CODE] // This automatically creates a newline between "Sometext" and "Someothertext" echo '<a href="blabla.com/index.php">Sometext</a><p>Someothertext</p>'; // This creates no newline echo '<p>Hello</p><p>Hello2</p>'; [/CODE] How do I disable this? [editline]30th September 2013[/editline] It's fine! I got it, had to add: <p style="display:inline">
[QUOTE=Snakess;42359119]Currently I'm still working on my server monitoring site, and I have an overview page that looks like this(wip): [t]http://tbx.me/46lCS.png[/t] I've been given an idea to colour part of the circles, depending on the percentage of use on each part. A friend drew this to show it: [t]http://tbx.me/Ie_dDx.png[/t] Is this easily possible through CSS? The circles are currently just plain CSS here: [t]http://tbx.me/-SjN0.png[/t] If anyone has an idea if this is possible, it'd be great![/QUOTE] Mind if I ask what language this is in? I wanted to have a similar thing for my VPS frontpage listing things like disk usage, cpu load, memory usage... but I was doing so in c# for which mono hasnt really implemented most of the system monitoring stuff. So Im now looking into java
[QUOTE=Richy19;42362071]Mind if I ask what language this is in? I wanted to have a similar thing for my VPS frontpage listing things like disk usage, cpu load, memory usage... but I was doing so in c# for which mono hasnt really implemented most of the system monitoring stuff. So Im now looking into java[/QUOTE] I'd imagine he's just using a pre-build monitoring package and only building the front end? There must be a bazillian server monitoring packages out there right.
- snip -
I'm looking for a pretty simple, modern neat looking 2 column Wordpress theme for just a personal blog. I'm not much into creating themes for Wordpress so can someone recommend a few or just one?
[QUOTE=Richy19;42362071]Mind if I ask what language this is in? I wanted to have a similar thing for my VPS frontpage listing things like disk usage, cpu load, memory usage... but I was doing so in c# for which mono hasnt really implemented most of the system monitoring stuff. So Im now looking into java[/QUOTE] This is built in PHP/MySQL. [QUOTE=mobrockers;42362130]I'd imagine he's just using a pre-build monitoring package and only building the front end? There must be a bazillian server monitoring packages out there right.[/QUOTE] I built this completely from scratch, its main use is to monitor external servers, but it also shows the current stats of the monitoring server (as shown in the picture).
[php] $arr = Array ( [0] => Dukkefilm [1] => Musikfilm [2] => Børnefilm [3] => Animation [4] => Turistfilm [5] => Propagandafilm ) [/php] I have this array Is there any way to get all the keys of a value searched for? Like if I search for "film" it would return an array of all the keys with "film in" And if I searched for "u" it would return an array of "0, 1, 4"
array_filter()
Sorry, you need to Log In to post a reply to this thread.