Dokuwiki Plugin - WordPress Most Recent Entries

wp_most_recent plugin by Peter DeWeese
Show recent (or all) entries from any WordPress blog using a template.

Provides Syntax.
No compatibility info given!

Tagged with changelog, embed.

    See http://peter.deweeses.net/doku.php?id=programming:wp_most_recent. FIXME: transfer more information here.

    Description

    Wordpress Most Recent Entries allows you to show the most recent entries from wordpress blogs in any Dokuwiki page. The display and many properties are completely customizable, and polish can be added. For example, dates can be displayed as “1 day 7 hours ago”, and summeries are ended with “[…]”. This is my first PHP project, so please give me tips! For bugs and tips (not gripes), email mailto:peterdeweese@earthlink.net. Please include the exact versions of dokuwiki and wordpress that you are using with a full description of any issue. FIXME (add a compatibility chart)

    Download

    Version status link
    08-26-2005 alpha programming:wp_most_recent-20050826.tgz FIXME
    08-18-2005 alpha programming:wp_most_recent-20050818.tgz FIXME
    08-17-2005 alpha programming:wp_most_recent-20050817.tgz FIXME
    08-16-2005 alpha wp_most_recent-20050816.tgz

    Features

    • custom template for blog entry display
    • connection aliases
    • summary or full article view
    • category constraint
    • max settings for entries, categories, and summary length

    Installation

    1. Under your wiki installation, create the directory ‘lib/plugins/wp_most_recent’.
    2. Place ‘syntax.php’ into this directory.
    3. Configure using the instructions below.

    Configuration

    Configure wp_most_recent in your dokwiki installation under conf/local.php.

    Caching

    Since WordPress blogs are databased as dynamic, the semi-static nature of Dokuwiki rendering can get in the way.

    • Set the maximum cache length to a reasonable value. For many sites, a half hour to a one day period will be reasonable.
    • Time-ago strings are generated on the client side, so they should not be considered when configuring cache settings.
    • If real-time posts are required, the cache must be turned off. Performance test your site without caching. If the performance is an issue, question why you require a static style collaborative website to be so dynamic. If performance is not acceptable, consider hybrids such as Confluence or Blog:CMS.

    WordPress Database Aliases

    At least one alias is required, but you can also configure the plugin to work with multiple WordPress databases. By default, the default alias should be named “default”. For each alias of name <aliasname>, include the following properties:

    /These settings should mirror the configuration for a wordpress configuration.
    $conf['wp_most_recent']['db_alias']['<aliasname>']['host']         = "localhost";
    $conf['wp_most_recent']['db_alias']['<aliasname>']['user']         = "db_user";
    $conf['wp_most_recent']['db_alias']['<aliasname>']['pass']         = "db_password";
    $conf['wp_most_recent']['db_alias']['<aliasname>']['sid']          = "wordpress";
    $conf['wp_most_recent']['db_alias']['<aliasname>']['table_prefix'] = "wp_";
    $conf['wp_most_recent']['db_alias']['<aliasname>']['baseurl']      = "http://<host>/blog";

    Override Default Attributes

    Although any attribute can be defined by editing the wiki tags, a default attribute can be overridden using the following line:

    $conf['wp_most_recent']['defaults']['<attribute>']='<value>';

    Wiki Syntax

    <wp_most_recent> tag

    <wp_most_recent [attribute1="value1" attribute2="value2" (...)]>[entry_template]</wp_most_recent>

    entry_template

    Entry templates can include tokens, html (FIXME, and wiki syntax):

    <p>@categories@ <b>@title@</b><br/>@time_ago@ - @author@<br/>@content@</p>

    Attributes

    Attribute Default Description
    blog ‘default’ A configured WordPress database alias.
    category none A category constraint or no value to display all categories.
    cat_delimeter ‘, ' A string to join categories if more than one exists.
    cat_max -1 The maximum number of categories to display for an entry or -1 for no limit.
    cat_template ‘@name@’ A template for each category found. This is then used to replace @categories@. Must be HTML encoded! (”=&quot;, etc.)
    content_max 128 The number of chars to truncate a content summary at or -1 for no limit. If needed, the content will be truncated at a word boundary and appended with ‘…’.
    link true Add a link to the title? “true” or “false”
    max 10 The maximum number of entries to display or -1 for no limit.

    Template Tokens

    Tokens are surrounded with ‘@’. Ex: @title@

    Entry Template
    Token Description
    @author@ Entry author’s nickname
    @categories@ Generated using the category template and delimeter
    @content@ Entry content, formatted with the content_max attribute
    @date@ Entry date
    @excerpt@ Entry exceprt
    @time_ago@ @date@ formatted as “1 hour, 7 minutes ago”
    @title@ Entry title. May contain link using @url@.
    @url@ Link to entry.

    Category Template

    Token Description
    @name@ Category name
    @nicename@ Category’s short name

    Upcoming Features

    • category template aliases
    • :-( dokuwiki syntax
    • add user full name, first name, and last name as tokens

    Discussion

    […] I think that there are definite limits to generating an absolute time reference in HTML which are fixed and rapidly become out of date. A better idea would be to make the PHP generate some JavaScript code. The JavaScript code would include a reference to the base time/date the WordPress page was updated. The JavaScript code could then process that code on the fly to produce the finished page that the end user sees. This would ensure that the time/date stamp is always current. […] — ta' lajzar 2005-08-23 00:13
    And it would therefore not require as many cache updates. This is the way to go. - Peter DeWeese
    Implemented. - Peter DeWeese
    it's possible for dotclear 2 to do the same ?
    this is offline, can someone upload the file to somewhere else?
     
    plugin/wp_most_recent.txt · Last modified: 2009/10/10 17:43 by laynee
     
    Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
    Imprint Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki
    WikiForumIRCBugsGitXRefTranslate