@ -532,13 +532,9 @@ function delete_forum_forumcategory_thread($content, $id)
{
$tool_constant=TOOL_FORUM_THREAD;
$return_message=get_lang('ThreadDeleted');
}
api_item_property_update($_course,$tool_constant,$id,"delete",api_get_user_id()); // note: check if this returns a true and if so => return $return_message, if not => return false;
}
api_item_property_update($_course,$tool_constant,$id,'delete',api_get_user_id()); // note: check if this returns a true and if so => return $return_message, if not => return false;
//delete_attachment($post_id);
return $return_message;
}
@ -562,6 +558,7 @@ function delete_post($post_id)
$sql="DELETE FROM $table_posts WHERE post_id='".Database::escape_string($post_id)."'"; // note: this has to be a recursive function that deletes all of the posts in this block.
@ -1639,7 +1635,14 @@ function store_thread($values)
'".Database::escape_string($visible)."')";
api_sql_query($sql, __LINE__, __FILE__);
$last_post_id=Database::insert_id();
// now have to update the thread table to fill the thread_last_post field (so that we know when the thread has been updated for the last time)
$sql="UPDATE $table_threads SET thread_last_post='".Database::escape_string($last_post_id)."' WHERE thread_id='".Database::escape_string($last_thread_id)."'";
$result=api_sql_query($sql, __LINE__, __FILE__);
$message=get_lang('NewThreadStored');
// Storing the attachments if any
if ($has_attachment)
{
@ -1670,16 +1673,19 @@ function store_thread($values)
$sql='INSERT INTO '.$forum_table_attachment.'(filename,comment, path, post_id,size) '.
// now have to update the thread table to fill the thread_last_post field (so that we know when the thread has been updated for the last time)
$sql="UPDATE $table_threads SET thread_last_post='".Database::escape_string($last_post_id)."' WHERE thread_id='".Database::escape_string($last_thread_id)."'";
$result=api_sql_query($sql, __LINE__, __FILE__);
$message=get_lang('NewThreadStored').'<br/>';
}
else
{
$message.='<br/>';
}
if ($current_forum['approval_direct_post']=='1' AND !api_is_allowed_to_edit())