Jump to content

shortysbest

Members
  • Posts

    414
  • Joined

  • Last visited

Everything posted by shortysbest

  1. Thanks, this is how it's output. although it didn't do it for every image I selected :\ Array ( [uploadFile] => Array ( [name] => HPIM4104.JPG [type] => image/jpeg [tmp_name] => C:\wamp\tmp\phpD61E.tmp [error] => 0 [size] => 2165662 ) )
  2. I have a file upload field that allows multiple image uploads, however I cannot figure out how to do the for loops or what ever it would be to upload each file to my server. It works perfectly fine if I only select a single image, after that it doesn't. My upload field: <form><input type="file" name="uploadFile" class="custom-upload" multiple="multiple" onChange="photoUpload(this.form,'ajax/photos/upload_photos.php','photo'); return false;"/></form> My php uploading script: $file = isset($_FILES['uploadFile']['name']) ? $_FILES['uploadFile'] : ''; $fileArr = explode("." , $file["name"]); $ext = strtolower($fileArr[count($fileArr)-1]); $allowed = array("jpg", "jpeg", "png", "gif", "bmp"); if (in_array($ext, $allowed)) { include("../../photo_upload_sizes.php"); print $filename; mysql_query("INSERT INTO photos SET user_id='$session', album_id='$album_id', profile='0', photo='".$filename."', date='$date'"); move_uploaded_file($file["tmp_name"],"../../photos/".$filename.".jpg"); }
  3. I need to be able to have users be able to easily select 10, 20, or even 200 images to upload. (im building a social network)
  4. what's the simplest way to allow a user to go and select multiple photos? The default file field only allows one at a time.
  5. I got a query that does it, however it is only loading a single record at a time :/ $query = mysql_query("SELECT B.* FROM (SELECT A.* FROM friends A WHERE (A.friend_1='".$id."' OR A.friend_2='".$id."') AND A.id<$last_id ORDER BY A.id DESC LIMIT 16) AS B ORDER BY B.id ASC");
  6. yeah, I need to select the ids in DESC order, but order them by ASC order. I know that can be done, I'm just horrible with the more complex mYSQL Queries though, do you know?
  7. Well I've actually got it working pretty good now, however when I use the previous button it goes to the very first 16, not the last 16. $query = mysql_query("SELECT * FROM friends WHERE (friend_1='".$id."' OR friend_2='".$id."') AND id<$last_id ORDER BY id ASC LIMIT 16"); The only other problem is one I first load the page it isn't selecting the correct last_id loaded id, but after U click the forward/previous buttons once it fixes that. that's a javascript issue though.
  8. I know how to paginate like that, was just hoping to be able to do it this way though
  9. I have two button that load the next and previous pages of friends, I'm having trouble doing so, it sort of works, but it's got bugs so it's not right. Next: $query = mysql_query("SELECT * FROM friends WHERE (friend_1='".$id."' OR friend_2='".$id."') AND id>$last_id ORDER BY id ASC LIMIT 16"); previous: $query = mysql_query("SELECT * FROM friends WHERE (friend_1='".$id."' OR friend_2='".$id."') AND id<$last_id ORDER BY id ASC LIMIT 16"); $id = id of the users profile. $last_id = the last loaded friend id (unique id to friends table , not the friends actual id)
  10. neil.johnson: Thanks, I totally understand what you're saying. It is too much alike facebook at the moment, I intend to change that, I am just building a skeleton with basic functions to get it all up and running and overtime my intentions are to evolve it into something completely different and better. This is primarily a project to expand my skills and show them, however if I can build something enough people like and want to use regularly I will continue working on it as a company, I would love to have a big social networking website, that's my dream, but I'm just going one step at a time. Even if this doesn't become popular, well, I've got a website to show companies what kind of skills I have. (Mind you I haven't even graduated High School yet)
  11. I have an instant search on my website and when you type it searches the database and returns the results, this all works however the problem I have is it returns all of the data, so when you type a number of letters it has a lag and it switches through the results with a delay, sometimes not returning correct results even. I know this is because of the number of requests made while there are requests still being sent to the server, so how would I stop a request, then make a new one? function search(string){ $.ajax({ type: "POST", url: "", data: "", cache: false, success: function(html) { $("body").html(html); } }); } That's what I use now. and this below is my idea of what should happen: function search(string){ //first stop this request (not all requests being made to the server, due to other queries that go at the same time) stop_request(search()); //then it continues on with the new request $.ajax({ type: "POST", url: "", data: "", cache: false, success: function(html) { $("body").html(html); //old request never a replaces data //new request does. } }); }
  12. I have a comment page, i use the id from li to load more comments. the structure of my comments are: <ul class='stream'> <li id='1'> <ul class='post-controls' <li id='toggle1'></ul> </ul> </li> <li id='2'> <ul class='post-controls' <li id='toggle2'></ul> </ul> </li> </ul> That's basically how it would look for two comments. Now here's the issue, I'm using jquery to select the last comment on the page so I can get the id of the last loaded comment, to load from there on to the next set of comments. it's an auto loading type of thing. The problem is it's selecting the 2nd set of li id (ul.stream li#2 ul.post-controls li#toggle2) instead of (ul.stream li#2) this is the code: var lastID = $(".stream li:last").attr('id');
  13. can't do that for what I need it for :/
  14. I have a css class: .post-controls li Then I have an element inside of it called: .liked is there a way to have a class that changes the background of post-controls li if the child element is called .liked something like: .liked .post-controls li
  15. Thank you. Yeah there needs to be a lot more features before it's usable, once I get out of High School in 3 weeks I will be spending my time doing so. Haven't had very much time to work on it recently with Graduation upcoming. Thanks for your input.
  16. a website this well-coded will take an advanced user. Assuming you have no background in programming, it would take AT LEAST a year of programming to get to that level (AT LEAST!), then months to build it. Yes, I started PHP around a year ago (probably only spent around 3-4 months actually programming though).
  17. I have no idea where to even start.. There's not a single positive thing about this website, sorry. The design is Horrific, functionality is limited and needs to be ajax for many of which, for instant posting comments and such. The old way just isn't a modern day practice. You need a COMPLETE overhaul, and I would say you need a ton of time dedicated to learning how to design a decent website and such. Sorry to be so mean, however it's important in order for you to improve.
  18. Thank you. Google is great, you can do anything with their api.
  19. I have a video system on my website that allows users to post videos and it embeds youtube videos into the site, I would like to create an interface where you can comment on the actual video itself and it go to youtube's commenting stream. Is that possible? difficult?
  20. Basically what I am doing is making a sort of invitation system, the user clicks on users and they go into a list, that all works, I can get the ids of them using each() but I need to pass it through Jquery Ajax to php to send it to the database for notifications. This is basically what I have: $(".group-video-create").click(function(){ var url = $(".group-input-url").val(); var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; var checked_url = url.match(exp,"<a href='$1'>$1</a>"); if(checked_url) { $("#group-input-names li").each(function(){ //////This is the relevant code///// var user_id = $(this).attr("id"); ///////////////////Here too/// }); //////////////////& here if(user_id) { $.ajax({ type: "POST", //url: "", //data: "", //this would be an array of all of the ids, (could be 1, could be 100). cache: false, success: function(html){ ///Once all invitations have been sent to the database it would then load a new div and hide the previous one. } }); } } }); if you want to see what I'm trying to accomplish just go here: http://www.kithell.com/#/video usr: [email protected] pass: phpfreaklogin it's under Group Video. (You should be automatically directed there once logged in)
  21. I wouldn't expect anyone to use it in its current state. It's not even 1% of the way done, I haven't had the time to add more features that are different from facebook yet, while I'm still in High School. I'm waiting for summer to get it on the go.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.