Represents an entry in the weblog.
OnInit | Fired when object is first created. |
InitComplete | Fired at end of constructor. |
OnInsert | Fired before object is saved to persistent storage. |
InsertComplete | Fired after object has finished saving. |
OnDelete | Fired before object is deleted. |
DeleteComplete | Fired after object is deleted. |
OnUpdate | Fired before changes are saved to persistent storage. |
UpdateComplete | Fired after changes to object are saved. |
OnOutput | Fired before output is generated. |
OutputComplete | Fired after output has finished being generated. |
POSTRetrieved | Fired after data has been retrieved from an HTTP POST. |
Get a copy of the parent of this objcet, i.e. the blog to which it belongs.
A Blog object.
Gets an identifier for the current entry.
For file-based storage, string containing the last part of the path. Normally, this is in the form ##/##/##_#### or ##_#### for drafts
A unique ID for use with blogging APIs. Note that this ID embedds the parent blog's ID, whereas the entryID method provides an ID within the current blog.
A string with the unique ID.
Gets the URL, file size, and media type of the file set as the enclosure for this entry, it if exists. The file is checkedy by converting the URL into a local path using the same rules as entry URL absolutizaiton, or simply doing a URL to localpath conversion.
If the enclosure property is set and the file is found, returns an array with elements "url", "length", and "type". If the file is not found, then checks if the enclosure matches the expected content or an enclosure tag in an RSS feed. If so, extracts the data into an array. Otherwise Otherwise, returns false.
public function getPath( |
| ) |
Returns a path to use for the entry. This is only applicable for file-based storage and is for internal use only.
curr_ts | The timestamp for this entry. |
just_name | Optional boolean determining whether to return a full path or just a file name. Default is false. |
long_format | Optional boolean for whether to use a long or regular date format. Defaults to false. |
A string with the path to use for this entry.
public function setSticky( |
| ) |
Set whether or not an article should be considered "featured". Articles not set sticky should be considered archival and not shown on things like front-page article lists.
show | Optional boolean parameter to turn stickiness on or off. Default is true (stickiness on). |
True on success, false on failure.
public function isSticky( |
| ) |
Determines if the article is set as sticky.
path | Optional unique ID for the article. |
True if the article is sticky, false otherwise.
public function readSticky( |
| ) |
Get the title and permalink without retreiving the entire article.
path | The unique ID for the article. Defaults to current ID if entry exists. |
A two-element array, with "link" and "title" for the permalink and subject of the article.
public function isEntry ( |
| ) |
Determine if the object is a blog entry or not.
path | Optional path to the entry. If not set, use the current object. |
True if the object is an existing entry, false otherwise.
public function isDraft( |
| ) |
Checks if the given entry is saved as a draft, as opposed to a published blog entry.
True if the entry is a draft, false otherwise.
public function isPublished( |
| ) |
Determine if the entry has been published.
path | The path to the entry. |
Whether or not the entry exists and is not a draft.
Get the path to this entry's directory on the local filesystem. Note that this is specific to file-based storage and so should only be c called internally.
A string representing a path to the object or false on failure.
Get the permalink to the object.
A string containing the full URI to this entry.
Get the permalink to the object.
Get the auto-publish date.
The date string when publication will happen or empty string.
Calculates a file name for a "pretty" permalink wrapper script.
The string to be used for the file name.
public function calcLegacyPermalink( |
| ) |
Calculates a file name for a "pretty" permalink wrapper script using the old, ugly permalink computation.
use_broken_regex | Optional parameter to calculate the URI based on the ugly regex used in LnBlog < 0.7. Defaults to false. |
The string to be used for the file name.
Creates a wrapper script that makes a "pretty" permalink to the entry directory based on the subject text of the entry.
True on success, false on failure.
Extract data from an HTTP POST and insert it into the object. The data fields in the POST are described below.
subject | The subject of the entry, in plain text. |
short_path | The "short path" to access an article. |
abstract | An abstract of the entry, with markup. |
tags | A comma-delimited list of free-form tags. |
body | The entry body, with markup. |
comments | Boolean representing whether new comments can be posted. |
input_mode | Tristate variable representing the type of markup used. Valid values are defined by the constants MARKUP_NONE, MARKUP_BBCODE, and MARKUP_HTML. |
public function exportVars( |
| ) |
Sets template variables with the entry data.
tmp | The template we wish to populate. |
public function get( |
| ) |
Get the HTML to use to display the entry summary.
show_edit_controls BasePages$ | Optional boolean determining if the edit, delete, etc. links should be displayed. Defaults to false. |
A string containing the markup.
public function getFull( |
| ) |
Get the HTML to use to display the full entry page.
show_edit_controls | Optional boolean determining if the edit, delete, etc. links should be displayed. Defaults to false. |
A string containing the markup.
public function getReplyCount( |
| ) |
Get the number of replies of a particular type.
parms | An associative array of various parameters. The valid array keys are "path", which is the directory to scan, "ext", which is the file extension of the data files, and "match_re", which is a regular expression matching the names of the data files minus the extension (default is /[\w\d]+/)). Note that "path" and "ext" keys are required. |
An integer representing the number of replies of the given type. If the call fails for some reason, then false is returned.
public function getReplyArray( |
| ) |
Get an array of replies of a particular type. This is for internal use only. Call getComments(), getTrackbacks(), getPingbacks, or getReplies() instead of this.
params | An associative array of settings, as in getReplyCount. In addition to the keys allowed by that function, this one also requires a "creator" key, which is the name of a function that will return the correct type of object given the data path to its storage file as a parameter. It also accepts an optional "sort_asc" key, which will sort the files in order by filename, (which equates to date order) rather than in reverse order when set to true. |
An array of BlogComment, Trackback, or Pingback objects, depending on the parameters. Returns false on failure.
Gets an array of all replies to this entry.
An array of BlogComment, Trackback, and Pingback objects.
Determine the number of comments that belong to this object.
A non-negative integer representing the number of comments or false on failure.
public function getComments( |
| ) |
Gets all the comment objects for this entry.
sort_asc | Optional boolean (true by default) determining whether the comments should be sorted in ascending order by date. |
An array of BlogComment object.
public function getCommentArray( |
| ) |
Compatibility function, alias for getComments
Get the number of TrackBacks for this object.
A non-negative integer representing the number of TrackBacks or false on failure.
public function getTrackbacks( |
| ) |
Get an array that contains all TrackBacks for this entry.
sort_asc | Optional boolean (true by default) determining whether the trackbacks should be sorted in ascending order by date. |
An array of Trackback objects.
public function getTrackbackArray( |
| ) |
Compatibility function, alias for getTrackbacks
Get the number of Pingbacks for this object.
A non-negative integer representing the number of Pingbacks or false on failure.
public function getPingbacks( |
| ) |
Get an array that contains all Pingbacks for this entry.
sort_asc | Optional boolean (true by default) determining whether the pingbacks should be sorted in ascending order by date. |
An array of Pingback objects.
public function getPingbackArray( |
| ) |
Compatibility function, alias for getPingbacks
Gets the local and remote pingbacks for an entry, i.e. pingbacks that come from URLs on the same blog as this entry and others.
An associative array with two keys, "local" and "remote". Each element is an array of Pingback objects with the "friendly" pings in the "local" array and others in the "remote" array.
public function pingExists( |
| ) |
Checks if a Pingback ping has already been recorded for the source URL.
uri | The source URI to check. |
True if there is already a recorded ping with the source URI, false otherwise.
Overrides the default implementation to make sure that we always write to the correct file name.
Get a list of files attached to this entry
Returns: Array of AttachedFile objects
public function addAttachment( |
| ) |
Add an attached file to the entry.
path | The local file path to the file to attach. |
name | Optional name of the file. Default is the existing name. |
public function removeAttachment( |
| ) |
Remove a file that is attached to the entry.
name | The name of the file to remove. |
Get a list of system files that are managed by the entry and are therefore excluded from uploads.
Returns: An array of file names.
public function addReply( |
| ) |
Inserts a reply (comment, pingback, etc.) to the entry.
reply | The reply object ot insert |