Uutiset:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu
Advertisement:

New Topics are appearing 1 Day old.. PLEASE HELP

Aloittaja Rohan_, kesäkuu 06, 2011, 06:30:59 AP

« edellinen - seuraava »

Rohan_

Hello,

I am having problems with the timing or something like that..

Please see this picture



I have just posted that topic but it's showing 1 Days ago

What is the problem ? SMF's time is set to my local time and it's correct.. on right side it shows Today but on left side below topic's title it shows 1 day ago..

I have this code in my messageindex.template

<small id="pages' . $topic['first_post']['id'] . '">', $topic['pages'], '</small>';
                  $today = @getdate(time());
                  $days = ceil(($today[0] - $topic['first_post']['timestamp']) / 86400 );
                  if($days <= 0) {
                     echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - Today</div>';
                  } else {
                     echo '<div style="font-size: 10px; padding: 2px;">', $topic['first_post']['member']['name'], ' - ', $days, ' days ago</div>';
                  }


And my overtall time ofset is Admin > Features and options > Overall Time Ofset > -4.5
Proud To Be An Indian

sharks

#1
I think it's a conflict between your server time and personal offset time in your profile... Unless you already modified some files to that effect which caused that error?

Try this:
Go to your admin panel > Features and Options > Overall time offset > usually, you set this time to GMT, which is what i did on my forums.

Next, go to your profile > Look and Layout Preferences > Time Offset: > click on the "(auto detect)" link.
Save by clicking on the "Change Profile" button at the lower-right of the page.

Then check the post again, to see if the time has been fixed. If not, then your files or database might have some problem.
Try doing maintenance.
Then, run forum upgrade package again as the last option.

Rohan_

I haven't made any changed to my forum... I just have moved my site to another host..

And about profile settings.. I want it to do for every single visitor of the website..

Also see the last post column at right side in my above posted picture.. That one is showing Today How is that showing Today ? Can't we do the same for this too ?
Proud To Be An Indian

Rohan_

Solved The Issue.. My Forum's Overall Time Ofset was -4.5 which was 24 hour back from the current time.. so I set it to 19.5 and everything is fine now..

But I want help in another thing.

In my above posted code there is a line

                  $days = ceil(($today[0] - $topic['first_post']['timestamp']) / 86400 );

So When a topic get's 24 hour old it shows 1 day old..

But i don't want 24 hour system.. I want the system from 12:01AM to 11:59PM

So just when the date changes the topic should be 1 day old instead of waiting for 24 hours
Proud To Be An Indian

Rohan_

Proud To Be An Indian

Aleksi "Lex" Kilpinen

By default I believe SMF separates today / yesterday by their date, not by how old the topics actually are ...
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Rohan_

actually I solved it long ago.. The problem was that i moved my site to new server and the time of site was 24hour old so i changed the time offset to current time and it went ok
Proud To Be An Indian

Aleksi "Lex" Kilpinen

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: