Skip to content
Fetching latest commit…
Cannot retrieve the latest commit at this time.
..
Failed to load latest commit information.
lang
templates
Changelog
MANIFEST
README
filelist.php
info.txt
settings.php

README

Module  : File List
Version : 1.1.4
Author  : Maurice Makaay <maurice@phorum.org>

This module requires Phorum 5.2 or newer.

This module adds a file list on the read page for a thread, which lists
all attachments that are available in the full thread. The administrator
can configure per forum if and how the file list should be displayed.
The available options per forum are:

* No file list
* Only on the first page
* On every page

From the file list, the user can directly download the file or jump to the
message which has the file attached to it.


Install:
--------

- Unpack the archive;

- Move the directory "filelist" to the directory "mods"
  within your Phorum installation;

- Login as administrator in Phorum's administrative interface and
  go to the "Modules" section;

- Enable the module "File List".

- Configure for what forums you want to display the file list
  by editing the module's settings.

- Either edit the module's settings to automatically display the file
  list after the header and/or before the footer or edit the message
  reading templates (read.tpl, read_threads.tpl and/or read_hybrid.tpl) to
  add the template code {HOOK "tpl_filelist" MOD_FILELIST LANG} at the
  spot where you want the file list to appear. It's suggested to add it
  right before the {LOOP MESSAGES} statements in read.tpl, so the template
  code will look like this:

  ..
  ..
  {HOOK "tpl_filelist" MOD_FILELIST LANG}
  {LOOP MESSAGES}
  ..
  ..

  For read_threads.tpl, it's suggested to add the code right after
  the message options menu and before displaying the current message.


Template customization:
-----------------------

You can create a separate filelist template for each Phorum template that
you are using. Create a directory within the module's templates
directory named mods/filelist/templates/<template> (where <template> is
the name of the Phorum template for which you want to write a customized
module template).

The easiest way is to copy the *.tpl files from the default template
directory to your new directory and start editing those files. In most
cases, you only have to edit the small filelist.tpl.

In the filelist templates, the following template variables can be used:

  Language strings from the module's language file:

    {LANG->mod_filelist->AllFilesFromThread}
    {LANG->mod_filelist->ReadMessage}

  Other useful default language strings:

    {LANG->Filename}
    {LANG->Filesize}
    {LANG->Postedby}
    {LANG->Date}

  Template variable containing data about files:

    {FILES} contains the list of attachment files. You have loop over this
    variable in your template to be able to show info about the files.
    You can do this by using the following code in your template:

      {LOOP FILES}
       ..
      {/LOOP FILES}

    Inside this loop, you can make use of the following template variables:

      {FILES->MESSAGE_ID}    The id of the message to which the file
                             was attached.
      {FILES->FILE_ID}       The id of the file.
      {FILES->NAME}          The name of the file.
      {FILES->SIZE}          The size of the file in human readable format.
      {FILES->RAW_SIZE}      The size of the file as the number of bytes.
      {FILES->USER_ID}       The user_id for the author. Can be empty for
                             posts that were done by unregistered users.
      {FILES->AUTHOR}        The name of the message author.
      {FILES->DATESTAMP}     The date at which the last change in the
                             message data was done.
      {FILES->RAW_DATESTAMP} Last change date in Epoch (seconds since 1970).
      {FILES->URL->FILE}     The download URL for the file.
      {FILES->URL->PROFILE}  The profile page URL for registered authors.
                             Beware that this one can be empty if anonymous
                             users are allowed to attach files too.
      {FILES->URL->READ}     The URL for reading the message to which the
                             file was attached.


Language customization:
-----------------------

This module does support multiple languages. You can add a language by
creating a language file in mods/filelist/lang/<language>.php, where
the filename should be the same as the language filename that you are
using for Phorum itself (i.e. include/lang/<language>.php). The easiest
way is to copy the english.php to the new filename and start editing that
file. If you create a new language file, then please post it to the
module's discussion thread in the Phorum.org forums.

Something went wrong with that request. Please try again.