EXT: kk_downloader

Extension Key: kk_downloader

Copyright 2008, Kurt Kunig, <kurt.kunig@kupix.de>

Copyright 2000-2002, Sebastian Baumann, <sb@sitesystems.de>
Thanks Sebastian for the Initial idea and the source code until 0.1.2

This document is published under the Open Content License

available from http://www.opencontent.org/opl.shtml

The content of this document is related to TYPO3

- a GNU/GPL CMS/Framework available from www.typo3.com

Table of Contents

EXT: kk_downloader	1

Introduction	1

What does it do?	1

Credits (look into the changelog at the end of this manual):	1

Screenshots	2

User manual	3

Install the Extension	3

Create the sites (data folder, ...)	3

Add Categories and Partners in the data folder	3

Configure the options: LIST-view	4

Configure the options: SINGLE-view	4

Template setup - configuration	5

Reference	5

Used Markers	9

Static css file	9

Standard HTML-Template	10

FAQ	11

Changelog	12

Introduction

What does it do?

Download system with many features. Displays downloads with short description, click counter, file size and image preview. It is possible to create a detail site of each download.

Credits (look into the changelog at the end of this manual):

From Sebastian: Thanks to Kurt Kunig (www.kupix.de) for several add-ons and manual revision.

From Kurt: Thanks to Sebastian Baumann for the initial idea and the source base of version 0.1.2

Screenshots

Standard without image preview:

Standard with image preview:

Complete list of all downloads (no “starting point” selected and “plugin.tx_kkdownloader_pi1.defaultDownloadPid = all” and a separate html-template selected in the typoscript setup):

User manual

To setup and use the extension, you should do the following:

Install The Extension

Create Or Set a Data Folder (Sysfolder, named “download-container” e.g.) and point on himself in the field “General Record Storage page“! This is important for finding the categories later on!
You can also put a download object into a “normal” page instead of a sysfolder; the sysfolder then is only for the general categories. Don't forget to point to that sysfolder from this page in the “General Record Storage Page”.

Add Categories and Downloads into this data sysfolder or the downloads into the page where he should be visible.

Create a new page and add the Extension (and add download items if they are not in a sysfolder)

Configure the options

Install the Extension

The first step you need to do is to install the extension – kk_downloader -- with the extension manager. You can get it by going to Tools section and choosing “Ext Manager” on the main action menu (usually on left-side). Then in the dropdown Menu at the top, select “Import Extensions” in the Menu at top. Then type “kk_downloader” in the “Extensions in TYPO3 Extension Repository” and click on the “Look up” button. You should then find this extension.

If you have never installed this, then you will see a red arrow to the left of “kk_downloader” and you can click on that to install. If it has been installed, you can click on the green arrow to the left of the extension or the name of the extension and then load the newest version by clicking on the Import/Update button. It is highly recommended to install the newest extension in the "local" folder (LOCAL: typo3conf/ext/kk_downloader).

Create the sites (data folder, ...)

You have to create several pages. The usual way is to create one sysfolder where the records and categories are saved in.
It´s possible to create the extension records in normal sites but we recommend to use a new Storage Folder because there can be many records and you can keep everything in one place.

Create a page where the LIST view appears

Create a page where the SINGLE view appears (not absolutely needed)

Create a SYSFOLDER named “download-container” e.g. beyond your site with LIST view.

On each page you have to set the “General record store page” to your (category-)sysfolder.

Put the plugin into your page(s) template with “Include static (from extensions)” = “kk_downloader” and put the desired parameters in.

Set the plugin-configuration into the template setup box. You can copy and paste it from this manual if you want (see below)

Add Categories and Partners in the data folder

Click on “Create new record” and choose one of the following:

Categorie for a new categorie and Download for a new partner record. You have to add first your categories, because you need the categories to add a new partner record (only in the sb_downloader-version!). Here in this version categories are no longer mandatory fields! The form fields are self-explanatory.

Configure the options: LIST-view

After you create a page and add the extension, you have to edit the Flexform to get the right settings.

Flexform options

New since version 1.2.0: browse max. n items per page

Configure the options: SINGLE-view

The same as above, only choose SINGLE instead of LIST!

A page with the plugin SINGLE view should not be cached! Please set it in the page options.

What you have to look for!

