[ class tree: plugins ] [ index: plugins ] [ all elements ]

Procedural File: downloadList.php

Source Location: /zp-extensions/downloadList.php

Page Details

A plugin to generate a file download list.

This download folder can be relative to your Zenphoto root ("foldername") or external to it ("../foldername"). By default the "uploaded" folder is chosen so you can use the file manager to manage those files.

You can also override that folder by using the printdownloadList() function parameters directly. Additionally you can set a downloadlink to a specific file directly as well using printDownloadLink('path-to-file');

The file names and the download path of the items are stored with the number of downloads in the database's plugin_storage table.

The download link is something like: http://www.yourdomain.com/download.php?file=<id number nof the download>.

So the actual download source is not public. The list itself is generated directly from the file system. However, files which no longer exist are kept in the database for statistical reasons until you clear them manually via the statistics utility.

You will need to modify your theme to use this plugin. You can use the codeblock fields if your theme supports them or insert the function calls directly where you want the list to appear.

To protect the download directory from direct linking you need to set up a proper .htaccess for this folder.

The list has a CSS class 'downloadList' attached.

Author:  Malte Müller (acrylian)
Classes
Class Description
downloadListOptions Plugin option handling class
Includes
require_once (SERVERPATH.'/'.ZENFOLDER.'/'.PLUGIN_FOLDER.'/downloadList/downloadList-functions.php') [line 345]
[ Top ]


Functions
download_list_custom_options_save  [line 128]
Parameters:
   $notify: 
   $themename: 
   $themealbum: 


void download_list_custom_options_save( $notify, $themename, $themealbum  )

[ Top ]
getDownloadLink  [line 261]

Gets the download url for a file

Parameters:
string   $file:  the path to a file to get a download link.


void getDownloadLink( string $file  )

[ Top ]
getdownloadList  [line 193]

Gets the actual download list included all subfolders and files

Parameters:
string   $dir:  An optional different folder to generate the list that overrides the folder set on the option. This could be a subfolder of the main download folder set on the plugin's options. You have to include the base directory as like this: "folder" or "folder/subfolder" or "../folder" You can also set any folder within or without the root of your Zenphoto installation as a download folder with this directly
string   $listtype:  "ol" or "ul" for the type of HTML list you want to use
array   $filters:  an array of files to exclude from the list. Standard items are '.', '..','.DS_Store','Thumbs.db','.htaccess','.svn'
array   $excludesuffixes:  an array of file suffixes (without trailing dot to exclude from the list (e.g. "jpg")
string   $sort:  'asc" or "desc" (default) for alphabetical ascending or descending list


array getdownloadList( string $dir, array $filters, array $excludesuffixes, string $sort, string $listtype  )

[ Top ]
printDownloadLink  [line 280]

Prints a download link for a file, depending on the plugin options including the downloadcount and filesize

Parameters:
string   $file:  the path to a file to print a download link.
string   $linktext:  Optionally how you wish to call the link. Set/leave to NULL to use the filename.


void printDownloadLink( string $file, [string $linktext = NULL]  )

[ Top ]
printDownloadLinkAlbumZip  [line 306]

Prints a download link for an album zip of the current album (therefore to be used only on album.php/image.php). This function only creates a download count and then redirects to the original Zenphoto album zip download.

Parameters:
   $linktext: 
   $albumobj: 


void printDownloadLinkAlbumZip( [ $linktext = ''], [ $albumobj = '']  )

[ Top ]
printdownloadList  [line 171]

Prints the actual download list included all subfolders and files

Parameters:
string   $dir:  An optional different folder to generate the list that overrides the folder set on the option.
string   $listtype:  "ol" or "ul" for the type of HTML list you want to use
array   $filters:  an array of files to exclude from the list. Standard items are Array( '.', '..','.DS_Store','Thumbs.db','.htaccess','.svn')
array   $excludesuffixes:  an array of file suffixes (without trailing dot to exclude from the list (e.g. "jpg")
string   $sort:  'asc" or "desc" (default) for alphabetical ascending or descending list


void printdownloadList( [string $dir = ''], [string $listtype = 'ol'], [array $filters = array()], [array $excludesuffixes = ''], [string $sort = 'desc']  )

[ Top ]
printdownloadListArray  [line 232]
Parameters:
array   $array:  List of download items
string   $listtype:  "ol" or "ul" for the type of HTML list you want to use


array printdownloadListArray( array $array, [string $listtype = 'ol']  )

[ Top ]


Documentation generated on Tue, 20 Dec 2011 16:07:10 +0100 by phpDocumentor 1.4.3