HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

ocPortal Developer's Guide: Authors

» Return to Contents



sources/authors.php

Global_functions_authors.php

Function summary

void authors_script ()
?MEMBER get_author_id_from_name (ID_TEXT author)
void add_author (ID_TEXT author, URLPATH url, ?MEMBER forum_handle, LONG_TEXT description, LONG_TEXT skills, ?SHORT_TEXT meta_keywords, ?LONG_TEXT meta_description)
void delete_author (ID_TEXT author)
boolean has_edit_author_permission (MEMBER member, ID_TEXT author)
boolean has_delete_author_permission (MEMBER member, ID_TEXT author)
void merge_authors (ID_TEXT from, ID_TEXT to)

void authors_script()

Shows an HTML page of all authors clickably.

Parameters…

(No return value)


Return to the function index for this class Expand: View the source code to this function

?MEMBER get_author_id_from_name(ID_TEXT author)

Get a member ID from an author name. First by trying authors table, second by trying forum membernames.

Parameters…

Name author
Description The name of an author
Type ID_TEXT

Returns…

Description The member ID (NULL: none found)
Type ?MEMBER

Return to the function index for this class Expand: View the source code to this function

void add_author(ID_TEXT author, URLPATH url, ?MEMBER forum_handle, LONG_TEXT description, LONG_TEXT skills, ?SHORT_TEXT meta_keywords, ?LONG_TEXT meta_description)

Adds an author (re-creating them if they already exist - thus it also serves to edit; the reason for this is the fluidity of authors - members are automatically authors even before an author profile is made)

Parameters…

Name author
Description The name of an author
Type ID_TEXT

Name url
Description The URL to the authors home page
Type URLPATH

Name forum_handle
Description The member ID of the author (NULL: no forum profile)
Type ?MEMBER

Name description
Description A description of the author
Type LONG_TEXT

Name skills
Description A terse string showing author skills
Type LONG_TEXT

Name meta_keywords
Description Meta keywords for this resource (NULL: do not edit) (blank: implicit)
Default value
Type ?SHORT_TEXT

Name meta_description
Description Meta description for this resource (NULL: do not edit) (blank: implicit)
Default value
Type ?LONG_TEXT

(No return value)


Return to the function index for this class Expand: View the source code to this function

void delete_author(ID_TEXT author)

Delete an author

Parameters…

Name author
Description The name of an author
Type ID_TEXT

(No return value)


Return to the function index for this class Expand: View the source code to this function

boolean has_edit_author_permission(MEMBER member, ID_TEXT author)

Find if a member's usergroup has permission to edit an author

Parameters…

Name member
Description The member being checked whether to have the access
Type MEMBER

Name author
Description An author
Type ID_TEXT

Returns…

Description Whether the member can edit this author
Type boolean

Return to the function index for this class Expand: View the source code to this function

boolean has_delete_author_permission(MEMBER member, ID_TEXT author)

Find if a member's usergroup has permission to delete an author

Parameters…

Name member
Description The member being checked whether to have the access
Type MEMBER

Name author
Description An author
Type ID_TEXT

Returns…

Description Whether the member can edit this author
Type boolean

Return to the function index for this class Expand: View the source code to this function

void merge_authors(ID_TEXT from, ID_TEXT to)

Merge two authors.

Parameters…

Name from
Description The first author (being removed effectively)
Type ID_TEXT

Name to
Description The second author (subsuming the first)
Type ID_TEXT

(No return value)


Return to the function index for this class Expand: View the source code to this function