Please wait, Page is Loading...
 

Summary: Another PmWiki download manager supporting multiple directories.
Version:1.0c (30–11–2007)
Prerequisites:Pmwiki 2.x
Status: Devel
Maintainer: Dfolio
Download: CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php  (md5sum: ebc08af689fb90d811b52d0351b369a1)
Categories: PmWiki | PHP

Description

Another PmWiki download manager supporting multiple directories.

Features

This CookBook aims at providing a (new) enhanced download manager.

  • Enhanced indirect download (ie. $EnableDirectDownload=0, see PmWiki:UploadVariables#EnableDirectDownload): use a flat data base (DB) to register files to download.
    This allows to protect attachments using a page’s read permissions, but also increases the load on the server. Thus, this improve security: no server based URI is posted direct to the files is used. The files are retrieved according is name (at least with ${Group}/${Name}) or a file ID.
  • Multiple download repository: files allowed to download could be in a single directory (eg $UploadDir, send with Attach:xxx), or other directories, such as: ‘downloads’, ‘public’, ‘images’…
  • It was related with Cookbook:DownloadManager which keeps track of every file download and displays the counter next to it.

!! Notes

Installation

Download the script CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php and place it in your cookbook directory. Then, in your local configuration (local/config.php), add the following line:

 include_once("$FarmD/cookbook/down.php"); 

Configuration:

Before including the CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php you may give a value to the following variables in your local configuration (local/config.php) before including CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php :

  • $DownDirs: an array of directory where you store your downloadable files.
    • Default value: SDV($DownDirs,array("$UploadDir","downloads");
    • Important: The given directories are automaticaly recursively browsed. You may had exclude dirs/files to $DownExcludeDirs and/or $DownExcludePatterns (see below).
  • $DownExcludeDirs: an array of files/dirs to not add and recurse (strict string match)
  • $DownExcludeDirPattern: a string pattern of files/dirs to not add and recurse (regexp match)
  • $DownDB: the flat file where to store downloadable file info

See CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php recipe for further detail about customizable variable

Usage

The CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php script replace the default PmWiki download system. It’s simply replace the default Download:downname (which is close to the usual syntax Attach:downname). This script also add the ‘short cut’ Down:downname to handle download.

The given target (ie downname) could be a simple filename, if the file is attached in the current $Group. Otherwise you must specify the corresponding $Group. If the file to download is not stored in the $UploadDir (eg. not an attached file), then this script look in the DB, and try to find the given downname, by first considering only the downname and secondary according to $Group/downname

Example

* Download:CookBook/down.php

Down Markup

The CookBook/down.php[CookBook/down.php] Type: application/x-php Taille:54,8 Ko Dernière modification:30/11/2007 15:09Mime:php recipe also provide the following markup:

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it’s often easier for people to work with “release dates” instead of “version numbers”.

30.11.2007 :: Dfolio :: 1.0c

  • Fix some bugs
  • Adding (:downDB:) markup which allow to view the data base contents (I recommand to place this markup only on page with security access, eg Site.XXX)

26.10.2007 :: Dfolio :: 1.0b

  • Add new markup (:downMd5:), (:downStats:)
  • (+minor bug fix)

26.10.2007 :: Dfolio :: 1.0a

Public release

09.10.2007 :: Dfolio :: 1.0

First implementation

!! Todo


« UsefullFunc | CookBook | Google Ad Sense »

Commentaire

Remark, suggestion post a comment:

Signer en tant qu'auteur 
Website 

Veuillez indiquer un nom d'auteur, et entrer la valeur du code (limite le spam...). Merci.


  • Add This
  • Add
  • Get
  • Google

default