
shortysbest
Members-
Posts
414 -
Joined
-
Last visited
Everything posted by shortysbest
-
Excellent, thanks. That was too easy of a fix .
-
I want to appendTo a div from a list of names. (like adding them to an email) However I am having troubles with making it so when you click on it the first time it adds them to email, then you click on the same tag (which was appendedTo a div) it appends back to original container (which removes them from email), and so on as many times as the user may do so. Right now the script I use only allows it to do this process twice then it doesn't work, of course if I added more of the events it would do so longer. $(document).ready(function(){ $(".group-video-select-friends li").click(function(){ $(this).appendTo(".group-input-names"); $(".group-input-names li").click(function(){ $(this).appendTo(".group-video-select-friends"); $(".group-video-select-friends li").click(function(){ $(this).appendTo(".group-input-names"); $(".group-input-names li").click(function(){ $(this).appendTo(".group-video-select-friends"); }); }); }); }); Notice how it has to be, the next set of clicks needs to be inside the ({ }) tags each time.
-
thank you, seems to work correctly now. Thanks a ton! for your help. I haven't tackled the level of mysql queries yet, which clearly I need to & ahh, I see the error now. Just switched session and id at the inner join. Glad I looked it over, I fixed the select posts from mutual friends that you made me earlier too. I'm a happy camper.
-
KickStart; I have just noticed that the mysql you provided me actually isn't working correctly :|. it appears that it is just loading all friends of the users profile you are on, except the session user (which is how it should be), it doesn't only load friends that you both have in common. I thought it had been working perfectly before, but eh dunno what happened, I didn't change any of the code. $mutual_friends = mysql_query("SELECT z.aFriend AS FriendId FROM (SELECT if(a.friend_1 = '$id',a.friend_2,a.friend_1) AS aFriend FROM friends a WHERE (a.friend_1 = '$id' AND a.friend_2 != '$session') OR (a.friend_2 = '$id' AND a.friend_1 != '$session')) z INNER JOIN (SELECT if(a.friend_1 = '$id',a.friend_2,a.friend_1) AS aFriend FROM friends a WHERE (a.friend_1 = '$id' AND a.friend_2 != '$session') OR (a.friend_2 = '$id' AND a.friend_1 != '$session')) x ON z.aFriend = x.aFriend ");
-
Thank you very much! I'm 18, just a few weeks short of graduation. Started doing this stuff around a year ago this time. As for the design aspect, yes I agree it isn't very great, I'm happy with it, but I'm not thrilled with it. One of the factors is that I haven't really got enough features in it to build around the design, it's still pretty bare, I am continually working to improve it though. (you should see how bad the design and everything was just 3 weeks ago lol) I have about 12 versions, almost all of them completely different from another hah. I spent more time making new versions than adding functions to it, but now I'm sticking to this one to get things done. For your mutual friends concern, I'm not sure if you know exactly what that means? Mutual friends are just friends you and the user both have added, it's not a "top friend" system. I'm not having a "top friend" system either, because of the reasons you listed. For bringing other people in, I would like to do that, I actually started a social networking website with another person, but he lives across the world so it was difficult to stay on top of everything. It would be nice to have someone that knew more than I knew, and lived near me, however where I live there's not a single person I know that can do any high level work. Again thanks for your feedback, Would love for you, or anyone else to make your own account and keep me updated on my progress
-
Sorry, I was in the middle of upgrading the security of the passwords, it is up and running now. That's a good question , well I have been basing some of the things off facebook, but keeping them as far away from facebook as I can, and continue to change them so they are better and not like facebook, I'm not great with coming up with ideas on the spot, I'm more of I have to use it to see how it works, and change it when the ideas come to me. I'm trying to make it much more simple to use, and a cleaner design. The website is a work in progress which will build itself over time lol, so much of the details I don't really have. I do know that with the time I can make a website that is better than facebook, as I have done this much work already with about 9 months of on and off, after school programming experience.
-
Hey let me ask you something, maybe you know the answer, maybe not. Do you know if in a chat (such as facebooks chat, which epically fails), whether it's better to store the chat in a .txt, or on the database? I'm assuming the reason for a .txt document would be because of the massive number of rows it would take in the database.
-
Haha, yeah, Facebook's failures have inspired Kithell lol. Facebook has been slowly turning me away from their site, they are changing/adding features that I think are just ridiculous, plus there is just too much spam on there now (IE news feed and such). As I am still in Highschool I get to listen to many people complain about Facebook and say what they wish it did or didn't have, so I have been taking those factors into account, as well as personal preference. In a perfect world Kithell would be the new Facebook, and I would be the New (younger) Mark Zuckerburg lol.
-
First and foremost, thank you for your feedback. "I like the responsiveness ajax stuff.": Thank you, from the very beginning I made my mind up that I wanted a website precisely like this, completely ajaxed based which is the only way a social networking website could be successful, it makes everything so much faster and smoother. "Although if someone has no javascript there is no alternative page view.": Yes, that's unfortunate, however if they don't have javascript then I think most social networking websites are out of the question for them anyways. "and maybe give the message boxes a little space above them right now it feels as if it squeezed all to getter.": I had an additional 5px padding above and below the posts before, however I thought they were too spaced out and you couldn't see enough posts, I feel most people would like to see more content from friends, and less whitespace, at least that's my preference. However I do plan on adding the ability to comment and such on posts which if I design that feature how I have planned in my head, it would give extra space between them. Thanks again for your feedback fellow Php Freak.
-
Thanks, I've been looking around and I would just like to ask you personally how you think the best way is for a secure login. Like setting a Cookie. Right now all I do is set the cookie as the users unique id from the database. (just for simplicity as I use that id throughout my page for mysql queries). I've seen some people use uniq id's for each session,however I'm not entirely sure what the best way would be. Without very much knowledge I was thinking possibly storing a uniq id in the databse alongside the users id and each time they log in it uses a different uniq id. (also my cookies default expiration is 1 month, again just as a simple variable for the time being)
-
Thank you both, I guess I have about 40 files to edit o,O. I found a way to time the response, and I ran through I bunch of tests, overall I got it was about 5-9% faster to define the fields, than not to. My website probably has easily 150 or more queries in it, so that could potentially be substantial along with the added security. While we're talking about security, I'm not very well educated with how to make a secure website, I have very little security on my site, which is an issue I need to address if I have any plans for my website.
-
oh, what does it make the query take longer to complete? Would make sense, if so do you by any chance know how significant the speed difference would be? Also do you know how to show the amount of time it takes for a script to run and complete?
-
Thank you very much, you're great! hah. I'm horrible at the more 'advanced' mysql, didn't know you could use if statements in them.
-
Do you know how to get this to work in the query? $mutual_friends = mysql_query("SELECT z.aFriend AS FriendId FROM (SELECT if(a.friend_1 = '$id',a.friend_2,a.friend_1) AS aFriend FROM friends a WHERE (a.friend_1 = '$id' AND a.friend_2 != '$session') OR (a.friend_2 = '$id' AND a.friend_1 != '$session')) z INNER JOIN (SELECT if(a.friend_1 = '$id',a.friend_2,a.friend_1) AS aFriend FROM friends a WHERE (a.friend_1 = '$id' AND a.friend_2 != '$session') OR (a.friend_2 = '$id' AND a.friend_1 != '$session')) x ON z.aFriend = x.aFriend "); while($mutual_check = mysql_fetch_array($mutual_friends)); { $mutual_id = $mutual_check['FriendId']; $query = mysql_query("SELECT * FROM posts WHERE from_id='$mutual_id' AND to_id='$id' AND state='0' ORDER BY id DESC"); } Basically I need to select the mutual friends (which is no problem), then I need to select from my posts table where from_id is equal to any and all of our mutual friends, and the post to id is the users profile we're on, This example doesn't work, the $query goes through a function: main_post_content($query); which then goes on to: function main_post_content($query, $class, $realtime) { if(mysql_num_rows($query)==0&&!$realtime) { ?> <div class='stream-no-posts'>There haven't been any posts</div> <?php } else { while($get_post = mysql_fetch_array($query)) { if that makes any sort of sense to you.
-
usr: [email protected] pass: phpfreaklogin
-
I have been working on a social networking website in my free time for the past 2 months and I am looking for suggestions for my website. I have started out basing it from facebook, however as I continue to work on it I am working to make it all together different, and of course better. If you have suggestions for features or anything please let me know, you can post it here, or directly on my profile! www.kithell.com/#/profile&id=1 Some of the current features: *Friends *Mutual Friends *Basic Info *Profile Picture Upload *Realtime post updates *Post links from youtube and instantly embeds video information *Watch Youtube videos and browse through any page without interrupting the video playback **Hide the video and continue listening to it *Email notifications for new posts and friend requests *Filter posts on yours, or any other profiles to find what you want *Search for friends, or just browse for them (must have an account) *Realtime Online status. (Online, Away, Offline) & Last seen date *Delete posts, and restore removed posts etc.
-
Ah.
-
Ahhh, I see, looked right over the FriendId at the beginning! Thanks works perfectly.
-
Thanks, still having trouble, but how are you suppose to retrieve the id? If I just replace your query with the other one it doesn't work, well it partially works, it does loop the correct number of times, however I just need to retrieve the id, not sure how I would get it without selecting a specific column. this is the entire block of code: <?php //$mutual_friends = mysql_query("SELECT friend_1, friend_2 FROM friends WHERE (friend_1='".$id."' OR friend_2='".$id."') AND (friend_1<>'".$session."' OR friend_2 <>'".$session."')"); $mutual_friends = mysql_query("SELECT z.aFriend FROM (SELECT if(a.friend_1 = '$id',a.friend_2,a.friend_1) AS aFriend FROM friends a WHERE (a.friend_1 = '$id' AND a.friend_2 != '$session') OR (a.friend_2 = '$id' AND a.friend_1 != '$session')) z INNER JOIN (SELECT if(a.friend_1 = '$id',a.friend_2,a.friend_1) AS aFriend FROM friends a WHERE (a.friend_1 = '$id' AND a.friend_2 != '$session') OR (a.friend_2 = '$id' AND a.friend_1 != '$session')) x ON z.aFriend = x.aFriend "); while($mutual_check = mysql_fetch_array($mutual_friends)) { $mutual_find = $mutual_check['friend_2']; if($mutual_find==$session||$mutual_find==$id) { $mutual_id = $mutual_check['friend_1']; } else { $mutual_id = $mutual_check['friend_2']; } if($mutual_id!=$session){ $mutual_photo = photo($mutual_id, 55); $mutual_name = name($mutual_id, 'fml'); ?> <li id="<?php print $mutual_id?>"> <img onClick="location.hash='#/profile&id=<?php print $mutual_id?>'" class="friends-thumb" src="<?php print $mutual_photo?>" /><div class="friends-name" id="hover<?php print $mutual_id?>"><div class="friend-arrow-border"><div class="friend-arrow"></div></div><a href="#/profile&id=<?php print $mutual_id?>"><?php print $mutual_name?></a></div> </li> <?php } } ?>
-
Thank you both very much, unfortunately Kickstart I haven't been able to get yours to work. Muddy_Funster, yours works great, however I was wondering if you could include in the mysql_query, because I also need to count the number of mutual friends and without this in the query it may count some rows it shouldn't. $mutual_friends = mysql_query("SELECT friend_1, friend_2 FROM friends WHERE (friend_1='".$id."' OR friend_2='".$id."') AND (friend_1<>'".$session."' OR friend_2 <>'".$session."')"); while($mutual_check = mysql_fetch_array($mutual_friends)) { $mutual_find = $mutual_check['friend_2']; //this just checks the rows to determine which column it needs the id from, since user ids could be reversed depending on how they were put into the database //(friend_1 is the user that accepted the friend request, friend_2 sent the request) if($mutual_find==$session||$mutual_find==$id) { $mutual_id = $mutual_check['friend_1']; } else { $mutual_id = $mutual_check['friend_2']; } //this removes the id of the session so it doesn't show their own friendship within mutual friends if($mutual_id!=$session){ ////the rest of the code is irrelevant Thanks a ton.