Translations of this page: en bg cs de fi fr hu it ja pl ru tr zh

Attachments (pun_attachment)

PunBB 1.3 official extension

  • Status: Under development
  • Current version: 1.0.2

Specification

Functionality

Allows users to attach files to posts, partially based on Attachment Mod by Frank Hagstrom.

Interface

  • Link “Attachments” in the “Settings” tab in administration menu.
  • Attachments settings page:
    • “Disable attachments” option. If checked, uploading and downloading of files will be disabled.
    • “Create orphans” option. If this option is enabled, attachments will not be removed from the database when a user deletes a post with these attachments.
    • “Always deny” option. The list of file extensions that are disallowed from uploading (comma separated).
    • “Display images” option. Images will be displayed on the viewtopic/edit page, whose size is smaller than the parameters below.
    • “Max height” parameter.
    • “Min height” parameter.
    • “Use icons” option. Enables displaying icons.
    • List of icons.
  • Link “Attachments” in the “Management” tab in administration menu.
  • Attachments management page:
    • Filters:
      • Start at
      • Number to show
      • Filesize
      • Owner
      • Topic
      • Order by
      • Result sort order
      • Show only “orphans”.
    • Fields of the attachments page:
      • Filename
      • Filesize
      • Owner
      • Uploaded date
      • MIME-type
      • Downloads count.
  • Editing group's permissions page:
    • Additional options:
      • Allow users to download files
      • Allow users to upload files
      • Allow users to delete files
      • Allow users to delete his own file
      • Maximum size of file for uploading
      • Attacments per post (maximum count of attachments per post)
      • A list of files that are allowed for downloading (comma separated).
  • Viewtopic page:
    • A list of post's attachments with information about each of them.
  • Edit post page:
    • A list of post's attachments with delete button for each attachment.

Database

New table attach_files.

Field Type Default Description
id INT(10) Auto-increment attachment ID.
owner_id INT(10) The user who downloaded the attachment.
post_id INT(10) ID of the post the file was attached to.
topic_id INT(10) Topic ID of post the file was attached to.
filename VARCHAR(255) Name of the the file.
file_ext VARCHAR(64) Extension of the file.
file_mime_type VARCHAR(64) MIME-type of the file.
file_path TEXT Path to the file.
download_counter INT(10) 0 Downloads count of the file.
uploaded_at INT(10) Time when the attachment was uploaded.
secure_str VARCHAR(32) NULL This string allows to limit count of attachments per post in post's writing.

Additional fields in the “groups” table.

Field Type Default Description
g_pun_attachment_allow_download TINYINT(1) 1 Permission of users group to download file.
g_pun_attachment_allow_upload TINYINT(1) 1 Permission of users group to upload file.
g_pun_attachment_allow_delete TINYINT(1) 0 Permission of users group to delete files.
g_pun_attachment_allow_delete_own TINYINT(1) 1 Permission of users group to delete own files.
g_pun_attachment_upload_max_size TINYINT(1) 2000000 Maximum size of file for uploading (in bytes).
g_pun_attachment_files_per_post TINYINT(3) 1 Maximum count of attachments per post.
g_pun_attachment_disallowed_extensions VARCHAR(64) Extensions of files allowed for uploading (comma separated).

Additional config values in the “config” table.

conf_name conf_value (default)
attach_always_deny html,htm,php,php3,php4,exe,com,bat
attach_basefolder extensions/pun_attachment/attachments
attach_create_orphans 1
attach_icon_folder <FORUM_URL>/extensions/pun_attachment/img/
attach_icon_extension txt,doc,pdf,wav,mp3,ogg,avi,mpg,mpeg,png,jpg,jpeg,gif
attach_icon_name text.png,doc.png,doc.png,audio.png,audio.png,audio.png,video.png,video.png,video.png,image.png,image.png,image.png,image.png
attach_subfolder Generates upon the installation.
attach_use_icon 1
attach_disp_small 1
attach_small_height 60
attach_small_width 60
attach_disable_attach 0

Specification

pun_attachment 1.0a, 1.0b

Bugs

  • Use Query Builder for all queries, especially when alter or create table.
  • When a user adds an image, and the size of the attachment is more than the size of the avatars button, the attachment form is not displayed correctly.
  • When a user edits a message with an image attachment, and its size more than the size of an avatar:
    1. Error appears: Notice: Undefined variable: attach_info in …\edit.php(345) : eval()'d code on line 53
    2. the attachment form is not displayed correctly.
  • Viewing of an attachment image:
    1. Little padding in the heading
    2. In breadcrumbs, “attachment” should be a link
    3. Add an indent for dowhload links at the bottom of the page.
  • When a user tries to add a file with the php-extension, it is added successfully, but in settings php-files are blocked from being attached.
  • Group permissions: a user can add an image with a block extension.
  • Viewing a post with an attachment image, when its size is more than an avatar's: no link to see a full size image.
  • Some times all NEW attaches are not showed in NEW posts during viewing topics (see Forums topic for details)
  • Delete any thread while there is a table prefix set: The error occurred on line 333 in …/pun_attachment/include/attach_func.php Database reported: Table 'site_db.posts' doesn't exist (Errno: 1146).

pun_attachment 1.0

  • Known bugs of alpha and beta versions were fixed. Basic functions were implemented:
    • Uploading, downloading, removing attachments
    • Group permissions for working with attachments
    • Managing attachments in administration menu
    • Aforementioned options in administration menu.

Feature Requests

  • Add hooks inside the extensions so that it were possible to enhance this extension for one's own needs.
  • Add a checkbox in the admin panel to forbid guests to attach files. Can be done via group's permissions in pun_attachment 1.0
  • Add a checkbox in the admin panel to make images larger than given dimensions be shown as thumbnails.
  • Add a possibility to embed images (or their thumbnails, depending on their size) into posts with BBCode, e. g. [file]image.gif[/file]

See also

Links

Screenshots

Attachments settings page:

Attachments manage page:

Additional options on group's permissions editing page:

Post with attachment:

Editing page of topic with attachments:


Personal Tools