protected function afterAdd($object) { $id = $this->object->id; if (!empty($id)) { $object = new SmartBlogPost($id); date_default_timezone_set(Configuration::get('PS_TIMEZONE')); // $object->id_author = $this->context->employee->id; $object->id_author = 1; $object->modified = date('Y-m-d H:i:s'); if (strpos($object->created, '0000-00-00') !== FALSE || empty($object->created)) { $object->created = date('Y-m-d H:i:s'); } $object->update(); BlogCategory::updateAssocCat($object->id); $this->post_format_fields = smartblog::$post_meta_fields; $this->updateMetaFields($object); Hook::exec('actionsbnewpost'); } }