Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
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'));
-
Simply do like strtotime($sqldate . ' +2 days'); The variable you pass to it must of course be a valid date for strtotime.
-
Main Site: Remembering page/anchor after login/register
Daniel0 replied to .josh's topic in PHPFreaks.com Website Feedback
Hmm... it should do that. The version in SVN does anyway, so when that's rolled out it'll be fixed. -
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.
-
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.
-
What's wrong with my Fibonacci scoring system?
-
function score($level) { if ($level == 0) return 0; if ($level == 1) return 1; return score($level - 2) + score($level - 1); }
-
Nope... truncation rounds towards 0 where as flooring rounds towards -∞.
-
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.
-
Switch your end and start dates. You're selecting the rows outside that date range.
-
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.
-
A question about PHPFreaks home page
Daniel0 replied to dpacmittal's topic in PHPFreaks.com Website Feedback
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. -
Personally, I've been thinking about purchasing the HTC Hero when it's released in Denmark.
-
A question about PHPFreaks home page
Daniel0 replied to dpacmittal's topic in PHPFreaks.com Website Feedback
What Mchl said is correct. -
There is no reason why you couldn't write a PHP compiler, which is why it has already bee done.
-
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;
-
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++.
-
I've got a VPS. A dedicated server would be overkill for my needs.
-
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.
-
I would expect all webhosts to have that.
-
Then read the topic you replied to
-
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.
-
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.
-
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.
-
AND has higher precedence than OR.