dmnkhhn
Active member
Hey,
Has anyone found out how the attachment system works?
An attachment requires a content_type and a content_id - from my understanding I have to create a custom content_type and the content_id refers to the unique id of the content with that custom type.
There are two tables in the database related to the content_type
xf_content_type_field has the name, field name and field value.
content_type = whatever you want, seems to be lowercase, one word only
field_name = no idea
field_value = XenForo_AttachmentHandler_Post which means Post.php in the directory XenForo/AttachmentHandler/
The tricky parts seems to be xf_content_type
content_type = same as above
addon_id = id of the add-on that uses this content type
fields = this field is a mediumblob and I have no idea what it is and what it contains
AFAIK there is no way to create a new content type without doing it in the database so I am wondering if it is even possible to use the XenForo 1 beta 1 attachment system in a custom add-on.
Edit:
Please change the thread title to: Attachments in custom add-ons?
Has anyone found out how the attachment system works?
An attachment requires a content_type and a content_id - from my understanding I have to create a custom content_type and the content_id refers to the unique id of the content with that custom type.
There are two tables in the database related to the content_type
xf_content_type_field has the name, field name and field value.
content_type = whatever you want, seems to be lowercase, one word only
field_name = no idea
field_value = XenForo_AttachmentHandler_Post which means Post.php in the directory XenForo/AttachmentHandler/
The tricky parts seems to be xf_content_type
content_type = same as above
addon_id = id of the add-on that uses this content type
fields = this field is a mediumblob and I have no idea what it is and what it contains
AFAIK there is no way to create a new content type without doing it in the database so I am wondering if it is even possible to use the XenForo 1 beta 1 attachment system in a custom add-on.
Edit:
Please change the thread title to: Attachments in custom add-ons?