IP.Board  3.3.0
downloadsFunctions Class Reference

Public Member Functions

 __construct (ipsRegistry $registry)
 canSubmitLinks ()
 canSubmitPaths ()
 checkForMonthlyDirectory ($path, $time=0)
 checkOnline ()
 checkPerms ($file=array(), $modperm='modcanapp', $userperm='')
 getAllowedTypes ($category)
 getFileName ($file)
 getStats ()
 isModerator ()
 obtainRemoteFileSize ($url="")
 rebuildComments ($file_id=0)
 rebuildPendingComments ($file_id=0)
 returnModerators ()
 returnScreenshotUrl ($file, $thumb=true, $checked=false)

Protected Attributes

 $cache
 $caches
 $DB
 $lang
 $member
 $memberData
 $registry
 $request
 $settings
 $total_active = 0

Constructor & Destructor Documentation

__construct ( ipsRegistry registry)

Constructor

public

Parameters:
objectRegistry object
Returns:
void

Member Function Documentation

Can member submit links?

public

Returns:
boolean

Can member import files (submit paths)?

public

Returns:
boolean
checkForMonthlyDirectory ( path,
time = 0 
)

Check for monthly directory and create if necessary

public

Parameters:
stringDirectory to check
Returns:
string Directory to use

Show error message if we're offline

public

Returns:
void
checkPerms ( file = array(),
modperm = 'modcanapp',
userperm = '' 
)

Check permissions to complete an action

public

Parameters:
arrayFile info
stringModerator permission key to check
string"User allowed" setting to check
Returns:
boolean User can do action or not
getAllowedTypes ( category)

Return the allowed mime-types for the category

public

Parameters:
arrayCategory
Returns:
array Allowed file/screenshot types
getFileName ( file)

Get the filename without an extension

public

Parameters:
stringFilename
Returns:
string Filename, no extension
getStats ( )

Grab stats block and display

public

Returns:
void

Is a moderator?

public

Returns:
boolean User is a moderator
obtainRemoteFileSize ( url = "")

(Attempt to) Retrieve the filesize of a remotely hosted file

public

Parameters:
stringURL to file
Returns:
integer File size
rebuildComments ( file_id = 0)

Rebuild the viewable comment count for a file

public

Parameters:
integerFile id
Returns:
boolean
rebuildPendingComments ( file_id = 0)

Rebuild the pending comment count for a file

public

Parameters:
integerFile id
Returns:
boolean

Return all moderators

public

Returns:
array Members who are moderators
returnScreenshotUrl ( file,
thumb = true,
checked = false 
)

Return the screenshot URL. Takes into account whether screenshots are web-accessible or need to be loaded through the PHP handler.

Parameters:
arrayScreenshot file information
boolShow thumbnail?
boolWhether we have already checked for the screenshot (prevents duplicate DB query)
Returns:
string URL to screenshot
Note:
When $thumb is false, we need to return full URL so the watermark/copyright stamping can be applied correctly

The documentation for this class was generated from the following file:
 All Data Structures Functions Variables