Jump to content

LanceT

Members
  • Posts

    161
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

LanceT's Achievements

Regular Member

Regular Member (3/5)

0

Reputation

  1. Are there any codes or php scripts that will calculate the user's internet speed?
  2. I have a script that uploads my file, but this script requires apache. I want to get this file onto my other server that's running nginx. Is there a way for PHP to write a file to nginx? Alternatively, is there a way for PHP to copy a file from one server to another? Because that will work as well. How do I do this?
  3. It will be if the user loaded another page and wants to check if his video is done converting. So it won't be on the same page as the code above. Anyone have any ideas?
  4. How does facebook do their news feed? Or can you think of an algorithm that will do this effectively? I thought of an algorithm, but it's not that effective. My algorithm goes like this, choose 10 random friends from their friends list, and then put the latest updates of these friends into an array in order, then output the updates onto the feed in order. The problems with this algorithm are that this makes the feed change every time because there are new random friends shown. Then there's the problem of choosing friends that are inactive, therefore showing updates from a long time ago. Any suggestions?
  5. Yes like on these forums, when you go to a page like http://www.phpfreaks.com/forums/php-coding-help/ You can see that some threads have "new" written on the side of them with orange background. I just wanted to figure out how the forum decided to show which ones were new and which ones were not new. And if you say its through cookies, won't that possibly mean that the forum is going to set a ton of cookies?
  6. I want to get a simple true/false to check if my ffmpeg is still converting a video. You can check out the shell command I executed below. convertToFlv( $input, $output ); function convertToFlv( $input, $output ) { echo "Converting $input to $output"; $command = "ffmpeg -y -i $input -acodec libfaac -ar 44100 -ab 96k -vcodec libx264 -level 41 -crf 20 -bufsize 20000k -maxrate 25000k -g 250 -r 20 -s 640x480 -coder 1 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +brdo+dct8x8+bpyramid -me umh -subq 7 -me_range 16 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -bf 16 -b_strategy 1 -bidir_refine 1 -refs 6 -deblockalpha 0 -deblockbeta 0 $output"; shell_exec( $command ); } Can someone provide me some code that will help me check if ffmpeg is still doing the conversion?
  7. But there's thousands of users with thousands of posts, so I'm wondering how you store this data in the database efficiently. One way I thought of is to insert a new row into a table whenever a user has read a post for the first time, but then this could potentially have millions and thousands of rows and seems to be inefficient IMO. What's a way to do this better?
  8. How do forums check if you've read a post or not? Is it through cookies?
  9. Nvm, I figured it out. Thanks a lot this was helpful.
  10. can you give me some sample code with the implode() method, that seems a bit easier for me to understand since oo is a bit complicated. I've never used implode() before I'm just a bit confused about how to implement it.
  11. So I'm trying to basically trying to make an "advanced search" function in PHP/mysql that will allow users to search by a number of different options like search by zipcode, username, gender, etc. Now my question is how do I vary my mysql query so that it searches for all these things based on whatever the user inputs? For example, the user might need to search zipcode and username but not gender, but in another case, might need to search username and gender, but not zipcode. Obviously I could just do some if/else statements, but that would be increasingly more difficult as there are more fields. What can I do?
  12. How do the sites like Twitter, Facebook, Linkedin, etc grab a user's email account (provided that you give you e-mail address and password) to check if they have any pre-existing contacts on their social network? Is there any pre-written scripts that allow me to do this and then search my users database for users that match email account in their address book?
  13. So I am creating a new RSS feed that takes contents from two different mysql tables. I am using the following code $query = "select dateline, url, title, description,rssdate from `articles` WHERE pagenumber='1' ORDER by id DESC limit 15"; $result = mysql_query($query, $dbh); while ($line = mysql_fetch_assoc($result)) { $return[] = $line; } $query2 = "select dateline, link_url, title, category, rssdate from `rotator` WHERE category='movie' ORDER by id DESC limit 5"; $result2 = mysql_query($query2, $dbh); while ($line2 = mysql_fetch_assoc($result2)) { $return[] = $line2; } I want to have the resulting array ($return) sorted by "dateline" (which is a number that organizes the dates of each item). Now how do I go about sorting this array? Thanks
  14. Question is the title. Does anyone know? (For example, selection sort, quicksort, etc)
  15. Is it advisable to always use mysql_close when you no longer need that connection?
×
×
  • 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.