EntryAn abstract class representing entries of all types in the blog database. InheritsSummary
has_htmlHolds the type of markup used in the data property. This can be one of several defined constants, includine MARKUP_NONE, MARKUP_BBCODE, and MARKUP_HTML. absolutizeBBCodeURI
A function to search LBCode marked-up text and convert the URIs in links and images from relative to absolute. Parameters
ReturnsA string with the markup in the data parameter, but with relative img and url tags converted to absolute URIs. If the relative URI contains no slashes, colons, or ampersands, the relative URI given will be interpreted as under the under the current_uri parameter. If it contains slashes, but no colons or ampersands, it will interpreted as relative to the blog root, if there is a current blog, and if the given URI starts with a slash, it will be interpreted as relative to the DOCUMENT_ROOT, if it is set. absolutizeHTMLURI
A version of absolutizeBBCodeURI that works with HTML markup. Parameters
ReturnsThe markup in the data parameter with href and src attributes absolutized according to the same rules as apply with absolutizeBBCodeURI. stripHTML
Strip HTML code out of a string. Note that the UNICODE_ESCAPE_HACK configuration constant can be used to switch between using the PHP htmlentities() and htmlspecialchars() functions to sanitize input. This is because htmlentities() has a nasty habit of mangling Unicode. Parameters
ReturnsA copy of data with HTML special characters such as angle brackets and ampersands converted into their corresponding HTML entities. This will cause them to display in a web page as characters, not HTML markup. getAbstract
A quick function to get a plain text abstract of the entry data by grabbing the first paragraph of text or the first N characters, whichever comes first. Markup is removed in the process. Note that it attempts to do word wrapping to avoid cutting words off in the middle. Parameters
A string containing the abstract text, with all markup stripped out. readFileData
Reads entry data from a file. File metadata is enclosed in META tags which are HTML comments, in one-per-line format. Here is an example. <!--META Subject: This is a subject META--> Variables are created for every such line which is referenced in the metadata_fields property of the object. The metadata_fields property is an associative array where the element key is the propery of the object to which the value is assigned and the element valueis the case-insensitive variable used in the file, as with “Subject” in the example above. There is also a custom_fields property. This is an associative array, just as metadata_fields. If custom_fields is populated, its members are merged into metadata_fields, in effect adding elements to the standard metadata fields. ReturnsThe body of the entry as a string. writeFileData
Write entry data to a file. The contents of the file are determined by the properties of the object and the contents of the metadata_fields and custom_fields properties, just as with readFileData. This function writes the metadata to HTML comments, as mentioned above, while the body data is written at the end of the file. Note that, in order for the file to be written, the file property of the object must be set. ReturnsTrue if the file write is successful, false otherwise. |
Set or return the data property.
function data( $value = false )
Set or return an array of tags for this entry.
function tags( $list = false )
Abstract function that returns the object’s permalink.
function permalink()
Abstract function to return the parent object of the current object.
function getParent()
Gets a link to the object’s base directory, to use for converting relative to absolute paths.
function baselink()
Abstract function that converts a query string into a unique identifier for an object.
function queryStringToID()
A function to search LBCode marked-up text and convert the URIs in links and images from relative to absolute.
function absolutizeBBCodeURI( $data, $current_uri )
A version of absolutizeBBCodeURI that works with HTML markup.
function absolutizeHTMLURI( $data, $current_uri )
Strip HTML code out of a string.
function stripHTML( $data )
Apply appropriate markup to the entry data.
function markup( $data = "", $use_nofollow = false )
A quick function to get a plain text abstract of the entry data by grabbing the first paragraph of text or the first N characters, whichever comes first.
function getAbstract( $numchars = 500 )
Get a human-readable date from a timestamp.
function prettyDate( $ts = false )
Reads entry data from a file.
function readFileData()
Write entry data to a file.
function writeFileData()