Fixed embargoed time settings is not kept in the form when re-editing by error

This commit is contained in:
patrickslee 2006-01-18 04:14:50 +00:00
parent 46dce76ab2
commit cc86131d78

View File

@ -250,6 +250,22 @@
if (! $discussion = get_record("forum_discussions", "id", $post->discussion)) {
error("This post is not part of a discussion! ($post->discussion)");
}
} else {
$discussion = new stdClass();
$newstopic = false;
if ($forum->type == 'news' && !$post->parent) {
$newstopic = true;
}
if ($newstopic && empty($post->timestartdisabled)) {
$discussion->timestart = make_timestamp($post->timestartyear, $post->timestartmonth, $post->timestartday);
} else {
$discussion->timestart = 0;
}
if ($newstopic && empty($post->timeenddisabled)) {
$discussion->timeend = make_timestamp($post->timeendyear, $post->timeendmonth, $post->timeendday);
} else {
$discussion->timeend = 0;
}
}
} else if (!empty($forum)) { // User is starting a new discussion in a forum