Web Development Questions That Don't Need Their Own Thread v2
3,079 replies, posted
Here is what my table looks like
postID|Message
1| I can't wait to get STARTED!!!!
2| @1 dude, you're way to hyped
3| Everyone ignore this guy --> @2
4| @3 Why ignore me?
is it possible to do a query where I can fetch all comments chained to post #4?
Conceptually:
if I ask for things chained to #4 the mysql will see "@3" (with the symbol '@') and include that in the results, but it will also look at post #3 and include post 2 because of the "@2" included... and all the way down to 1.
Is it possible to do this with 1 mySql query?
I can specify the targeted posts in a different field if I need to ( It's possible to have multiple post references though)
SEOT: 7gNI4bk8OeuPJmaWpb2u
Which one of the following should be used?
[html].something {
margin: 0;
}
or
.something {
margin: 0px;
}[/html]
And why? I've mostly been using the one with "px".
[QUOTE=Sc00by22;33937931]Depends, did you compile or install it through a package manager? If the later it will also depend on the distro.[/QUOTE]
i did it through apt-get on ubuntu
[QUOTE=Dragory;33938069]Which one of the following should be used?
[html].something {
margin: 0;
}
or
.something {
margin: 0px;
}[/html]
And why? I've mostly been using the one with "px".[/QUOTE]
It doesn't matter, either one works.
[QUOTE=TerabyteS_;33938131]i did it through apt-get on ubuntu[/QUOTE]
I assume you've looked at the configuration file (nginx.conf) usually in /etc/? The document root will be set in there.
[QUOTE=Sc00by22;33938183]It doesn't matter, either one works.
[/QUOTE]
Why not the 2nd one?
[QUOTE=Dragory;33938069]Which one of the following should be used?
[html].something {
margin: 0;
}
or
.something {
margin: 0px;
}[/html]
And why? I've mostly been using the one with "px".[/QUOTE]
the 2nd one seems fine. the 1st one doesn't have the px .... so if you wanted to extend that write up with somethign that actally has length it wouldn't work
[QUOTE=Dragory;33938069]Which one of the following should be used?
[html].something {
margin: 0;
}
or
.something {
margin: 0px;
}[/html]
And why? I've mostly been using the one with "px".[/QUOTE]
I usually use
[code]
body{
margin: 0;
padding: 0;
}
[/code]
However when I'm actually assigning a value to the margin or padding I use
[code]
margin: 5px 10px 5px 10px;
padding: 5px 10px 5px 10
[/code]
[QUOTE=TerabyteS_;33938131]i did it through apt-get on ubuntu[/QUOTE]
[code]sudo vi /etc/nginx/sites-enabled/default[/code]
Your nginx.conf (in /etc/nginx) includes ALL files in the sites-enabled and conf.d folder. [B]default[/B] is a rough (but usable) example of a server configuration, with placeholders for things like php integration. You can edit the root for the default site block there, I usually set it to /var/www, and soft-link /srv/www to it.
[QUOTE=Sprite;33938290]the 2nd one seems fine. the 1st one doesn't have the px .... so if you wanted to extend that write up with somethign that actally has length it wouldn't work[/QUOTE]
I thought that would be obvious though. If you're going to leave something as 0px just use 0, there is no reason not to.
[QUOTE=Sc00by22;33938183]
I assume you've looked at the configuration file (nginx.conf) usually in /etc/? The document root will be set in there.[/QUOTE]
I only have this:
[code]gab@testvm:/etc/nginx$ cat nginx.conf
user www-data;
worker_processes 4;
pid /var/run/nginx.pid;
events {
worker_connections 768;
# multi_accept on;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;
# server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }
#
# server {
# listen localhost:143;
# protocol imap;
# proxy on;
# }
#}
[/code]
[QUOTE=TerabyteS_;33938666]I only have this:
[code]snip[/code][/QUOTE]
StinkyJoe has your answer above. :smile:
[QUOTE=Sc00by22;33938791]StinkyJoe has your answer above. :smile:[/QUOTE]
Yeah, I read it afterwards.
I have another problem right now. I created a group called dev and added both myself (gab) and the www-data user (which runs nginx) to it, then set dev to be the owner of /var/www, and gave it write and read access.
[img]http://www.gabrielecirulli.com/p/20111228-230024.png[/img]
Even though I did this, I still can't, as user gab, write in that folder. What's wrong?
Looking for social netowork bars
Something like this
[IMG]http://cdn4.iconfinder.com/data/icons/m_ex_me/Youtube.png[/IMG]
or this
[IMG]http://cdn4.iconfinder.com/data/icons/extreme_grunge_garments/128/youtube.png[/IMG]
I just need something simple.
I'm not asking for anyone to make me one, i'm asking for pre-made resources
I need youtube, twitter, facebook, google+, ... and that's it
[editline]28th December 2011[/editline]
formspring would also be nice
I know this've been probably asked and discussed more than once, but still:
Using PHP is there any way to read users resolution and automatically resize website elements?
Edit: ^ You can't do that with PHP, you should be doing it via CSS or JS as a last resort.
[QUOTE=Sprite;33938050]Here is what my table looks like
postID|Message
1| I can't wait to get STARTED!!!!
2| @1 dude, you're way to hyped
3| Everyone ignore this guy --> @2
4| @3 Why ignore me?
is it possible to do a query where I can fetch all comments chained to post #4?
Conceptually:
if I ask for things chained to #4 the mysql will see "@3" (with the symbol '@') and include that in the results, but it will also look at post #3 and include post 2 because of the "@2" included... and all the way down to 1.
Is it possible to do this with 1 mySql query?
I can specify the targeted posts in a different field if I need to ( It's possible to have multiple post references though)
SEOT: 7gNI4bk8OeuPJmaWpb2u[/QUOTE]
If I was doing this, I'd store with each post the ID of the direct parent comment, and the ID of the root comment in the tree, so to get a list of child comments you'd just ask for all comments with the same root comment ID.
[QUOTE=Sprite;33938050]Here is what my table looks like
postID|Message
1| I can't wait to get STARTED!!!!
2| @1 dude, you're way to hyped
3| Everyone ignore this guy --> @2
4| @3 Why ignore me?
is it possible to do a query where I can fetch all comments chained to post #4?
Conceptually:
if I ask for things chained to #4 the mysql will see "@3" (with the symbol '@') and include that in the results, but it will also look at post #3 and include post 2 because of the "@2" included... and all the way down to 1.
Is it possible to do this with 1 mySql query?
I can specify the targeted posts in a different field if I need to ( It's possible to have multiple post references though)
SEOT: 7gNI4bk8OeuPJmaWpb2u[/QUOTE]
It's possible, but you really shouldn't do that. You should parse the message for @-references and add that data in another column or have a references table.
[QUOTE=swift and shift;33942617]It's possible, but you really shouldn't do that. You should parse the message for @-references and add that data in another column or have a references table.[/QUOTE]
JESUS ... why didn't i think of that.
[QUOTE=TerabyteS_;33939936]Yeah, I read it afterwards.
I have another problem right now. I created a group called dev and added both myself (gab) and the www-data user (which runs nginx) to it, then set dev to be the owner of /var/www, and gave it write and read access.
[img]http://www.gabrielecirulli.com/p/20111228-230024.png[/img]
Even though I did this, I still can't, as user gab, write in that folder. What's wrong?[/QUOTE]
I've never really messed with multiple users in groups. I just have a user called http in the group http and chown my /srv/http/ folder and then use the http user through FTP.
[QUOTE=Sprite;33940695]Looking for social netowork bars
Something like this
[IMG]http://cdn4.iconfinder.com/data/icons/m_ex_me/Youtube.png[/IMG]
or this
[IMG]http://cdn4.iconfinder.com/data/icons/extreme_grunge_garments/128/youtube.png[/IMG]
I just need something simple.
I'm not asking for anyone to make me one, i'm asking for pre-made resources
I need youtube, twitter, facebook, google+, ... and that's it
[editline]28th December 2011[/editline]
formspring would also be nice[/QUOTE]
Couldn't be fucked doing formspring sorry but I whipped you up some 80x24px social media icons.
[IMG]http://www.zimg.eu/i/3119798721[/IMG]
[IMG]http://www.zimg.eu/i/60913643[/IMG]
[IMG]http://www.zimg.eu/i/3873168257[/IMG]
[IMG]http://www.zimg.eu/i/1839906913[/IMG]
For the PSD:
[URL]http://filesmelt.com/dl/socialmedia_by_wizard.psd[/URL]
Only worry about crediting me if you repost, ta <3
Do you think using a framework is important/essential/good?
I haven't really gotten into them myself yet, but that's mostly because they all look bloated to me - with directory structures containing anything from modules to models that do 99% the same thing and the main layout consisting of 50 files because "modularity".
[editline]29th December 2011[/editline]
Also, haven't I asked this before?
I can't see your variable for the stylesheet anywhere in your html. Am I blind?
As far as I can see you're echo'ing the cookies value only.
[QUOTE=Dragory;33948956]Do you think using a framework is important/essential/good?
I haven't really gotten into them myself yet, but that's mostly because they all look bloated to me - with directory structures containing anything from modules to models that do 99% the same thing and the main layout consisting of 50 files because "modularity".
[editline]29th December 2011[/editline]
Also, haven't I asked this before?[/QUOTE]
using a framework is almost essential if you're going to write anything large
my .htaccess file reads:
ErrorDocument 404 /404.php
and that is it (am I missing something?)
the 404.php file exist. and they are both on the server, but I still received the same default error.
This is supposed to be a broken... and yes it's long.
[url]http://super-private-server-thats-so-high-end-you-dont-even-know-how.k8r.us/like-its-way-beyond-anything-youd-ever-think-of-like-in-forever-dont-even-mess-with-this-divine-knowledge/pasgggg[/url]
SEOT: mBcWbn6FEsRp3EnIXe3G
[QUOTE=Sprite;33954591]my .htaccess file reads:
ErrorDocument 404 /404.php
and that is it (am I missing something?)
the 404.php file exist. and they are both on the server, but I still received the same default error.
This is supposed to be a broken... and yes it's long.
[url]http://super-private-server-thats-so-high-end-you-dont-even-know-how.k8r.us/like-its-way-beyond-anything-youd-ever-think-of-like-in-forever-dont-even-mess-with-this-divine-knowledge/pasgggg[/url]
SEOT: mBcWbn6FEsRp3EnIXe3G[/QUOTE]
[quote]Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.[/quote]
And now I've got .htaccess issues... like seriously...
all i need is
[url]http://888huxtable.com/theFriends[/url]
to point to
[url]http://888huxtable.com/theFriends.php[/url]
my attempt:
RewriteRule ^[url]http://888huxtable.com/theFriends.php[/url] [url]http://888huxtable.com/theFriends[/url]
right?
I mean like really what am I doing? this is an entirely different language to me
[editline]29th December 2011[/editline]
[url]http://www.htaccessredirect.net/index.php[/url]
this may help
[php]RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ $1.php [QSA,L][/php]
wouldnt this work?
oops. you need $1 instead of the other.
I'm trying to make this more compact and effecient:
[html]
function SocialStatus($type,$src,$num) {
$social = explode(".",$src);
preg_match("/^(.*\[)(.*)(\])/", ($social[$num]), $find['users']);
if($find['users'][2] != "") {
$author = explode(',',$find['users'][2]);
$count = count($author);
} else {
$count = 0;
}
if($type == "users") {
$owners = array();
$TABLE = "users";
for($i=0;$i<count($author);$i++) {
$QUERY = mysql_query("SELECT * FROM ".$TABLE." WHERE uniqueid='{$author[$i]}'");
while($row = mysql_fetch_array($QUERY)) {
$user['fname'] = $row['fname'];
$user['lname'] = $row['lname'];
echo '<a href="profile.php?s='.$author[$i].'">'.$user['fname']." ".$user['lname'].'</a>';
}
}
} else {
return $count;
}
}
[/html]
it takes this input in the database [code]{[f14354a616b35c0,c2114dc3b095a6a]}.{[]}.{[]}.{[]}.{[]}[/code]
using the function as such [code]<li><a href="#" class="love" id="0">
<span>Love</span> <b><?php print(SocialStatus(false,$data['social'],0)); ?></b> </a> <span class="posters"><?php print(SocialStatus('users',$data['social'],0)); ?></span>
</li>[/code]
and it outputs [code]<li><a href="#" class="love" id="0"><span>Love</span> <b>2</b> </a> <span class="posters"><a href="profile.php?s=f14354a616b35c0">Heinrich</a><a href="profile.php?s=c2114dc3b095a6a">Henry</a></span> </li>
[/code]
[QUOTE=swift and shift;33949361]using a framework is almost essential if you're going to write anything large[/QUOTE]
[del]Why? From what I've seen, they only provide you with some basic (or even more advanced) functionality that could just as well be contained in a bunch of class files or such. It just seems unnecessary that most of them divide the application into a thousand folders because they want to have you use "views" and "modules" and whatever they've come up with. I know "views" are pretty much the same I'd have in my own applications (content of the page included from somewhere else), but still.
Sure, they also seem "bloated" because it's not designed/coded by me, so I'm not that familiar with them.[/del]
Alright, nevermind that, there's no point arguing about it. Which framework would you recommend and why? I was looking at CodeIgniter, but there seem to be very many alternatives.
There's something wrong:
[php]
$.each(json.results,function(i,tweet){
post = tweet.text;
$(post).filter();
etc
[/php]
filter() is a custom function I made which seems to be working. Something's not right though, only 1 result is being returned, as opposed to cycling through all the results in the json.
i thought variables have to be defined. :/
Sorry, you need to Log In to post a reply to this thread.