Functions

Add an image to a specified gallery.

add_image(\SHORT_TEXT $title, \ID_TEXT $cat, \LONG_TEXT $description, \URLPATH $url, \URLPATH $thumb_url, \BINARY $validated, \BINARY $allow_rating, \BINARY $allow_comments, \BINARY $allow_trackbacks, \LONG_TEXT $notes, \?MEMBER $submitter = null, \?TIME $add_date = null, \?TIME $edit_date = null, integer $views = 0, \?AUTO_LINK $id = null, \?SHORT_TEXT $meta_keywords = '', \?LONG_TEXT $meta_description = '') : \AUTO_LINK
package galleries

Parameters

$title

\SHORT_TEXT

Image title

$cat

\ID_TEXT

The gallery name

$description

\LONG_TEXT

The image description

$url

\URLPATH

The URL to the actual image

$thumb_url

\URLPATH

The URL to the thumbnail of the actual image

$validated

\BINARY

Whether the image has been validated for display on the site

$allow_rating

\BINARY

Whether the image may be rated

$allow_comments

\BINARY

Whether the image may be commented upon

$allow_trackbacks

\BINARY

Whether the image may be trackbacked

$notes

\LONG_TEXT

Hidden notes associated with the image

$submitter

\?MEMBER

The submitter (null: current member)

$add_date

\?TIME

The time of adding (null: now)

$edit_date

\?TIME

The time of editing (null: never)

$views

integer

The number of views

$id

\?AUTO_LINK

