Adding an extra field to Post, and make that available in Display.

Started by darrenbeige, October 01, 2009, 02:07:01 AM

Previous topic - Next topic

darrenbeige

$_SERVER['REQUEST_TIME'] is tied to the user's timezone isn't it? It's generated by SMF isn't it?

Arantor

No, it's generated by the webserver from the HTTP request. It 'should' be right but I would never suggest relying on it. Then again this isn't a modification you're distributing, so you can afford not to worry quite so much about it if it works on your forum.

darrenbeige

Is it? It never seems to be generated elsewhere on my site.

Arantor

Anything in $_SERVER should be generated by the server as per the PHP manual for $_SERVER, though I can well imagine SMF populating it on versions < 5.1.

But generally, time() will have exactly the same value in anyway.

darrenbeige

If it's already stored in $_SERVER['REQUEST_TIME'] then why do I need to generate it again in time()?

I'll probably stick to $_SERVER['REQUEST_TIME']. Like you say, it doesn't need to be to-the-second accurate.

Arantor

Because if you change hosting it may not be available if the host is not prompt in updating it.

time() is one of those things that will always be available, while $_SERVER variables are not. But, if it works for you stick with it.

darrenbeige

I'm not releasing the code, so the $_SERVER variable is fine for me. SMF Error Console will inform me if the variable goes astray.

I'm putting the 'Hot Articles' on hold though, 'cos I've just found an error in my Modify code. Can't fix it now though, I'll have to wait until later.

Advertisement: