Revision 643
Added by thorn almost 18 years ago
| save_post.php | ||
|---|---|---|
| 25 | 25 |
|
| 26 | 26 |
require('../../config.php');
|
| 27 | 27 |
|
| 28 |
require_once(WB_PATH."/include/jscalendar/jscalendar-functions.php"); |
|
| 29 |
|
|
| 28 | 30 |
// Get id |
| 29 | 31 |
if(!isset($_POST['post_id']) OR !is_numeric($_POST['post_id'])) {
|
| 30 | 32 |
header("Location: ".ADMIN_URL."/pages/index.php");
|
| ... | ... | |
| 45 | 47 |
$title = $admin->add_slashes($admin->get_post('title'));
|
| 46 | 48 |
$short = $admin->add_slashes($admin->get_post('short'));
|
| 47 | 49 |
$long = $admin->add_slashes($admin->get_post('long'));
|
| 48 |
$publishedwhen = strtotime($admin->get_post('publishdate'));
|
|
| 49 |
$publisheduntil = strtotime($admin->get_post('enddate'));
|
|
| 50 | 50 |
$commenting = $admin->get_post('commenting');
|
| 51 | 51 |
$active = $admin->get_post('active');
|
| 52 | 52 |
$old_link = $admin->get_post('link');
|
| ... | ... | |
| 102 | 102 |
change_mode($filename); |
| 103 | 103 |
} |
| 104 | 104 |
|
| 105 |
// get publisedwhen and publisheduntil |
|
| 106 |
$publishedwhen = jscalendar_to_timestamp($admin->get_post('publishdate'));
|
|
| 107 |
if($publishedwhen == '' || $publishedwhen < 1) |
|
| 108 |
$publishedwhen=0; |
|
| 109 |
$publisheduntil = jscalendar_to_timestamp($admin->get_post('enddate'), $publishedwhen);
|
|
| 110 |
if($publisheduntil == '' || $publisheduntil < 1) |
|
| 111 |
$publisheduntil=0; |
|
| 112 |
|
|
| 105 | 113 |
// Update row |
| 106 | 114 |
$database->query("UPDATE ".TABLE_PREFIX."mod_news_posts SET group_id = '$group_id', title = '$title', link = '$post_link', content_short = '$short', content_long = '$long', commenting = '$commenting', active = '$active', published_when = '$publishedwhen', published_until = '$publisheduntil', posted_when = '".mktime()."', posted_by = '".$admin->get_user_id()."' WHERE post_id = '$post_id'");
|
| 107 | 115 |
|
Also available in: Unified diff
Had to fix some strtotime()-related issues in admin/pages/sections and module news to use with PHP4.