/sources/downloads2.php

Description
Functions
add_download (line 622)

Add a download.

  • return: The ID of the newly added download
AUTO_LINK add_download (AUTO_LINK $category_id, SHORT_TEXT $name, URLPATH $url, LONG_TEXT $description, ID_TEXT $author, LONG_TEXT $comments, ?AUTO_LINK $out_mode_id, BINARY $validated, BINARY $allow_rating, SHORT_INTEGER $allow_comments, BINARY $allow_trackbacks, LONG_TEXT $notes, SHORT_TEXT $original_filename, integer $file_size, integer $cost, BINARY $submitter_gets_points, [?AUTO_LINK $licence = NULL], [?TIME $add_date = NULL], [integer $num_downloads = 0], [integer $views = 0], [?MEMBER $submitter = NULL], [?TIME $edit_date = NULL], [?AUTO_LINK $id = NULL])
  • AUTO_LINK $category_id: The ID of the category the download is to be in
  • SHORT_TEXT $name: The name of the download
  • URLPATH $url: The URL to the download
  • LONG_TEXT $description: The description of the download
  • ID_TEXT $author: The author of the download (not necessarily same as the submitter)
  • LONG_TEXT $comments: The comments for the download
  • ?AUTO_LINK $out_mode_id: The out-mode-id (the ID of a download that this download is an old version of). Often people wonder why this is specified with the old version, and not the opposite with the new version - it is because statistically, we perceive more chance of downloads merging than splitting (NULL: none)
  • BINARY $validated: Whether the download has been validated
  • BINARY $allow_rating: Whether the download may be rated
  • SHORT_INTEGER $allow_comments: Whether comments are allowed (0=no, 1=yes, 2=review style)
  • BINARY $allow_trackbacks: Whether the download may be trackbacked
  • LONG_TEXT $notes: Hidden notes pertaining to the download
  • SHORT_TEXT $original_filename: The downloads original filename (the URL may be obfuscated)
  • integer $file_size: The file size of the download (we can't really detect this in real-time for remote URLs)
  • integer $cost: The cost of the download that members will have to pay to get it
  • BINARY $submitter_gets_points: Whether the submitter gets the points for the download (they are selling it) (otherwise they are just thrown out, which is an alternative model - one of enforcing community point building)
  • ?AUTO_LINK $licence: The licence to use (NULL: none)
  • ?TIME $add_date: The add date for the download (NULL: now)
  • integer $num_downloads: The number of downloads that this download has had
  • integer $views: The number of views that this download has had
  • ?MEMBER $submitter: The submitter (NULL: current user)
  • ?TIME $edit_date: The edit date (NULL: never)
  • ?AUTO_LINK $id: Force an ID (NULL: don't force an ID)
add_download_category (line 221)

Add a download category

  • return: The ID of the newly added download category
AUTO_LINK add_download_category (SHORT_TEXT $category, AUTO_LINK $parent_id, LONG_TEXT $description, LONG_TEXT $notes, [URLPATH $rep_image = ''], [?AUTO_LINK $id = NULL])
  • SHORT_TEXT $category: The name of the download category
  • AUTO_LINK $parent_id: The parent download category
  • LONG_TEXT $description: A description
  • LONG_TEXT $notes: Hidden notes pertaining to this download category
  • URLPATH $rep_image: The representative image for the category (blank: none)
  • ?AUTO_LINK $id: Force an ID (NULL: don't force an ID)
add_download_licence (line 788)

Add a download licence.

  • return: The ID of the new download licence
AUTO_LINK add_download_licence (SHORT_TEXT $title, LONG_TEXT $text)
  • SHORT_TEXT $title: The title of the download licence
  • LONG_TEXT $text: The text of the download licence
create_data_mash (line 328)

Create a data-mash from the file at a URL. This is data useful for the search engine.

  • return: The data-mash
LONG_TEXT create_data_mash (URLPATH $url, [?string $data = NULL], [?ID_TEXT $extension = NULL], [boolean $direct_path = false])
  • URLPATH $url: The URL to make a data-mash of, or a filename if $data isn't blank
  • ?string $data: Data (NULL: use URL)
  • ?ID_TEXT $extension: File extension (NULL: get from URL)
  • boolean $direct_path: Whether a direct file path was given instead of a URL
delete_download (line 740)

Delete a download.

void delete_download (AUTO_LINK $id, boolean $leave)
  • AUTO_LINK $id: The ID of the download to delete
  • boolean $leave: Whether to leave the actual file behind
delete_download_category (line 288)

Delete a download category.

void delete_download_category (AUTO_LINK $category_id)
  • AUTO_LINK $category_id: The download category to delete
delete_download_licence (line 814)

Delete a download licence.

void delete_download_licence (AUTO_LINK $id)
  • AUTO_LINK $id: The ID of the download licence to delete
dload_script (line 33)

Farm out the files for downloads.

void dload_script ()
edit_download (line 691)

Edit a download.

void edit_download (AUTO_LINK $id, AUTO_LINK $category_id, SHORT_TEXT $name, URLPATH $url, LONG_TEXT $description, ID_TEXT $author, LONG_TEXT $comments, AUTO_LINK $out_mode_id, integer $default_pic, BINARY $validated, BINARY $allow_rating, SHORT_INTEGER $allow_comments, BINARY $allow_trackbacks, LONG_TEXT $notes, SHORT_TEXT $original_filename, integer $file_size, integer $cost, BINARY $submitter_gets_points, ?AUTO_LINK $licence, SHORT_TEXT $meta_keywords, LONG_TEXT $meta_description)
  • AUTO_LINK $id: The ID of the download to edit
  • AUTO_LINK $category_id: The ID of the category the download is to be in
  • SHORT_TEXT $name: The name of the download
  • URLPATH $url: The URL to the download
  • LONG_TEXT $description: The description of the download
  • ID_TEXT $author: The author of the download (not necessarily same as the submitter)
  • LONG_TEXT $comments: The comments for the download
  • AUTO_LINK $out_mode_id: The out-mode-id (the ID of a download that this download is an old version of). Often people wonder why this is specified with the old version, and not the opposite with the new version - it is because statistically, we perceive more chance of downloads merging than splitting
  • integer $default_pic: The ordered number of the gallery image to use as the download representative image
  • BINARY $validated: Whether the download has been validated
  • BINARY $allow_rating: Whether the download may be rated
  • SHORT_INTEGER $allow_comments: Whether comments are allowed (0=no, 1=yes, 2=review style)
  • BINARY $allow_trackbacks: Whether the download may be trackbacked
  • LONG_TEXT $notes: Hidden notes pertaining to the download
  • SHORT_TEXT $original_filename: The downloads original filename (the URL may be obfuscated)
  • integer $file_size: The file size of the download (we can't really detect this in real-time for remote URLs)
  • integer $cost: The cost of the download that members will have to pay to get it
  • BINARY $submitter_gets_points: Whether the submitter gets the points for the download (they are selling it) (otherwise they are just thrown out, which is an alternative model - one of enforcing community point building)
  • ?AUTO_LINK $licence: The licence to use (NULL: none)
  • SHORT_TEXT $meta_keywords: Meta keywords
  • LONG_TEXT $meta_description: Meta description
edit_download_category (line 249)

Edit the given download category with the new details given

void edit_download_category (SHORT_TEXT $category, AUTO_LINK $parent_id, LONG_TEXT $description, AUTO_LINK $category_id, LONG_TEXT $notes, URLPATH $rep_image, ?SHORT_TEXT $meta_keywords, ?LONG_TEXT $meta_description)
  • SHORT_TEXT $category: The name of the download category
  • AUTO_LINK $parent_id: The parent download category
  • LONG_TEXT $description: A description
  • AUTO_LINK $category_id: The ID of the category being edited
  • LONG_TEXT $notes: Hidden notes pertaining to this download category
  • URLPATH $rep_image: The representative image for the category (blank: none)
  • ?SHORT_TEXT $meta_keywords: Meta keywords for this resource (NULL: do not edit)
  • ?LONG_TEXT $meta_description: Meta description for this resource (NULL: do not edit)
edit_download_licence (line 803)

Edit a download licence.

void edit_download_licence (AUTO_LINK $id, SHORT_TEXT $title, LONG_TEXT $text)
  • AUTO_LINK $id: The ID of the download licence to edit
  • SHORT_TEXT $title: The title of the download licence
  • LONG_TEXT $text: The text of the download licence
init__downloads2 (line 24)

Standard code module initialisation function.

void init__downloads2 ()
log_download (line 833)

Log a file download, update the downloads counter and the download bandwidth counter.

void log_download (AUTO_LINK $id, integer $size, boolean $got_before)
  • AUTO_LINK $id: The ID of the download being downloaded
  • integer $size: The size of the download (if zero, no bandwidth will be done - zero implies either an empty file, or a remote file that doesn't affect our bandwidth)
  • boolean $got_before: Whether the download has been downloaded before

Documentation generated on Sun, 02 Jan 2011 23:13:28 +0000 by phpDocumentor 1.4.3