Differences

This shows you the differences between the selected revision and the current version of the page.

punbb13:extensions:pun_attachment 2009/07/16 08:01 punbb13:extensions:pun_attachment 2020/02/06 11:04 current
Line 2: Line 2:
[[punbb13:extensions#Official extensions|PunBB 1.3 official extension]] [[punbb13:extensions#Official extensions|PunBB 1.3 official extension]]
  * Status: **Under development**   * Status: **Under development**
-  * Current version: **1.0a.1**+  * Current version: **[[https://punbb.informer.com/extensions/pun_attachment/pun_attachment.zip|1.0.2]]** 
===== Specification ===== ===== Specification =====
==== Functionality ==== ==== Functionality ====
- Allows users to attach files to posts, partially based on Attachment Mod by Frank Hagstrom.+Allows users to attach files to posts, partially based on Attachment Mod by Frank Hagstrom.
==== Interface ==== ==== Interface ====
  * Link "Attachments" in the "Settings" tab in administration menu.   * Link "Attachments" in the "Settings" tab in administration menu.
  * Attachments settings page:   * Attachments settings page:
-    * "Disable attachments" option. If checked uploading and downloading files will be disabled. +    * "Disable attachments" option. If checked, uploading and downloading of files will be disabled. 
-    * "Create orphans" option. If this option enabled, attachments will not be removed from the database, when a user wants to delete a post with these attachments. +    * "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, which is denied for uploading (comma separated). +    * "Always deny" option. The list of file extensions that are disallowed from uploading (comma separated). 
-    * "Display images" option. Images will be display on the viewtopic/edit page, which size is smaller than parameters below.+    * "Display images" option. Images will be displayed on the viewtopic/edit page, whose size is smaller than the parameters below.
    * "Max height" parameter.     * "Max height" parameter.
    * "Min height" parameter.     * "Min height" parameter.
-    * "Use icons" option. Enable displaying icons.+    * "Use icons" option. Enables displaying icons.
    * List of icons.     * List of icons.
  * Link "Attachments" in the "Management" tab in administration menu.   * Link "Attachments" in the "Management" tab in administration menu.
Line 30: Line 31:
      * Result sort order       * Result sort order
      * Show only "orphans".       * Show only "orphans".
-    * Fields of attachments page:+    * Fields of the attachments page:
      * Filename       * Filename
      * Filesize       * Filesize
Line 37: Line 38:
      * MIME-type       * MIME-type
      * Downloads count.       * Downloads count.
-  * Editing group's permission page:+  * Editing group's permissions page:
    * Additional options:     * Additional options:
      * Allow users to download files       * Allow users to download files
Line 45: Line 46:
      * Maximum size of file for uploading       * Maximum size of file for uploading
      * Attacments per post (maximum count of attachments per post)       * Attacments per post (maximum count of attachments per post)
-      * The list of files, which is allowed for downloading (comma separated).+      * A list of files that are allowed for downloading (comma separated).
  * Viewtopic page:   * Viewtopic page:
-    * List of post's attachments with information about each of them.+    * A list of post's attachments with information about each of them.
  * Edit post page:   * Edit post page:
-    * List of post's attachments with delete button of the attachment.+    * A list of post's attachments with delete button for each attachment.
==== Database ==== ==== Database ====
Line 55: Line 56:
^ Field ^ Type ^ Default ^ Description^ ^ Field ^ Type ^ Default ^ Description^
| __id__ | INT(10) |  | Auto-increment attachment ID.  | | __id__ | INT(10) |  | Auto-increment attachment ID.  |
-| owner_id | INT(10) |  | User who downloaded the attachment. | +| owner_id | INT(10) |  | The user who downloaded the attachment. | 
-| post_id | INT(10) |  | ID of post, where file was attached. | +| post_id | INT(10) |  | ID of the post the file was attached to. | 
-| topic_id | INT(10) |  | Topic ID of post, where file was attached. | +| topic_id | INT(10) |  | Topic ID of post the file was attached to. | 
-| filename | VARCHAR(255) | | Name of the file. |+| filename | VARCHAR(255) | | Name of the the file. |
| file_ext | VARCHAR(64) |  | Extension of the file. | | file_ext | VARCHAR(64) |  | Extension of the file. |
| file_mime_type | VARCHAR(64) |  | MIME-type of the file. | | file_mime_type | VARCHAR(64) |  | MIME-type of the file. |
Line 64: Line 65:
| download_counter | INT(10) |  0  | Downloads count of the file. | | download_counter | INT(10) |  0  | Downloads count of the file. |
| uploaded_at | INT(10) |  | Time when the attachment was uploaded. | | uploaded_at | INT(10) |  | Time when the attachment was uploaded. |
-| secure_str | VARCHAR(32) |  NULL  | This string allow to limit count of attachments per post in post's writing. |+| 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. Additional fields in the **"groups"** table.
Line 74: Line 75:
| g_pun_attachment_upload_max_size | TINYINT(1) | 2000000 | Maximum size of file for uploading (in bytes). | | 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_files_per_post | TINYINT(3) | 1 | Maximum count of attachments per post. |
-| g_pun_attachment_disallowed_extensions | VARCHAR(64) |  | Extensions of allowed files for uploading (comma separated). |+| g_pun_attachment_disallowed_extensions | VARCHAR(64) |  | Extensions of files allowed for uploading (comma separated). |
Additional config values in the **"config"** table. Additional config values in the **"config"** table.
Line 93: Line 94:
-===== Feature Requests ===== +
-  * Add hooks inside the extensions so 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// +
-  * 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]''+
===== Specification ===== ===== Specification =====
==== pun_attachment 1.0a, 1.0b ==== ==== pun_attachment 1.0a, 1.0b ====
 +=== Bugs ===
 +  * <del>Use Query Builder for all queries, especially when alter or create table.</del>
 +  * <del>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.</del>
 +  * <del>When a user edits a message with an image attachment, and its size more than the size of an avatar:</del>
 +    - Error appears: ''Notice: Undefined variable: attach_info in …\edit.php(345) : eval()'d code on line 53''
 +    - the attachment form is not displayed correctly.
 +  * <del>Viewing of an attachment image:</del>
 +    - Little padding in the heading
 +    - In breadcrumbs, “attachment” should be a link
 +    - Add an indent for dowhload links at the bottom of the page.
 +  * <del>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.</del>
 +  * <del>Group permissions: a user can add an image with a block extension.</del>
 +  * <del>Viewing a post with an attachment image, when its size is more than an avatar's: no link to see a full size image.</del>
 +  * <del>Some times all NEW attaches are not showed in NEW posts during viewing topics</del> (see [[https://punbb.informer.com/forums/post/124633/#p124633|Forums topic]] for details)
 +  * <del>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).''</del>
==== pun_attachment 1.0 ==== ==== pun_attachment 1.0 ====
-  * Basic functions was implemented.+  * 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. 
 +  * <del>Add a checkbox in the admin panel to forbid guests to attach files.</del> //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 ====== ====== See also ======
Line 109: Line 132:
====== Links ====== ====== Links ======
-  * Trac tickets: :?:+  * Trac tickets: [[https://punbb.informer.com/trac/ticket/250|#250]]
  * Browse code:   * Browse code:
-    * Trac: [[http://punbb.informer.com/trac/browser/additions/punbb-1.3/extensions/pun_attachment/|Source]], [[http://punbb.informer.com/trac/log/additions/punbb-1.3/extensions/pun_attachment/|Log]] +    * Trac: [[https://punbb.informer.com/trac/browser/additions/punbb-1.3/extensions/pun_attachment/|Source]], [[https://punbb.informer.com/trac/log/additions/punbb-1.3/extensions/pun_attachment/|Log]] 
-    * SVN: [[http://punbb.informer.com/svn/additions/punbb-1.3/extensions/pun_attachment/|/svn/additions/punbb-1.3/extensions/pun_attachment/]] +    * SVN: [[https://punbb.informer.com/svn/additions/punbb-1.3/extensions/pun_attachment/|/svn/additions/punbb-1.3/extensions/pun_attachment/]] 
-  * Forums topic: :?: +  * Forums topic: [[https://punbb.informer.com/forums/topic/20135/attachment-extension/|discussion]] 
-  * [[http://punbb.informer.com/extensions/|PunBB extension repository]]+  * [[https://punbb.informer.com/extensions/|PunBB extension repository]]
===== Screenshots ===== ===== Screenshots =====

Personal Tools