WordPress Posts =============== Version 0.24 Copyright (c) 2010 Ian Goldstein - All Rights Reserved http://www.iangoldstein.com ================================================================================ CONFIGURATION SETTINGS ---------------------- cache_time Controls how long (in seconds) to cache any RSS data. Defaults to 300 seconds (i.e. 5 minutes). Set it to 0 to disable caching. cache_path Path to cache files. If it begins with "./" or "../" it is assumed to be relative to the location of the wpp.php file, otherwise it should be an absolute path. Defaults to "./cache". cache_chmod Specifies the permissions to apply to cached data files. Set it to -1 to disable chmod settings. Defaults to 0600. date_format Specifies the format for the {date} insertion variable. Defaults to "d-M-Y", e.g. "Jan 12, 2010". Valid formating characters include: d = numeric day with leading zeros (01-31) j = numeric day without leading zeros (1-31) S = ordinal suffix for day of month (st, nd, rd, th) l = full day of week (Sunday, Monday, Tuesday,...) D = abbreviated day of week (Sun, Mon, Tue,...) m = numeric month with leading zeros (01-12) n = numeric month without leading zeros (1-12) F = full month name (January, February, March,...) M = abbreviated month name (Jan, Feb, Mar,...) Y = 4-digit year y = 2-digit year h = 12-hour time with leading zeros (01-12) g = 12-hour time without leading zeros (1-12) H = 24-hour time with leading zeros (00-23) G = 24-hour time without leading zeros (0-23) i = minutes with leading zeros (00-59) s = seconds with leading zeros (00-59) a = lowercase 'am' or 'pm' A = uppercase 'AM' or 'PM' O = timezone offset from UTC (e.g. -0500) P = timezone offset from UTC with colon (e.g. -05:00) T = timezone abbreviation (e.g. EST) \ = literal character All unknown characters are treated as literals. See php's date() function for a complete list of formating characters. time_format Specifies the format for the {time} insertion variable. Defaults to "g:i a", e.g. "14:25 am". See date_format for formating characters. timestamp_format Specifies the format for the {timestamp} insertion variable. Defaults to "D, d M Y H:i:s O", e.g. "Mon, 17 May 2010 10:34:52 -0400". See date_format for formating characters. category_delimiter If more than one category and/or tag is assigned to a post, this setting controls the delimiter that will be used for the 'categories' output. It defaults to ', ' (comma and space). If set to '', the get_wpp() function will return the categories as an array rather than a delimited string, but the wpp() function will still behave as if the default ', ' was set. abstract_remove This specifies text which if detect in the abstract is removed along with all following text. Needed to remove extraneous text from plugins such as Sociable, whose text would otherwise appear as part of short abstracts. readmore_indicator This setting indicates the text expected at the end of a long abstract, which defaults to "[...]" and should normally not need to be changed. If set to "", no indicator is checked for. readmore_ellipsis Specifies the replacement text to be used for the "[...]" indicator. Defaults to "...". readmore_text Specifies additional text to be appended after the readmore_ellipsis. Any text within this setting wrapped in { } characters are converted to a link to the post. Defaults to " {Read More »}" readmore_mode Controls "Read More" text replacement: 0 = disables all such text replacement 1 = adds Read More text only if [...] at end of abstract (default) 2 = always adds Read More text decode_utf8 Normally, UTF-8 characters in the rss feed field values are convert to single byte ISO-8859-1 characters. Set this to false to disable this. convert_entities Normally, characters such as &, <, >, " and ' in the rss feed field values are converted to their corresponding html entities, and double conversion of & is avoided. Set this to false to disable this conversion. ================================================================================ wpp() ----- This function will print the corresponding posts to the html output stream. If there are no posts, nothing will be printed. Syntax: wpp (feed, [count], [output], [separator], [none], [config]) Parameters: feed Full URL to the RSS feed. This is a required parameter. count Number of posts to print. If not passed, or set to 0, prints all. output This is the text to output for each post. It can include HTML codes as well as insertion variables, which will be replaced with their corresponding values. If this value is not passed, or set to NULL it defaults to "{title}" Insertion variables are in the form {var} and include... {title} post title {abstract} short synopsis from post {date} date of post {time} time of post {timestamp} timestamp of post {author} author of post {categories} delimited categories and/or tags {link} link to blog entry {comments} number of comments separator This is output between posts. If not passed or NULL, it defaults to "
" none This text is output if no posts exists. If not passed or NULL it is "". config This optional parameter provides the ability to override most configuration settings. It must be passed as an associative array of configuration settings along with their alternative values. For example, to use a cache expiration time of 120 seconds, you would pass this parameter as... array('cache_time' => 120) Multiple settings can be specified, and most configuration settings can be overridden. Global settings which cannot be overridden include... cache_path, cache_chmod, decode_utf8, convert_entities ================================================================================ get_wpp() --------- This function will return the corresponding posts as an array Syntax: get_wpp (feed, [count], [config]) --> posts Parameters: feed Full URL to the RSS feed. This is a required parameter. count Number of posts to return. If not passed, or set to 0, all are returned. config This optional parameter provides the ability to override most configuration settings. It must be passed as an associative array of configuration settings along with their alternative values. For example, to use a cache expiration time of 120 seconds, you would pass this parameter as... array('cache_time' => 120) Multiple settings can be specified, and most configuration settings can be overridden. Global settings which cannot be overridden include... cache_path, cache_chmod, decode_utf8, convert_entities Returns: An array of posts is returned. If there are no posts an empty array is returned. Otherwise, the array will contain a lists of posts, where each post is an associative array containing... title post title (text) abstract short synopsis from post (text) date date of post (text) time time of post (text) timestamp timestamp of post (text) postdate Unix timestamp of post (integer) author author of post (text) categories delimited categories and/or tags (text) link link to blog entry (text) comments number of comments (integer) ================================================================================ num_wpp() --------- This function returns the number of posts Syntax: num_wpp (feed, [expires]) --> number of posts Parameters: feed Full URL to the RSS feed. This is a required parameter. expires Normally, the cache expiration time is determined by the configuration setting. This parameter allows it to be overridden. ================================================================================ exist_wpp() ----------- This function returns true if posts exists, otherwise false. Syntax: exist_wpp (feed, [expires]) --> boolean Parameters: feed Full URL to the RSS feed. This is a required parameter. expires Normally, the cache expiration time is determined by the configuration setting. This parameter allows it to be overridden. ================================================================================ wpp_version() ------------- This function returns the current version of the WordPress Posts Utility Syntax: wpp_version () --> version