Pageavatar 2

Lightweight and flexible solution for linking files to pages and lists

PageAvatar is an advanced plugin used to associate pages with any types of files and manage such links. This is a simple yet powerful solution we normally use to build picture galleries for the websites powered by Cotonti Genoa.

How Does It Work?

The plugin is very easy to use. All you have to do is:

  1. Unpack, upload and install Cotlib plugin
  2. Unpack upload and install Pageavatar plugin
  3. Add code snippets to page.add.tpl and page.edit.tpl (or category-specific templates)
  4. Add settings strings for each specific category (see below)
  5. Create folder(s) for file uploads

Page.add.tpl:

Add enctype="multipart/form-data" property to the form

Add plugin tags as follows:

<tr>
<td>{PAGEADD_FORM_AVATAR_TITLE}:</td>
<td>{PAGEADD_FORM_AVATAR}</td>
</tr>

Page.edit.tpl:

Add enctype="multipart/form-data" property to the form

Add plugin tags as follows:

<tr>
<td>{PAGEEDIT_FORM_AVATAR_TITLE}:</td>
<td>
{PAGEEDIT_FORM_AVATAR}
<!-- IF {PAGEEDIT_FORM_AVATARFILE} --><p>{PHP.L.Uploaded}: {PAGEEDIT_FORM_AVATARFILE}<br /> {PHP.L.Delete}: {PAGEEDIT_FORM_AVATARDELETE}</p><!-- ENDIF -->
</td>
</tr>

The structure of a settings string is as follows:

category code | path to uploads folder | thumbnail mask(s) | mandatory? | extension(s) | thumb creation mode

Brief explanation:

  • category code is... the category code (you can use 'all' to deal with all uploads)
  • path is the path to the folder you want to store the files in (we recommend ./datas/smth/)
  • thumbnail mask is best explained with an example: thumb_150-200 (add thumb_ prefix to the filename, height 150, width 200)
  • if you want to specify mandatory upload add 1 here, otherwise 0 (optional)
  • specify extensions you want to restrict uploads with (optional)
  • this is the way you want thumb to be generated: crop is crop, height gives you height priority, width -- width priority, frame means the thumb will stay within the specified height and width

You can now get your image paths in the LIST_ROW regular block or elsewhere, i.e.:

  • ./datas/{LIST_ROW_CAT}/{LIST_ROW_AVATAR} will give you ./datas/shop/page_234.jpg
  • thumb_{LIST_ROW_AVATAR} will give you thumb_page_234.jpg

Should you have any questions or would like to report a bug, feel free to open a topic at the forums.

Version History

  • 2.20 - first public release
  • 2.25 - fixed incorrect thumb generation for the frame mode, fixed extension uppercase problem
  • 2.26 - extrafield title is now created during install
  • 2.27 - added "Force chmod 644" option to fix FTP backup issues

Russian Manual for the Pageavatar Cotonti Plugin


1. Любознательный  2011-06-23 17:36

1. На одном сервере держу несколько сайтов на которых установлен данный плагин. Поскольку после загрузки файлов плагин не проставляет права на файлы то из-за настроек сервера файлы получают права 600 и пользователя-владельца apach что в итоге не позволяет нормально бекапить сайты по фтп (даже в DirectAdmin'е изменить права на файлы нельзя из-за того что владельцем выступает апач - единственным выходом есть использование командыReset Ownership которая в DirectAdmin'е не возможна пакетно, а только по одному файлу). Сделайте пусть простявляет хотя бы права 644

2.Когда выйдет версия для Siena?

 

2. Kort  2011-06-27 19:45
3. Raylandar  2016-04-08 13:40

Broken link

4. Macik  2016-09-10 22:58
Sadece kayıtlı kullanıcılar yeni yorum yapabilir.