Skip to content
This repository was archived by the owner on Aug 13, 2022. It is now read-only.

Documentation

hvorragend edited this page Aug 15, 2011 · 1 revision

MediaAttach Documentation

What is MediaAttach?

MediaAttach is a hook module enhancing other modules with upload functionality. In the admin panel you can create different definitions describing the presettings for each module. The goal behind MediaAttach is exculpating module developers from building own upload functionalities. MediaAttach is a Zikula only module.

Installation

  1. copy MediaAttach into the modules directory of Zikula
  2. regenerate the modules list within the Modules administration
  3. initialise and activate MediaAttach
  4. edit the hooks of your favored modules and activate MediaAttach for them
  5. go to the admin area of MediaAttach
  6. configure MediaAttach (see chapter 4)

Update

  1. Remove all files of the old version (much files have become unnecessary)
  2. copy MediaAttach into the modules directory of Zikula
  3. regenerate the modules list within the Modules administration
  4. initialise and activate MediaAttach
  5. edit the hooks of your favored modules and activate MediaAttach for them
  6. go to the admin area of MediaAttach
  7. configure the new settings of MediaAttach (see chapter 4)

Configuration

In the configuration area several things must be set:

  • '''Upload Directory''' The directory in which all files and directories are being stored by MediaAttach. The following points have to be considered here:
    • The directory has to be specified absolutely. There must not be a slash at the end.
    • The upload directory must be writable for the web server (chmod 777), therewith the files can be stored in it. You will see on the configuration page if this is true.
    • In the optimum case the upload directory is outside the webroot directory which you can see one line above the input. This prohibits the directory (and the contained files) from being accessible over the internet. If there are open_basedir restrictions defined in PHP the directory must not be outside the directories allowed there. Further down you can see in the table with values from php.ini if open_basedir is set in your installation.
    • If you can not create the directory outside the webroot for some reason (i.e. this is not allowed with shared hosting often), MediaAttach offers still a possibility to protect the uploads against direct access. Once the upload directory is writable you see a new formular under the configuration, with which you can create a .htaccess file at the push of a button.
  • '''Cache Directory''' The directory containing the image thumbnails MediaAttach creates. This directory must be inside the webroot, so that the thumbnails are readable by the user's browser. This directory must also be writable (chmod 777). It is being specified as a address being relative from the webroot.
  • '''Mail Function''' You can see this option only if you have the Mailer module from Zikula installed and activated. If you select this setting logged in users get the possibility to send mails fith files to themselves. You must fill out another field here to specify the maximum size a file may have to be allowed for sending it within a mail.
  • '''Activate quotas''' Turn the quota functionality on or off (more in chapter 2).
  • '''Allow handling of own files''' With this option you may allow your users to edit and delete their own files, independant from the normal permission system which will be explained further in chapter 8.
  • '''Default sizes of thumbnails''' MediaAttach creates thumbnails of uploaded images automatically. Here you can define their sizes. You can define multiple thumbnail sets to use alternatives for different purposes.
  • '''Shrink images automatically'''
  • '''Maximum image size''' If you want MediaAttach shrinks all images exceeding a particular size.
  • '''Allow thumbnail cropping'''
  • '''Behaviour of selection tool''' If this is set to not changeable, the default thumbnail size will be enforced in the selection tool. If this setting is changed to variable, users can also crop preview images in other sizes.
  • '''Activate frontpage in user area'''
  • '''Categorization options''' MediaAttach does not have a public area as default. But you can unlock it and therefore use MediaAttach as an official download module. The files can be grouped by categories, modules and users. Please note that the public area contains all files for which the actual user has permissions – independent of what is set in the definitions of the according modules. In the table with the values from php.ini you see important settings relating uploading of files. The following describes the meaning of each single directive:
  • open_basedir See above...
  • upload_tmp_dir Directory where files are stored temporarily after the upload
  • file_uploads Tells if file uploads are activated
  • upload_max_filesize Limits the maximum file size from server side
  • post_max_size Limits the maximum total size of a formular from server side
  • max_input_time Defines the maximum period the processing of an input may last Version check At the bottom you see another block with a version check. Here you are able to notice quickly and easily if new versions of MediaAttach exist. If this is true at this position the links to the download of the newest version will appear directly.

Clone this wiki locally