Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. strtotime() will return a UNIX timestamp. You can use date to (re)format it. So that would be: date('Y-m-d', strtotime($sqldate . ' +2 days'));
  2. Simply do like strtotime($sqldate . ' +2 days'); The variable you pass to it must of course be a valid date for strtotime.
  3. Hmm... it should do that. The version in SVN does anyway, so when that's rolled out it'll be fixed.
  4. That's because 0 and -∞ are in the same direction for positive real numbers. You said the two operations were identical, but it's not true. It's also not true in the sense that int type casting returns an int (obviously), but floor() returns a float. 1 !== 1.0.
  5. If you, or anyone else for that matter, has suggestions to which codes should be assigned to which smileys, do say so. Some of them just kept their auto generated code from the file name.
  6. What's wrong with my Fibonacci scoring system?
  7. function score($level) { if ($level == 0) return 0; if ($level == 1) return 1; return score($level - 2) + score($level - 1); }
  8. Nope... truncation rounds towards 0 where as flooring rounds towards -∞.
  9. Random fact: PHP has a manual, it's good, and it probably answers your question. Edit: Who the hell added a word filter for r_tfm (excluding underscore) to "read the manual"? I'll have to go fix that... Edit 2: Better, but pretty stupid that SMF parses word filters before smileys.
  10. Switch your end and start dates. You're selecting the rows outside that date range.
  11. Which one is the best is a highly subjective matter. That being said, I don't like SMF either, and I would prefer other forum software. However, migrating a large forum is by no means a simple task. As far as I know, this is the third forum system PHP Freaks is using, and I think many staff members believe that switching the software all the time does more harm than good.
  12. I'll take your word on that one. Write me a ZF action controller plugin and I'll put it in our SVN repository. Requirements: - No using any SMF APIs. They suck. - If logged out on the main site: Must detect if there is an active SMF session and create a local corresponding session. - If logged in on the main site: Create an SMF session.
  13. Personally, I've been thinking about purchasing the HTC Hero when it's released in Denmark.
  14. What Mchl said is correct.
  15. There is no reason why you couldn't write a PHP compiler, which is why it has already bee done.
  16. http://dev.mysql.com/doc/refman/5.0/en/charset-connection.html http://php.net/manual/en/function.header.php http://www.ietf.org/rfc/rfc2616.txt Thus: header('Content-type: text/html; charset=utf-8'); And SET NAMES utf8;
  17. As a person who prefers theory, a practically/vocationally oriented course is unappealing to me. Also, a programming language is a means to the goal, not the goal itself. I don't like the strong emphasis they put specifically on C++.
  18. I've got a VPS. A dedicated server would be overkill for my needs.
  19. That's quite a surprise to me. As I said, it is something I would expect from any web host. Then again, I've never purchased shared hosting.
  20. I would expect all webhosts to have that.
  21. Then read the topic you replied to
  22. I'm not sure I entirely understand your problem. However, if your host doesn't support gzip compression via Apache (or they refuse to enable it) you can try to use ob_gzhandler.
  23. You need to make sure you set the connection to utf8 as well. Also remember to send the correct header to the browser. Basically, make sure you use the same character set throughout the entire process from start to finish.
  24. To clarify my post above, it looks like you expect your query to be executed like this: SELECT * FROM `boards` WHERE name!='$board' AND (abb='$abb' OR name='$newBoardName') But that's not the case. It'll be executed like this: SELECT * FROM `boards` WHERE (name!='$board' AND abb='$abb') OR name='$newBoardName' Because: Which is why it's possible that $row['name'] == $board in your result set.
  25. AND has higher precedence than OR.
×
×
  • 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.