Tell the plugin the ID of the page with the single view:

You have the possibility to edit the following plugin properties via setup:
plugin.tx_kkdownloader_pi1.singlePID = 28 (e.g.)

Put the marker ###MORE### into your HTML-template {This link will be inactive if a) the singlePID is not given or has a wrong UID or b) the correct singlePID-page has the hidden status.

Template setup - configuration

Reference

plugin_tx_kkdownloader_pi1.

Property:	Data type:	Description:	Default:
debug	Boolean	Prints of the Extension will appear on screen	false
linkdescription	integer	If no linktitle set: 1 = filename.fileextension, 2 = filename 3 = fileextension	1
downloadIcon	string	Path to download icon (complete – e.g. downloadIcon = typo3conf/ext/kk_downloader/pi1/images/down load.gif) or Path to the folder, where the fileicons are: (e.g. downloadIcon = typo3/gfx/fileicons/) This path must end with a Slash! Result: the corrosponding icons to the fileextension will be shown, just like “pdf.gif” e.g. - Kurt Kunig	
missingDownloadIcon	string	If the path is set typo3/gfx/fileicons/ you can set a default download icon if a icon is missing (e.g. for rar files)	typo3conf/ext/kk_downloader/pi1/images/download.gif
templateFile	String	Path to template file	typo3conf/ext/kk_downloader/kk_download_template.html
defaultDownloadPid	integer/string	# PID of the general download folder (if no page-"starting-point" is set) integer: PID of a page-object string: 'all' → ALL downloads will be selected	'all'
singlePID	integer	Pid of the detail page	empty
displayCreationDate	boolean	Decission to display the date of the crdate behind the download-number or not displayCreationDate (1 = yes, 0 = no) - additional array-elements in locallang.xml	
dateformat	->stdWrap	Here you can set the date formating for the template-marker: ###DATE###. Example: plugin.tx_kkdownloader_pi1 { dateformat= l, d.m.Y } This will display the date in content elements like this: “Monday, 31.03.2008 ”.	
datetimeformat	->stdWrap	e.g. used for formatting the date-output of the download-file datetimeformat = d.M.Y H:m	
timeformat	->stdWrap	Here you can set the date formating for the template-marker: ###DATE###. Example: plugin.tx_kkdownloader_pi1 { timeformat= H:i } This will display the time in content elements like this: “12:03”.	
imageDistance	String	Distance between Image and text	5
Image	->imgResource ->stdWrap	Configurates the image(s) in news items. Example: image{ file.maxW = 140 imageLinkWrap = 0 imageLinkWrap { enable = 1 bodyTag = <BODY bgColor=white> wrap = | width = 400m height = 400 JSwindow = 1 JSwindow.newWindow = 1 JSwindow.expand = 17,20 } } see: TSref->imgResource	
fileMDateClass	String	Span-class for LastMod-date of the download file e.g. fileMDateClass = sb_fileMDateClass	empty
filesizeClass	String	class for the display of the file-size e.g. filesizeClass = sb_filesize_class	empty
parseFunc	Array	Render content of the field “longdescription”, converts LINK-entries into a-tags e.g. parseFunc < lib.parseFunc parseFunc not set => Content will only be rendered with the php-method “nl2br( )”	parseFunc_RTE
results_at_a_time	Integer	limit of single items on one list-page used with LIST for page-browsing. Can be overwritten in flexform (see screenshot above)	25
pageBrowser.maxPages	Integer	Maximum x pages will be shown	10
pageBrowser.showPBrowserText	Boolean	should pagebrowser-text be shown	true
pageBrowser. showResultCount	boolean	Should the list result (Item 1 to 5 of 23) be shown?	true
pageBrowser { activepage_stdWrap.wrap page_stdWrap.wrap pagelink_stdWrap.wrap previous_stdWrap.wrap next_stdWrap.wrap }	stdWrap	Wrapping the active page	<strong>|</strong> | | | |

If you want to modify variables from locallang.xml you can also do this here in the typoscript setup:

plugin_tx_kkdownloader_pi1._LOCAL_LANG.