Force an ID (null: don't force an ID)

$meta_keywords

\?SHORT_TEXT

Meta keywords for this resource (null: do not edit) (blank: implicit)

$meta_description

\?LONG_TEXT

Meta description for this resource (null: do not edit) (blank: implicit)

Returns

\AUTO_LINKThe ID of the new entry

Add a video to a specified gallery.

add_video(\SHORT_TEXT $title, \ID_TEXT $cat, \LONG_TEXT $description, \URLPATH $url, \URLPATH $thumb_url, \BINARY $validated, \BINARY $allow_rating, \BINARY $allow_comments, \BINARY $allow_trackbacks, \LONG_TEXT $notes, integer $video_length, integer $video_width, integer $video_height, \?MEMBER $submitter = null, \?TIME $add_date = null, \?TIME $edit_date = null, integer $views = 0, \?AUTO_LINK $id = null, \?SHORT_TEXT $meta_keywords = '', \?LONG_TEXT $meta_description = '') : \AUTO_LINK
package galleries

Parameters

$title

\SHORT_TEXT

Video title

$cat

\ID_TEXT

The gallery name

$description

\LONG_TEXT

The video description

$url

\URLPATH

The URL to the actual video

$thumb_url

\URLPATH

The URL to the thumbnail of the actual video

$validated

\BINARY

Whether the video has been validated for display on the site

$allow_rating

\BINARY

Whether the video may be rated

$allow_comments

\BINARY

Whether the video may be commented upon

$allow_trackbacks

\BINARY

Whether the video may be trackbacked

$notes

\LONG_TEXT

Hidden notes associated with the video

$video_length

integer

The length of the video

$video_width

integer

The width of the video

$video_height

integer

The height of the video

$submitter

\?MEMBER

The submitter (null: current member)

$add_date

\?TIME

The time of adding (null: now)

$edit_date

\?TIME

The time of editing (null: never)

$views

integer

The number of views

$id

\?AUTO_LINK

Force an ID (null: don't force an ID)

$meta_keywords

\?SHORT_TEXT

Meta keywords for this resource (null: do not edit) (blank: implicit)

$meta_description

\?LONG_TEXT

Meta description for this resource (null: do not edit) (blank: implicit)

Returns

\AUTO_LINKThe ID of the new entry

Create a video thumbnail.

create_video_thumb(\URLPATH $src_url, \?PATH $expected_output_path = null) : \URLPATH
package galleries

Parameters

$src_url

\URLPATH

Video to get thumbail from (must be local)

$expected_output_path

\?PATH

Where to save to (null: decide for ourselves)

Returns

\URLPATHThumbnail, only valid if expected_output_path was passed as NULL (blank: could not generate)

Delete a specified image from the database, and delete the file if possible.

delete_image(\AUTO_LINK $id, boolean $delete_full = true
package galleries

Parameters

$id

\AUTO_LINK

The ID of the image

$delete_full

boolean

Whether to delete the actual file also

Delete a video in a specified gallery.

delete_video(\AUTO_LINK $id, boolean $delete_full = true
package galleries

Parameters

$id

\AUTO_LINK

The ID of the entry to delete

$delete_full

boolean

Whether to delete the actual video file from disk as well as the entry

Edit an image in a specified gallery.

edit_image(\AUTO_LINK $id, \SHORT_TEXT $title, \ID_TEXT $cat, \LONG_TEXT $description, \URLPATH $url, \URLPATH $thumb_url, \BINARY $validated, \BINARY $allow_rating, \BINARY $allow_comments, \BINARY $allow_trackbacks, \LONG_TEXT $notes, \SHORT_TEXT $meta_keywords, \LONG_TEXT $meta_description, \?TIME $edit_time = null, \?TIME $add_time = null, \?integer $views = null, \?MEMBER $submitter = null, boolean $null_is_literal = false
package galleries

Parameters

$id

\AUTO_LINK

The ID of the image to edit

$title

\SHORT_TEXT

Image title

$cat

\ID_TEXT

The gallery name

$description

\LONG_TEXT

The image description

$url

\URLPATH

The URL to the actual image

$thumb_url

\URLPATH

The URL to the thumbnail of the actual image

$validated

\BINARY

Whether the image has been validated for display on the site

$allow_rating

\BINARY

Whether the image may be rated

$allow_comments

\BINARY

Whether the image may be commented upon

$allow_trackbacks

\BINARY

Whether the image may be trackbacked

$notes

\LONG_TEXT

Hidden notes associated with the image

$meta_keywords

\SHORT_TEXT

Meta keywords

$meta_description

\LONG_TEXT

Meta description

$edit_time

\?TIME

Edit time (null: either means current time, or if $null_is_literal, means reset to to NULL)

$add_time

\?TIME

Add time (null: do not change)

$views

\?integer

Number of views (null: do not change)

$submitter

\?MEMBER

Submitter (null: do not change)

$null_is_literal

boolean

Determines whether some NULLs passed mean 'use a default' or literally mean 'set to NULL'

Edit a video in a specified gallery.

edit_video(\AUTO_LINK $id, \SHORT_TEXT $title, \ID_TEXT $cat, \LONG_TEXT $description, \URLPATH $url, \URLPATH $thumb_url, \BINARY $validated, \BINARY $allow_rating, \BINARY $allow_comments, \BINARY $allow_trackbacks, \LONG_TEXT $notes, integer $video_length, integer $video_width, integer $video_height, \SHORT_TEXT $meta_keywords, \LONG_TEXT $meta_description, \?TIME $edit_time = null, \?TIME $add_time = null, \?integer $views = null, \?MEMBER $submitter = null, boolean $null_is_literal = false
package galleries

Parameters

$id

\AUTO_LINK

The ID of the entry to edit

$title

\SHORT_TEXT

Video title

$cat

\ID_TEXT

The gallery name

$description

\LONG_TEXT

The video description

$url

\URLPATH

The URL to the actual video

$thumb_url

\URLPATH

The URL to the thumbnail of the actual video

$validated

\BINARY

Whether the video has been validated for display on the site

$allow_rating

\BINARY

Whether the video may be rated

$allow_comments

\BINARY

Whether the video may be commented upon

$allow_trackbacks

\BINARY

Whether the video may be trackbacked

$notes

\LONG_TEXT

Hidden notes associated with the video

$video_length

integer

The length of the video

$video_width

integer

The width of the video

$video_height

integer

The height of the video

$meta_keywords

\SHORT_TEXT

Meta keywords

$meta_description

\LONG_TEXT

Meta description

$edit_time

\?TIME

Edit time (null: either means current time, or if $null_is_literal, means reset to to NULL)

$add_time

\?TIME

Add time (null: do not change)

$views

\?integer

Number of views (null: do not change)

$submitter

\?MEMBER

Submitter (null: do not change)

$null_is_literal

boolean

Determines whether some NULLs passed mean 'use a default' or literally mean 'set to NULL'

Get width,height,length of a video file. Note: unfortunately mpeg is not possible without huge amounts of code.

get_video_details(\PATH $file_path, string $filename, boolean $delay_errors = false) : \~array
package galleries

Parameters

$file_path

\PATH

The path to the video file

$filename

string

The original filename of the video file (so we can find the file type from the file extension)

$delay_errors

boolean

Whether to skip over errored files instead of dying. We don't currently make use of this as our readers aren't sophisticard enough to properly spot erroneous situations.

Returns

\~arrayThe triplet of width/height/length (possibly containing NULL's for when we can't detect properties) (false: error)

See whether a gallery is NOT a download gallery (designed as a filter).

only_conventional_galleries(\ID_TEXT $cat) : boolean
package galleries

Parameters

$cat

\ID_TEXT

The gallery name

Returns

booleanWhether the gallery is NOT a download gallery

See whether a gallery is a download gallery (designed as a filter).

only_download_galleries(\ID_TEXT $cat) : boolean
package galleries

Parameters

$cat

\ID_TEXT

The gallery name

Returns

booleanWhether the gallery is a download gallery

See whether a gallery accepts some media (designed as a filter).

only_galleries_accepting_media(\ID_TEXT $cat) : boolean
package galleries

Parameters

$cat

\ID_TEXT

The gallery name

Returns

booleanWhether the gallery accepts some media

See whether the GET parameter 'id' is of a gallery that is a member gallery of the given member gallery container, or just a normal gallery.

only_member_galleries_of_id(\ID_TEXT $cat, \?MEMBER $member_id, integer $child_count) : boolean
package galleries

Parameters

$cat

\ID_TEXT

The gallery name

$member_id

\?MEMBER

Member we are filtering for (null: not needed)

$child_count

integer

The number of children for this gallery

Returns

booleanThe answer

Read an integer from the given binary chunk. The integer is in intel endian form.

read_intel_endian_int(string $buffer) : integer
package galleries

Parameters

$buffer

string

The binary chunk

Returns

integerThe integer

Read an integer from the given binary chunk. The integer is in network endian form.

read_network_endian_int(string $buffer) : integer
package galleries

Parameters

$buffer

string

The binary chunk

Returns

integerThe integer

Render an image box.

render_image_box(array $row, \ID_TEXT $zone = '_SEARCH', boolean $give_context = true, boolean $include_breadcrumbs = true, \?ID_TEXT $root = null, \ID_TEXT $guid = '') : \Tempcode
package galleries

Parameters

$row

array

The image row

$zone

\ID_TEXT

The zone the galleries module is in

$give_context

boolean

Whether to include context (i.e. say WHAT this is, not just show the actual content)

$include_breadcrumbs

boolean

Whether to include breadcrumbs (if there are any)

$root

\?ID_TEXT

Virtual root to use (null: none)

$guid

\ID_TEXT

Overridden GUID to send to templates (blank: none)

Returns

\TempcodeThe rendered box

Render a video box.

render_video_box(array $row, \ID_TEXT $zone = '_SEARCH', boolean $give_context = true, boolean $include_breadcrumbs = true, \?ID_TEXT $root = null, \ID_TEXT $guid = '') : \Tempcode
package galleries

Parameters

$row

array

The video row

$zone

\ID_TEXT

The zone the galleries module is in

$give_context

boolean

Whether to include context (i.e. say WHAT this is, not just show the actual content)

$include_breadcrumbs

boolean

Whether to include breadcrumbs (if there are any)

$root

\?ID_TEXT

Virtual root to use (null: none)

$guid

\ID_TEXT

Overridden GUID to send to templates (blank: none)

Returns

\TempcodeThe rendered box

Get preview detailing for a video.

show_video_details(array $myrow) : \Tempcode
package galleries

Parameters

$myrow

array

The database row of the video

Returns

\TempcodeThe preview

Note that a zencoder transcode has failed.

store_transcoding_failure(\ID_TEXT $transcoder_id) 
package galleries

Parameters

$transcoder_id

\ID_TEXT

Transcoding ID

Handle that a transcode has worked.

store_transcoding_success(\ID_TEXT $transcoder_id, \?URLPATH $new_url = null
package galleries

Parameters

$transcoder_id

\ID_TEXT

Transcoding ID

$new_url

\?URLPATH

Transcoded URL (null: Discerned using t_output_filename field, which we assume is where transcoder has copied file to)

Transcode a video.

transcode_video(\URLPATH $url, \?ID_TEXT $table, \?AUTO_LINK $local_id, \?ID_TEXT $local_id_field, \?ID_TEXT $url_field, \?ID_TEXT $orig_filename_field, \?ID_TEXT $width_field, \?ID_TEXT $height_field) : \URLPATH
package galleries

Parameters

$url

\URLPATH

URL of the video to be transcoded

$table

\?ID_TEXT

The table we are saving into (null: don't save into DB)

$local_id

\?AUTO_LINK

The ID of the video being transcoded (null: don't save into DB)

$local_id_field

\?ID_TEXT

Name of the ID field in the table (null: don't save into DB)

$url_field

\?ID_TEXT

Name of the URL field in the table (null: don't save into DB)

$orig_filename_field

\?ID_TEXT

Name of the original filename field in the table (null: built into URL field)

$width_field

\?ID_TEXT

Name of the width field in the table (null: none)

$height_field

\?ID_TEXT

Name of the height field in the table (null: none)

Returns

\URLPATHTranscoded file (or original URL if no change was made)

Receive a message from zencoder that a video has transcoded.

zencoder_receive_script() 
package galleries

Constants

 

GETID3_HELPERAPPSDIR

GETID3_HELPERAPPSDIR = get_file_base() . '/sources_custom/getid3/helperapps' 
package galleries