Web Dev Questions That Don't Need Their Own Thread v4
5,001 replies, posted
[QUOTE=wauterboi;42165918]Is there any reason "width" would work on an image's class, but not "max-width"? Max-width just flat out does not work at all, but width surprisingly makes the image fit to the parent container as intended. I would expect both to either work or not work, but that's not the case.[/QUOTE]
Max-width does work on images, is the image actually bigger than the max-width you're setting? Max-width won't do anything if the image is smaller than the width you're setting. I use max-width: 100% all the time to keep images from being bigger than their container, so I know it works.
[QUOTE=01271;42155029]I can't get php-fpm to write to an sqlite file.
It can read it well enough but it won't write at all.
I'm on centos + nginx and the directory permissions are 775 while the file's permissions are 770 with user apache:apache.
If I change the user or group the file cannot be read at all.
Tried nginx:nginx and root:root.
how do I make it work?
On my old VPS it worked fine with permissions 640 and a user that's a number.[/QUOTE]
Still can't figure this out.
[QUOTE=KmartSqrl;42165962]Max-width does work on images, is the image actually bigger than the max-width you're setting? Max-width won't do anything if the image is smaller than the width you're setting. I use max-width: 100% all the time to keep images from being bigger than their container, so I know it works.[/QUOTE]
It just magically started working despite me hard refreshing and everything yesterday. I suck.
I use it all the time as well - it's just yesterday, I was sitting here switching back and forth between "width" and "max-width" wondering why it would work with "width" and not "max-width". :V
[url=http://dotbsp.com/forum/showthread.php?tid=11&pid=19#pid19]Here it is in action![/url] (Boy do I hate theming pretty much any forum-software ever. This is MyBB.)
- snip -
Pretty sure the default user:group is www-data:www-data
What sort of things would I need to know to be able to create my own forum software? Basic features, markdown formatting in general. Not like I'm going to actually do this as this is way beyond my scope, but just wondering what I'll need to learn.
I fixed it by making the folder owned by apache:nginx.
[editline]12th September 2013[/editline]
[QUOTE=Stonecycle;42167829]What sort of things would I need to know to be able to create my own forum software? Basic features, markdown formatting in general. Not like I'm going to actually do this as this is way beyond my scope, but just wondering what I'll need to learn.[/QUOTE]
You'll need an understanding of HTML, CSS and some javascript.
You will need a programming language.
You will need a database and knowledge of how databases work.
You'll also have to learn safety regarding:
storing user-submitted text,
storing images,
retrieving and displaying images and text (people can post something like <script> tags if they want)
[QUOTE=01271;42168055]I fixed it by making the folder owned by apache:nginx.[/QUOTE]
Useful, specially as I'm going to switch my Apache to Nginx very soon too, for a web app that handles files and folders too.
Have you needed to do anything extra since you installed it to get it working (apart of installing php-fpm and setting the folder's owner) ?
[QUOTE=01271;42168055]I fixed it by making the folder owned by apache:nginx.[/QUOTE]
If you are using nginx why does apache need permissions? That just seems really wrong to me
Seems wrong to me as well, however, the file was created under apache and apache seems to have crushed and replaced www-data on my server so it's what PHP will use to write files.
On my website, I was using a table to layout things before I realized that that was bad and I switched to css. This is what my table looked like before:
[code]
<table width="90%" border="1">
<colgroup>
<col width="33%">
<col width="33%">
<col width="33%">
</colgroup>
<tr>
<td colspan=1><img src="picture"/></td>
<td colspan=2>description</td>
</tr>
<tr>
<td colspan=2>description</td>
<td colspan=1><img src="picture"/></td>
</tr>
</table>
[/code]
this is what it looks like now:
[code]
.tableless {
display:table;
width:95%;
padding:20px;
margin:0px auto;
}
.member {
display:table-row;
position:relative;
width:100%;
}
.desc {
display:inline-block;
width:66%;
height:100%;
padding:20px;
}
.member img {
display:inline;
width:33%;
}
-----------------------------------
<div class="tableless">
<div class="member">
<img class="floatleft" src="picture"/>
<div class="desc">description</div>
</div>
<div class="member">
<div class="desc">description</div>
<img class="floatright" src="picture"/>
</div>
</div>
[/code]
the top code with the table worked correctly as expected and all, but the problem with the bottom code is that the "desc" div doesn't have a height set so I can't vertically center it. it looks like this:
[t]http://puu.sh/4pJEs.jpg[/t]
is there any way for me to be able to vertically center the desc div or the text inside?
I have to use some web software at work called magento and when implementing images in my blog posts they all have a border of 1px around them being applied, how can i remove it? border="0" doesn't work in the <img style=""> tag
Skim through your CSS for the img class (CTRL+F for "img") and see if there's a border set for it.
[QUOTE=xianlee;42176555]I have to use some web software at work called magento and when implementing images in my blog posts they all have a border of 1px around them being applied, how can i remove it? border="0" doesn't work in the <img style=""> tag[/QUOTE]
[CODE]img{border:0;}[/CODE]
in your css
if that doesn't work
[CODE]img{border:0 !important;}[/CODE]
Thanks guys, I don't have access to the backend stuff so have to overwrite it with inline CSS ¬¬, the above worked.
Where can I find some open source rails apps to peek on?
[QUOTE=MuffinZerg;42179884]Where can I find some open source rails apps to peek on?[/QUOTE]
[url]https://github.com/discourse/discourse[/url]
[QUOTE=MuffinZerg;42179884]Where can I find some open source rails apps to peek on?[/QUOTE]
[url]https://github.com/gitlabhq[/url]
[QUOTE=MuffinZerg;42179884]Where can I find some open source rails apps to peek on?[/QUOTE]
I'm working on [url]https://github.com/filp/whatdo[/url]
[QUOTE=StinkyJoe;42187927]I'm working on [url]https://github.com/filp/whatdo[/url][/QUOTE]
But what is that?
[QUOTE=MuffinZerg;42188726]But what is that?[/QUOTE]
This thing here: [url]http://facepunch.com/showthread.php?t=1249999&p=42190064&viewfull=1#post42190064[/url]
I'm pretty desperate, so I'm going to ask in this thread too!
[QUOTE=Cowabanga;42188603]Oh my god why is it such a pain in the ass to install a simple mail server? I only want a mailserver which I can use pop3/smtp with, make email addresses that don't require me making independent unix accounts and not take 500mbs of RAM.
Can someone tell me of a guide of packages which do the things I want above?[/QUOTE]
Is there by any chance a cleaner/nicer way of getting the current UTC time in js other than:
[CODE]
function getUTCDate()
{
var now = new Date();
var d = new Date( now.getUTCFullYear(),
now.getUTCMonth(),
now.getUTCDate(),
now.getUTCHours(),
now.getUTCMinutes(),
now.getUTCSeconds(),
now.getUTCMilliseconds());
return d;
}[/CODE]
-snip-
[QUOTE=Richy19;42191871]Is there by any chance a cleaner/nicer way of getting the current UTC time in js other than:
[CODE]
function getUTCDate()
{
var now = new Date();
var d = new Date( now.getUTCFullYear(),
now.getUTCMonth(),
now.getUTCDate(),
now.getUTCHours(),
now.getUTCMinutes(),
now.getUTCSeconds(),
now.getUTCMilliseconds());
return d;
}[/CODE][/QUOTE]
[code]new Date(new Date().getTime() + new Date().getTimezoneOffset()*60*1000)[/code]
Something like this could work, just an alternative.
Hey FP, from one day to another my apache server on a cloud get's extremely slow, pages taking ages to load and all, at first i thinked it was a ddos, but that's the only bandwidth being consumed:
[IMG]http://imagens.sourcebr.net/Screenshot_3_18_01_AM_segunda-feira_16_setembro_2013.png[/IMG]
The Machine is a Xeon 2.4GHZ and has 512MB of Ram (there is just a small website on it with very little sql queries, all the resources are pretty much free) i've searched the entire web and don't got a clue on what to start looking at, does anyone got a tip to what should i do?
I'm working with large files and I'm getting the error "X plugin is slow... use detect slow plugins setting"...
Is there any disadvantages on adding [code]"detect_slow_plugins": false[/code] to sublime settings?
Soooooooo, I'm starting to focus more on PHP and have therefor decided to make my own contact form plugin for Wordpress to enhance my skills. Problem is, where does one start? I would like to challenge myself into making some dashboard interface as well but generally how would the file structure be, where should I go to look other than php.net for various things, do I even use <form> when I wan't to make it dynamic? I don't even know how to get started, wow.. :v:
[QUOTE=Moofy;42214757]Soooooooo, I'm starting to focus more on PHP and have therefor decided to make my own contact form plugin for Wordpress to enhance my skills. Problem is, where does one start? I would like to challenge myself into making some dashboard interface as well but generally how would the file structure be, where should I go to look other than php.net for various things, do I even use <form> when I wan't to make it dynamic? I don't even know how to get started, wow.. :v:[/QUOTE]
If you're just starting with PHP, don't try to make Wordpress plugins.
Try to make something simple, like a contact form outside of Wordpress.
[QUOTE=Dorkslayz;42215008]If you're just starting with PHP, don't try to make Wordpress plugins.
Try to make something simple, like a contact form outside of Wordpress.[/QUOTE]
I like to challenge myself on a different level from what others might do.
Sorry, you need to Log In to post a reply to this thread.