Property:	Data type:	Description:	Default:
default.bracketstart = \n[ de.bracketstart = (	string	A \n in all locallang.parameter means a linefeed “<br />” after rendering	\n(
default.bracketend = ] de.bracketend = )	string	Dto.	)
default.category_text = Cat. de.category_text = Kat.	string		Category: Kategorie:
default.downloads	string		downloads
default.novalue	string		No data
default.notemplate	string		No HTML-template. Neither in the flexform nor in the template-setup!?
default.filesize	string		Filesize:
default.fileMDate	string		File date:
default.since	string		since:
default.oclock	string		o´clock
default.more	string		[more]
default.lastedit	string		last edit:
default.category_text	string		Category:
a.s.o.		Look into the locallang.xml For all other languages put the language.prefix before the parameter: eg in German: de.category_text = Kategorie	

These are the existing TEXT_...-entries:

default:

<label index="txtTITLE">Title</label>

<label index="txtCATEGORIES">Category</label>

<label index="txtLINKS">Links</label>

<label index="txtSHORTDESCRIPTION">Short description</label>

<label index="txtIMAGE">Download object</label>

<label index="txtCLICKS">downloads</label>

<label index="txtLASTDOWNLOAD">Date last download</label>

<label index="txtIPLASTDOWNLOAD">IP-address of last download</label>

<label index="txtDATE">since: </label>

<label index="txtLASTEDIT">This record was last edited at </label>

<label index="txtFILE">Download file name</label>

<label index="txtFILESIZE">Size of download-file</label>

<label index="txtFILEMDATE">File date last changed</label>

de (German):

<label index="txtTITLE">Titel</label>

<label index="txtCATEGORIES">Kategorie</label>

<label index="txtLINKS">Links</label>

<label index="txtSHORTDESCRIPTION">Kurzbeschreibung</label>

<label index="txtIMAGE">Download-Objekt</label>

<label index="txtCLICKS">Downloads</label>

<label index="txtLASTDOWNLOAD">zuletzt herunter geladen</label>

<label index="txtIPLASTDOWNLOAD">IP-Adresse des letzten Downloads</label>

<label index="txtDATE">seit</label>

<label index="txtLASTEDIT">Datum der letzten Veränderung</label>

<label index="txtFILE">Dateiname</label>

<label index="txtFILESIZE">Dateigröße</label>

<label index="txtFILEMDATE">Dateidatum, letzte Änderung</label>

Example

