mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
Issue #2162: Clear the news item cache after submitting a comment so the comment counter remains accurate.
This commit is contained in:
@@ -42,13 +42,14 @@ class news_event // plugin-folder + '_event'
|
|||||||
{
|
{
|
||||||
if($data['comment_type'] !== 'news' && !empty($data['comment_type']))
|
if($data['comment_type'] !== 'news' && !empty($data['comment_type']))
|
||||||
{
|
{
|
||||||
file_put_contents(e_LOG."news.event.log", print_r($data,true));
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($data['comment_item_id']))
|
if(!empty($data['comment_item_id']))
|
||||||
{
|
{
|
||||||
e107::getDb()->update("news", "news_comment_total=news_comment_total+1 WHERE news_id=".intval($data['comment_item_id']));
|
$id = intval($data['comment_item_id']);
|
||||||
|
e107::getDb()->update("news", "news_comment_total=news_comment_total+1 WHERE news_id=".$id);
|
||||||
|
e107::getCache()->clear('news_php_extend_'.$id.'_');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user