BlogEntryRepresents an entry in the weblog. InheritsLnBlogObject, Entry Events| 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 retreived from an HTTP POST. |
Summary | Represents an entry in the weblog. | | | | Get a copy of the parent of this objcet, i.e. | | Gets an identifier for the current entry. | | A unique ID for use with blogging APIs. | | Gets an identifier for the entry’s parent blog. | | Gets an array of the names of all files uploaded to this entry. | | Gets the URL, file size, and media type of the file set as the enclosure for this entry, it if exists. | | Returns a path to use for the entry. | | Determine if the object is a blog entry or not. | | Get the path to this entry’s directory on the local filesystem. | | Get the permalink to the object. | | Returns a link to the object’s base directory. | | Get the permalink to the object. | | Gets the URI of the a specified page. | | Commit changes to the object. | | Delete the current object. | | Save the object to persistent storage. | | Calculates a file name for a “pretty” permalink wrapper script. | | Creates a wrapper script that makes a “pretty” permalink to the entry directory based on the subject text of the entry. | | Extract data from an HTTP POST and insert it into the object. | | Get the HTML to use to display the object. | | Get the number of replies of a particular type. | | Get an array of replies of a particular type. | | Gets the HTML markup to display to list a given type of reply. | | Determine the number of comments that belong to this object. | | Gets all the comment objects for this entry. | | Get the HTML markup to display the entire list of comments for this entry. | | Get the number of TrackBacks for this object. | | Get an array of Trackback objects that contains all TrackBacks for this entry. | | Get some HTML that displays the TrackBacks for this entry. | | Get the number of Pingbacks for this object. | | Get an array of Pingback objects that contains all Pingbacks for this entry. | | Get some HTML that displays the Pingbacks for this entry. | | Scans the links in the current entry, determines which are pingback-enabled, and sends a pingback ping to those links. | | Checks if a Pingback ping has already been recorded for the source URL. | | Extracts all the hyperlinks from the entry text. |
getParentGet a copy of the parent of this objcet, i.e. the blog to which it belongs. ReturnsA Blog object.
entryIDGets an identifier for the current entry. ReturnsFor file-based storage, string containing the last part of the path. Normally, this is in the form ##/##/##_####
globalIDA 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. ReturnsA string with the unique ID.
parentIDGets an identifier for the entry’s parent blog. ReturnsFor file-based storage, returns the webroot-relative path to the blog.
getUploadedFiles| function getUploadedFiles() |
Gets an array of the names of all files uploaded to this entry. Currently, this just means all files in the entry directory that were not created by LnBlog. ReturnsAn array containing the file names without path.
getEnclosureGets 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. ReturnsIf 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.
getPath| function getPath( | $curr_ts, | | | | $just_name | = | false, | | $long_format | = | false | ) |
|
Returns a path to use for the entry. This is only applicable for file-based storage and is for internal use only. Parameters| 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. |
ReturnsA string with the path to use for this entry.
isEntry| function isEntry ( | $path | = | false | ) |
|
Determine if the object is a blog entry or not. Parameter| path | Optional path to the entry. If not set, use the current object. |
ReturnTrue if the object is an existing entry, false otherwise.
localpathGet 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. ReturnsA string representing a path to the object or false on failure.
permalinkGet the permalink to the object. ReturnsA string containing the full URI to this entry.
baselinkReturns a link to the object’s base directory. ReturnsA string with the URI.
commentlinkGet the permalink to the object.
uriGets the URI of the a specified page. Parameters| link | The page for which you want the URI. Valid values are “page”, “ |
ReturnsA string holding the relevant URI.
updateCommit changes to the object. ReturnsTrue on success, false on failure.
deleteDelete the current object. ReturnsTrue on success, false on failure.
insertSave the object to persistent storage. Parameters| blog | The blog into which the entry will be inserted. |
ReturnsTrue on success, false on failure.
calcPrettyPermalink| function calcPrettyPermalink( | $use_broken_regex | = | false | ) |
|
Calculates a file name for a “pretty” permalink wrapper script. Parameters| use_broken_regex | Optional parameter to calculate the URI based on the ugly regex used in LnBlog < 0.7. Defaults to false. |
ReturnsThe string to be used for the file name.
makePrettyPermalink| function makePrettyPermalink() |
Creates a wrapper script that makes a “pretty” permalink to the entry directory based on the subject text of the entry. ReturnsTrue on success, false on failure.
getPostDataExtract data from an HTTP POST and insert it into the object. The data fields in the POST are described below. Fields| 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. |
get| function get( | $show_edit_controls | = | false | ) |
|
Get the HTML to use to display the object. Parameters| show_edit_controls | Optional boolean determining if the edit, delete, etc. links should be displayed. Defaults to false. |
ReturnsA string containing the markup.
getReplyCount| function getReplyCount( | $params | ) |
|
Get the number of replies of a particular type. Parameters| 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. |
ReturnsAn integer representing the number of replies of the given type. If the call fails for some reason, then false is returned.
getReplyArray| function getReplyArray( | $params | ) |
|
Get an array of replies of a particular type. Parameters| 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. |
ReturnsAn array of BlogComment, Trackback, or Pingback objects, depending on the parameters. Returns false on failure.
getReplies| function getReplies( | $params | ) |
|
Gets the HTML markup to display to list a given type of reply. Parameters| params | An associative array of parameters, as in getReplyArray. In addition, it requires the ‘itemclass’ and ‘listtitle’ keys to be set. These are the CSS class applied to each reply and the title given to the whole reply list, respectively. There is also an optional “listclass” key that gives the CSS class to apply to the list. |
ReturnsA string of HTML markup to send to the client.
getCommentCount| function getCommentCount() |
Determine the number of comments that belong to this object. ReturnsA non-negative integer representing the number of comments or false on failure.
getCommentArray| function getCommentArray( | $sort_asc | = | true | ) |
|
Gets all the comment objects for this entry. Parameters| sort_asc | Optional boolean (true by default) determining whether the comments should be sorted in ascending order by date. |
ReturnsAn array of BlogComment object.
getComments| function getComments( | $sort_asc | = | true | ) |
|
Get the HTML markup to display the entire list of comments for this entry. Parameters| sort_asc | Optional boolean (true by default) determining whether the comments should be sorted in ascending order by date. |
ReturnsA string of HTML markup.
getTrackbackCount| function getTrackbackCount() |
Get the number of TrackBacks for this object. ReturnsA non-negative integer representing the number of TrackBacks or false on failure.
getTrackbackArray| function getTrackbackArray( | $sort_asc | = | true | ) |
|
Get an array of Trackback objects that contains all TrackBacks for this entry. Parameters| sort_asc | Optional boolean (true by default) determining whether the trackbacks should be sorted in ascending order by date. |
ReturnsAn array of Trackback objects.
getTrackbacks| function getTrackbacks( | $sort_asc | = | true | ) |
|
Get some HTML that displays the TrackBacks for this entry. Parameters| sort_asc | Optional boolean (true by default) determining whether the trackbacks should be sorted in ascending order by date. |
ReturnsA string of markup.
getPingbackCount| function getPingbackCount() |
Get the number of Pingbacks for this object. ReturnsA non-negative integer representing the number of Pingbacks or false on failure.
getPingbackArray| function getPingbackArray( | $sort_asc | = | true | ) |
|
Get an array of Pingback objects that contains all Pingbacks for this entry. Parameters| sort_asc | Optional boolean (true by default) determining whether the pingbacks should be sorted in ascending order by date. |
ReturnsAn array of Pingback objects.
getPingbacks| function getPingbacks( | $sort_asc | = | true | ) |
|
Get some HTML that displays the Pingbacks for this entry. Parameters| sort_asc | Optional boolean (true by default) determining whether the pingbacks should be sorted in ascending order by date. |
ReturnsA string of markup.
sendPings| function sendPings( | $local | = | false | ) |
|
Scans the links in the current entry, determines which are pingback-enabled, and sends a pingback ping to those links. Parameters| local | Optional boolean that determines whether or not to send pings to posts on the same webserver. Defaults to false. Returns: An array of associative arrays. Each array has ‘uri’ and a ‘response’ key, which contain the target URI and the XML-RPC response object. |
pingExists| function pingExists ( | $uri | ) |
|
Checks if a Pingback ping has already been recorded for the source URL. Parameters| uri | The source URI to check. |
ReturnsTrue if there is already a recorded ping with the source URI, false otherwise.
extractLinks| function extractLinks( | $allow_local | = | false | ) |
|
Extracts all the hyperlinks from the entry text. Parameters| allow_local | Optional boolean parameter that determines if local links, should be included. Defaults to false. |
ReturnsAn array of URLs containing each hyperlink in the entry. If allow_local is false, then links without a protocol and host name are excluded.
|