plugin.tx_kkdownloader_pi1 {

# debug the main program yes = 1 / no = 0

debug = 0

# redefine locallang parameters

_LOCAL_LANG.de.bracketstart = (

# template

templateFile = typo3conf/ext/kk_downloader/kk_download_template.html

# PID of the general download folder (if no page-"starting-point" is set)

# either the numeric PID or 'all' for all downloadable files	defaultDownloadPid = all

# PID of the page for a SINGLE view (if wanted)

singlePID = 39

# download description

# (1 = filename.fileextension, 2 = filename, 3 = fileextension)

linkdescription = 1

# date and time format

dateformat = d.M.Y

timeformat = H:i

# used for download-file date & time

datetimeformat = d.M.Y H:m

# span-class for File date and time

fileMDateClass = sb_fileMDateClass

# span-class for displaying the file-size

filesizeClass = sb_filesize_class

# download icon

# if set to typo3/gfx/fileicons/ typo3 standard icons appear

# you can set own images like:

# downloadIcon = typo3conf/ext/kk_downloader/pi1/images/download.gif

downloadIcon = typo3/gfx/fileicons/

# if a download icon is missing (e.g. *.rar)

missingDownloadIcon = typo3conf/ext/kk_downloader/pi1/images/download.gif

# distance around image

imageDistance = 5

# image settings

image{

file.maxW = 120

imageLinkWrap = 1

imageLinkWrap {

enable = 1

bodyTag = <BODY bgColor=white>

wrap = <A href="javascript:close();"> | </A>

width = 400m

height = 400

JSwindow = 1

JSwindow.newWindow = 1

JSwindow.expand = 17,20

}

}

}

Used Markers

###TITLE###	Title of download
###CATEGORIES###	Category Name
###LINKS###	All download links with filesize in brackets and download icon
###SHORTDESCRIPTION###	Short description of doanload(s)
###DESCRIPTION###	Detailled description of the download object(s)
###MORE###	Link to detailview
###IMAGE###	Preview image
###CLICKS###	Download counter
###LASTDOWNLOAD###	Date and time of the last download
###IPLASTDOWNLOAD###	IP-address of the downloader
###DATE###	Creation date (and time)
###LASTEDIT###	Last edit date
used in the additional template "###TEMPLATE_FILE_DETAIL###":
###FILE###	file-name including the file-icon
###FILEMDATE###	date of last modification of the file
###FILESIZE###	filesize of links
###ICON###	File-extension icon

Static css file

You can insert the static css file via “Include static (from extensions)” in the template of your page (or rootpage)

Standard HTML-Template

<!-- List Template -->

<!-- ###TEMPLATE### begin -->

<!-- BEGIN: Content of extension "kk_downloader", plugin "kk_downloader" -->

<div id="kkdl_flexWrap">

<!-- ###CONTENT### begin-->

<!-- ###LIST_ITEM### begin -->

<div class="kkdl_flex">

<h2 class="title">###TITLE###</h2>

<div class="category_class">###TEXT_CATEGORIES###: ###CATEGORIES###</div>

<div class="kkdl_text">

<div class="links">###LINKS###</div>

<div class="description">###SHORTDESCRIPTION###</div>

###MORE###

</div>

<div class="kkdl_image">###IMAGE###</div>

<div style="clear: both"></div>

<div class="clicks">###CLICKS### ###TEXT_CLICKS###</div>

<div class="datetime">###TEXT_LASTDOWNLOAD###: ###LASTDOWNLOAD###</div>

<div class="description">###TEXT_IPLASTDOWNLOAD###: ###IPLASTDOWNLOAD###</div>

<div class="datetime">###TEXT_LASTEDIT###: ###LASTEDIT###</div>

</div>

<!-- ###LIST_ITEM### end -->

<!-- ###CONTENT### end-->

</div>

<!-- END Content of extension "kk_downloader", plugin "kk_downloader" -->

<!-- ###TEMPLATE### end -->

<!-- Single Template -->

<!-- ###TEMPLATE_SINGLE### begin -->

<div class="kkdl_single">

<h2 class="title">###TITLE###</h2>

<div class="category_class">###CATEGORIES###</div>

<div class="kkdl_text">

<div class="links">###LINKS###</div>

<p class="bodytext">

<b>###TEXT_SHORTDESCRIPTION###:<br />###SHORTDESCRIPTION###</b>

<br />###DESCRIPTION###

</p>

</div>

<div class="kkdl_image">###IMAGE###</div>

<div style="clear: both"></div>

<div class="clicks">###CLICKS### ###TEXT_CLICKS### <span class="datetime">###TEXT_DATE### ###DATE###</span></div>

<div class="datetime">###TEXT_LASTDOWNLOAD###: ###LASTDOWNLOAD###</div>

<div class="description">###TEXT_IPLASTDOWNLOAD###: ###IPLASTDOWNLOAD###</div>

<div class="datetime">###TEXT_LASTEDIT###: ###LASTEDIT###</div>

</div>

<!-- ###TEMPLATE_SINGLE### end -->

<!-- Single Template -->

<!-- N E W : Template for detailled file information

! This part will replace the marker ###LINKS### in the other templates above, if existing.

! If not, the marker ###LINKS### will be rendered as it used to be.

-->

<!-- ###TEMPLATE_DETAIL### begin -->

<!-- ###LINK_ITEM### begin -->

<div class="kkdl-details">

###FILE### ###ICON###

<br />###TEXT_FILESIZE###: ###FILESIZE###

<br />###TEXT_FILEMDATE###: ###FILEMDATE###

</div>

<!-- ###LINK_ITEM### end -->

<!-- ###TEMPLATE_DETAIL### end -->

FAQ

I can´t insert categories in a new partner record.

You have to put your SysFolder into the “General Record Storage page” resp. “starting point” of your page.
Sometimes it is better to create a general storag page (sysfolder) for the categories and then put this one into the above mentioned field of the sysfolder that takes the download files in.

When I upload a file I got the message that the filesize shoud be too large?
Upload file size is limited by a variable in the base configuration.

Changelog

Please look into the cangelog-file of the extension under /typo3conf/ext/kk_downloader/ChangeLog

Ext: kk_downloader - 12

EXT: sb_downloader

Kasper Skårhøj

2002-11-01T00:32:00

Kurt Kunig

Kasper Skårhøj