Initialize the PortableNotespace
Initializes the PortableNotespace.
bool
__construct
(string $location)
-
string
$location: The location to the database
Adds a note to the notegroup that you specify
Adds a note to the notegroup that was specified. If the note already exists, it will return with an error.
bool
add_note
(string $note, string $contents, string $user, [string $notegroup = 'default'])
-
string
$note: The note's title (must be unique)
-
string
$contents: The note's contents
-
string
$user: The user to add the note to
-
string
$notegroup: The notegroup to add the note to
Adds a new user
Adds a new user to the database
bool
add_user
(string $user, string $pass, [string $group = 'users'])
-
string
$user: The username of the new user
-
string
$pass: The password (non-hashed) of the new user
-
string
$group: The group name of the new user. Default is users
Assigns a user to a group
Assigns a user to the specified group (users).
bool
assign_group
(string $user, [string $group = 'users'])
-
string
$user: The user to assign
-
string
$group: The group to assign the user to (by default users)
Ban an IP
Bans an IP into the IP ban list to be used.
void
ban_ip
(string $ip)
-
string
$ip: The IP to ban
Bans an user
Bans an user into the banlist.
bool
ban_user
(string $user)
-
string
$user: The user to ban
Ban an user agent
Bans an user agent into the UserAgent ban list.
void
ban_useragent
(string $agent)
-
string
$agent: The useragent to ban
Clears the banlist (IP)
Clears the IP banlist by resetting it.
void
clear_ipbanlist
([ $resetval = array()])
Clears the banlist (UserAgent)
Clears the user agent banlist by resetting it.
void
clear_useragentlist
([Array(string) $resetval = array()])
-
Array(string)
$resetval: Custom default to set.
Clears the banlist (User)
Clears the user banlist by resetting it.
void
clear_userbanlist
([Array(string) $resetval = array()])
-
Array(string)
$resetval: Custom default to set.
Deassigns the group
Deassigns(resets) the group of the specified user.
bool
deassign_group
(string $user)
Deletes a note
Deletes the specified note in the specified group
bool
delete_note
(string $note, string $user, string $ngp)
-
string
$note
-
string
$user
-
string
$ngp
void
delete_theme
( $path)
Deletes a user
Deletes a user from the database.
bool
delete_user
(string $user)
-
string
$user: The user to delete
Edits a note
Edits the specified note in the specified notegroup.
bool
edit_note
(string $note, string $contents, string $user, string $ngp)
-
string
$note: The note to edit
-
string
$contents: The new/updated contents of the note
-
string
$user: The user that the note belongs to
-
string
$ngp: The notegroup that the note belongs to
Returns the administrator group
Returns the administrator group. By default the administrator group is "admin", but it may have been changed.
string
get_admin_group
()
Get the ban list
Gets the complete banlist
Array(string)
get_all_ban_lists
()
Gets the site description
Gets the global site description.
string
get_desc
()
Gets the banlist (IP)
Gets the IP ban list.
Array(string)
get_ip_ban_list
()
Returns the moderator group
Returns the moderator group. By default the moderator group's name is "mod", but it may have been changed with set_mod_group.
string
get_mod_group
()
Gets the sitename
Gets the global sitename.
string
get_sitename
()
Gets the site theme
Gets the global site theme.
string
get_theme
()
Gets the banlist (UserAgent)
Gets the UserAgent ban list.
Array(string)
get_ua_ban_list
()
Gets the banlist (users)
Gets the user ban list.
Array(string)
get_user_ban_list
()
Returns the user group
Returns the user group. By default the user group's name is "users", but it may have been changed with set_user_group.
string
get_user_group
()
Lists all the notegroups of a user
Lists all the notegroups that belong to the specified user.
Array(string)
list_groups
(string $user)
-
string
$user: The user to list the notegroups for
Lists all notes in the specified notegroup
Lists all notes in the specified notegroup.
Array(string)
list_notes
(string $user, string $group)
-
string
$user: The user
-
string
$group: The notegroup to list
Lists all users
Lists all the users in the current database.
Array(string)
list_users
()
Publishes the specified note
Publishes the specified note into the specfied webpage.
bool
publish_note
(string $note, string $group, string $user, [string $wfile = 'webpub.htm'])
-
string
$note: The note to publish
-
string
$group: The group of the note
-
string
$wfile: The webpage to publish into
-
string
$user: The user that the note belongs to
Sets the global site description
Sets the new global site description.
string
set_desc
(string $d)
-
string
$d: The new description
Sets the moderator group
Sets the moderator group. Beware that any existing moderators will lose their permissions.
void
set_mod_group
(string $modgroup)
-
string
$modgroup: The new moderator group's name
Sets the global sitename
Sets the global sitename.
string
set_sitename
(string $sn)
-
string
$sn: The new sitename
Sets the site theme
Sets the global site theme.
void
set_theme
(string $t)
-
string
$t: The new site theme
Sets the users group
Sets the users group's name. Be sure to update any existing users' group.
void
set_user_group
(string $usrgroup)
-
string
$usrgroup: The new usergroup's name
Checks if a theme exists
Checks to see if the specified theme exists.
bool
theme_exists
(string $theme)
Unban an IP
Unbans an IP address from the banlist.
bool
unban_ip
(string $ip, [bool $force = false])
-
string
$ip: The IP to unban/unblock
-
bool
$force: Force the block? (supresses all errors, not recommended)
Unban an user
Unbans an user from the ban list
bool
unban_user
(string $user, [bool $force = false])
-
string
$user: The user to unban
-
bool
$force: Cover up errors?
Unban an user agent
Unbans an user agent from the ban list
bool
unban_useragent
(string $agent, [bool $force = false])
-
string
$agent: The user agent to unban
-
bool
$force: Cover up errors?
Checks to see if a user exists
Checks to see if the user exists in the database.
bool
user_exists
(string $user)
-
string
$user: The user to check