Home « Server software «
Documentation: images/edit.php
images/edit.php - Upload a new image or update an existing one
If no anchor has been provided to host the image, this script will create one. The title given for the image, or the file name, will be used as the page title. On direct uploads the sender will have the opportunity to select in which section the article has to be created. By default the article will be posted in the first public section appearing at the site map.Depending on the user selection, the image upload may be followed by one action among following option:
- insert at the top of the page - reserved to associates on first upload
- append at the bottom of the page
- append at the bottom of the page, and set as thumbnail
- use as page icon
- use as page thumbnail
If the anchor is a section or a category, the previous list is changed to:
- insert at the top of the page - reserved to associates on first upload
- append at the bottom of the page
- use as page icon
- use as page thumbnail
- use as bullet
If the anchor is a user profile, the list is changed to:
- insert at the top of the page - reserved to associates on first upload
- append at the bottom of the page
- use as user avatar --animated image files are accepted
If an image is set as the page icon, it is also used as the default thumnail for this page.
A button-based editor is used for the description field. It's aiming to introduce most common codes supported by YACS.
The content of the uploaded file is checked to ensure we have a valid image, that is, a .GIF, .JPG or .PNG image.
Also the uploaded image is automatically resized if it is too large, to limit its width and weight. There are different limits for standard images and for avatars, all set in the configuration panel for rendering. Associates can explicitly ask for no resizing, to manage specific situations (high-resolution photos).
Lastly, a thumbnail image is automatically created.
This script attempts to validate the new or updated article description against a standard PHP XML parser. The objective is to spot malformed or unordered HTML and XHTML tags. No more, no less.
The permission assessment is based upon following rules applied in the provided orders:
- uploads can have been administratively disallowed
- associates and editors are allowed to move forward
- permission is denied if the anchor is not viewable
- surfer owns the image (= he is the last editor)
- this is a new post and the surfer is an authenticated member and submissions are allowed
- permission denied is the default
Anonymous (not-logged) surfer are invited to register to be able to post new images.
A button-based editor is used for the description field. It's aiming to introduce most common codes supported by YACS.
The edition time is not limited at all. Some Javascript code polls the server in the background to ensure that session data is not lost during all the time the browser window is opened.
Accepted calls:
- edit.php upload an image and create an article to host it
- edit.php/<type>/<id> create a new image for this anchor
- edit.php?anchor=<type>:<id> upload a new image for the anchor
- edit.php/<id> modify an existing image
- edit.php?id=<id> modify an existing image
If the anchor for this item specifies a specific skin (option keyword '
skin_xyz
'),
or a specific variant (option keyword 'variant_xyz
'), they are used instead default values.This script is a reference file of this system.
Voir aussi:
Licence: GNU Lesser General Public License
Auteurs:
- Bernard Paques bernard.paques@bigfoot.com
- Vincent Noël
- GnapZ
Testeurs:
- Viviane Zaniroli
- Kedare
- Guillaume Perez
- Timster
- Ekilibre
Reste à faire:
- allow for the upload of an archive of files