[ Index ]

PHP Cross Reference of MyBB 1.8.38

title

Body

[close]

/inc/ -> functions_upload.php (summary)

MyBB 1.8 Copyright 2014 MyBB Group, All Rights Reserved Website: http://www.mybb.com License: http://www.mybb.com/about/license

File Size: 969 lines (28 kb)
Included or required: 16 times
Referenced: 0 times
Includes or requires: 1 file
 inc/functions_image.php

Defines 12 functions

  get_php_upload_limit()
  remove_attachment()
  remove_attachments()
  remove_avatars()
  create_attachment_index()
  upload_avatar()
  upload_attachment()
  check_parse_php_upload_err()
  add_attachments()
  delete_uploaded_file()
  delete_upload_directory()
  upload_file()

Functions
Functions that are not part of a class:

get_php_upload_limit()   X-Ref
Get maximum upload filesize limit set in PHP
return: int maximum allowed filesize

remove_attachment($pid, $posthash, $aid)   X-Ref
Remove an attachment from a specific post
param: int $pid The post ID
param: string $posthash The posthash if available
param: int $aid The attachment ID

remove_attachments($pid, $posthash="")   X-Ref
Remove all of the attachments from a specific post
param: int $pid The post ID
param: string $posthash The posthash if available

remove_avatars($uid, $exclude="")   X-Ref
Remove any matching avatars for a specific user ID
param: int $uid The user ID
param: string $exclude A file name to be excluded from the removal

create_attachment_index($path)   X-Ref
Create the attachment directory index file.
param: string $path The path to the attachment directory to create the file in.

upload_avatar($avatar=array()   X-Ref
Upload a new avatar in to the file system
return: array Array of errors if any, otherwise filename of successful.
param: array $avatar Incoming FILE array, if we have one - otherwise takes $_FILES['avatarupload']
param: int $uid User ID this avatar is being uploaded for, if not the current user

upload_attachment($attachment, $update_attachment=false)   X-Ref
Upload an attachment in to the file system
return: array Array of attachment data if successful, otherwise array of error data
param: array $attachment Attachment data (as fed by PHPs $_FILE)
param: boolean $update_attachment Whether or not we are updating a current attachment or inserting a new one

check_parse_php_upload_err($FILE)   X-Ref
Check whether the input $FILE variable indicates a PHP file upload error,
and if so, return an appropriate user-friendly error message.

return: string Error message or empty if no error detected.
param: array $FILE File data (as fed by PHP's $_FILE).

add_attachments($pid, $forumpermissions, $attachwhere, $action=false)   X-Ref
Process adding attachment(s) when the "Add Attachment" button is pressed.
return: array Array of errors if any, empty array otherwise
param: int $pid The ID of the post.
param: array $forumpermission The permissions for the forum.
param: string $attachwhere Search string "pid='$pid'" or "posthash='".$db->escape_string($mybb->get_input('posthash'))."'"
param: string $action Where called from: "newthread", "newreply", or "editpost"

delete_uploaded_file($path = '')   X-Ref
Delete an uploaded file both from the relative path and the CDN path if a CDN is in use.
return: bool Whether the file was deleted successfully.
param: string $path The relative path to the uploaded file.

delete_upload_directory($path = '')   X-Ref
Delete an upload directory on both the local filesystem and the CDN filesystem.
return: bool Whether the directory was deleted.
param: string $path The directory to delete.

upload_file($file, $path, $filename="")   X-Ref
Actually move a file to the uploads directory
return: array The uploaded file
param: array $file The PHP $_FILE array for the file
param: string $path The path to save the file in
param: string $filename The filename for the file (if blank, current is used)



2005 - 2021 © MyBB.de | Alle Rechte vorbehalten! | Sponsor: netcup Cross-referenced by PHPXref