Good morning everybody,
right now I'm developing a modification for a WoltLab Burning Board for a friend of mine, who thought it might be a good idea to enable the administrators of this forum to write announcements in advance, which are shown on a predefined day in the future.
So far, so good. In order to give you a clue what I did, I give you the piece of code in question in hope someone is able to help me, beacause I must have made a mistage somewhere.
if(checkpermissions("can_time_newthread")==1 && $_POST['r_timercheck']=="0"){
$day=intval($_POST['day']);
$month=intval($_POST['month']);
$year=intval($_POST['year']);
$hour=intval($_POST['hour']);
$time=mktime(0,0,0,$month,$day,$year);
$time+=$hour;
$threadtimer=1;
}
else{
$time=time();
$threadtimer=0;
}
What I did is, I give the administrator some simple dropdown-boxes at the end of the inputform, where he or she is able to define the date and time at which the new thread will first appear in the list of threads. The above code just evaluates formdata and creates a unix-timestamp to be inserted as starttime of the thread.
When I write something in advance of let's say a fortknight everything's working fine, but if I dare to set the date and time to a month from now on, the timestamp lacks a total of exactly 3600 seconds, so the output of my given date (2004-03-29 9 pm comes forth as 2004-03-29 8 pm).
I have no idea where the missing hour could've been lost on it's way into the database.