add event news_created

This commit is contained in:
xiaomlove
2024-04-03 04:05:04 +08:00
parent 4ad0d7a1eb
commit 8d07ad98f7
5 changed files with 46 additions and 4 deletions

View File

@@ -48,8 +48,10 @@ if ($action == 'add')
$notify = 'no';
sql_query("INSERT INTO news (userid, added, body, title, notify) VALUES (".sqlesc($CURUSER['id']) . ", $added, " . sqlesc($body) . ", " . sqlesc($title) . ", " . sqlesc($notify).")") or sqlerr(__FILE__, __LINE__);
$Cache->delete_value('recent_news',true);
if (mysql_affected_rows() != 1)
stderr($lang_news['std_error'], $lang_news['std_something_weird_happened']);
if (mysql_affected_rows() != 1) {
stderr($lang_news['std_error'], $lang_news['std_something_weird_happened']);
}
fire_event("news_created", mysql_insert_id());
header("Location: " . get_protocol_prefix() . "$BASEURL/index.php");
}