db db(
[boolean
$loadindex = TRUE]
)
|
|
Initialises the db.
Parameters:
|
boolean |
$loadindex: |
Whether the index should be loaded. |
Switches to writing-allowed mode.
void checkTimedPublish(
)
|
|
Checks if any entries set to 'timed publish' should be published.
void clearIndex(
string
$type
)
|
|
Clears the index for searching or tags.
Parameters:
void delete_comment(
integer
$uid
)
|
|
Deletes a comment from the current entry.
Parameters:
void delete_entries(
array
$ids
)
|
|
Delete one or more entries.
Parameters:
Deletes the current entry
void delete_trackback(
integer
$uid
)
|
|
Deletes a trackback from the current entry.
Parameters:
void depublish_entries(
array
$ids
)
|
|
Set one or more entries to 'hold'
Parameters:
Switches to writing-disallowed mode.
boolean entry_exists(
int
$code
)
|
|
Tells if the entry exists.
Parameters:
|
int |
$code: |
The code/id of the entry. |
Rebuilds the index, if necessary.
array getArchiveArray(
[boolean
$force = FALSE], string
$unit
)
|
|
Gets an array of archives.
Parameters:
|
boolean |
$force: |
tells if the cache (if any) should be updated. |
|
string |
$unit: |
the unit of the archives. |
array getlist(
int
$amount, [int
$offset = 0], [mixed
$filteronuser = ""], [mixed
$filteroncat = ""], [boolean
$order = TRUE], [string
$field = ""], [string
$status = ""]
)
|
|
Gets a list of entries by date. This function is really deprecated and acts like a wrapper around read_entries.
Parameters:
|
int |
$amount: |
|
|
int |
$offset: |
|
|
mixed |
$filteronuser: |
|
|
mixed |
$filteroncat: |
|
|
boolean |
$order: |
Defines whether the results are in chronological order (false means reverse order). |
|
string |
$field: |
The field to order by. |
|
string |
$status: |
Return only entries with this status. |
void get_comment(
integer
$uid
)
|
|
Returns a comment from the current entry.
Parameters:
string get_date(
int
$code
)
|
|
Gets the date for an entry
Parameters:
int get_entries_count(
[array
$params = false]
)
|
|
Gets the number of entries.
The $params array can take the same keys as in the read_entries function, but only the following keys give meaning when counting:
- 'offset': The offset from the beginning of the filtered and sorted/ordered array.
- 'cats': Filter entries by category/ies.
- 'extrafields': Filter entries by extrafields.
- 'user': Filter entries by user(s).
- 'status': Filter entries by status.
- 'date': A date range - day, month or year.
- 'start'/'end': A start/end date.
'cats', 'extrafields' and 'user' can either be (comma separated) strings or arrays.
Parameters:
array get_entry_by_uri(
string
$uri, string
$date
)
|
|
Get an entry by its specific URI.
Parameters:
|
string |
$uri: |
|
|
string |
$date: |
|
int get_next_code(
[int
$num = 1], [
$category = ""]
)
|
|
Gets the code of the next entry.
Parameters:
int get_previous_code(
[int
$num = 1], [
$category = ""]
)
|
|
Gets the code of the previous entry.
Parameters:
void get_trackback(
integer
$uid
)
|
|
Returns a trackback from the current entry.
Parameters:
array guess_entry(
string
$uri, [string
$date = '']
)
|
|
Tries to guess an entry by it's (incomplete) URI and date (if available). The entry is returned as an associative array.
Parameters:
|
string |
$uri: |
|
|
string |
$date: |
|
void publish_entries(
array
$ids
)
|
|
Set one or more entries to 'publish'
Parameters:
array read_entries(
array
$params
)
|
|
Read a bunch of entries.
The $params array can have the following keys:
- 'full': Determines if the returned entries should be full (contain all fields), the default, or be reduced. (true/false)
- 'show': Amount of entries to read.
- 'offset': The offset from the beginning of the filtered and sorted/ordered array.
- 'cats': Filter entries by category/ies.
- 'extrafields': Filter entries by extrafields.
- 'user': Filter entries by user(s).
- 'status': Filter entries by status.
- 'order': Select random, asc(ending) or des(cending).
- 'orderby': Default is date, but any entry field (e.g. code/uid) can be used.
- 'date': A date range - day, month or year.
- 'start'/'end': A start/end date.
'cats', 'extrafields' and 'user' can either be (comma separated) strings or arrays.
Parameters:
array read_entry(
mixed
$code, [string
$date = ""]
)
|
|
Retrieves a full entry as an associative array, and returns it. The $code parameter can be a code/uid or an URI. The optional $date parameter helps to narrow it down, if there's more than one option.
Parameters:
|
mixed |
$code: |
|
|
string |
$date: |
|
array read_lasttrackbacks(
array
$params
)
|
|
Read the last trackbacks
Parameters:
array read_latestcomments(
array
$params
)
|
|
Read the latest comments
Parameters:
boolean save_entry(
[boolean
$update_index = TRUE]
)
|
|
Saves the current entry.
Returns true if successfully saved. Current implementation (in module_db_xml.php) seems to return true no matter what.
Parameters:
|
boolean |
$update_index: |
Whether to update the date index. |
array set_entry(
array
$entry
)
|
|
Sets the current entry to the contents of $entry.
Returns the inserted entry as it got stored in the database with correct code/id and Word HTML stripped off.
Parameters:
|
array |
$entry: |
The entry to be inserted |