NAME

Konstrukt::Plugin::blog - Konstrukt blogging engine

SYNOPSIS

        <& blog / &>
        

DESCRIPTION

This Konstrukt Plug-In provides blogging-facilities for your website.

You may simply integrate it by putting

        <& blog / &>
        

somewhere in your website.

To show a form to filter the entries put

        <& blog show="filter" / &>
        

in your page source.

If you want to get your content as an RSS 2.0 compliant XML file you may want to put

        <& blog show="rss2" / &>

alone in a separate file.

If you want to allow trackbacks to your blog entries, you have to to put

        <& blog show="trackback" / &>

alone in a separate file, which you should advertise as the trackback ping URL.

The HTTP parameters "email" and "pass" will be used to log on the user before retrieving the entries. This will also return private entries.

        http://domain.tld/blog_rss2.ihtml?email=foo@bar.baz;pass=23

CONFIGURATION

You may do some configuration in your konstrukt.settings to let the plugin know where to get its data and which layout to use. Default:

        #backend
        blog/backend                  DBI
        
        #layout
        blog/entries_per_page         5
        blog/template_path            /templates/blog/
        
        #user levels
        blog/userlevel_write          2
        blog/userlevel_admin          3
        
        #rss export
        blog/rss2_template            /templates/blog/export/rss2.template
        blog/rss2_entries             20 #number of exported entries
        
        #prefix for cached rendered article markup
        blog/cache_prefix             blog_article_cache/
        
        #use a captcha to prevent spam
        blog/use_captcha              1 #you have to put <& captcha / &> inside your add-template
        
        #the content type of the entries.
        #will be sent to trackback services.
        blog/trackback/content_type   utf-8
        #permalink URI to your blog entries.
        #will be sent to the pinged sites. the parameter ?action=show;id=42 with the correct id of the entry will be appended.
        #by default, this setting is undefined and the plugin tries to guess the right permalink, what may fail
        blog/trackback/permalink      http://your.site/blog/
        

See the documentation of the backend modules (e.g. "CONFIGURATION" in Konstrukt::Plugin::blog::DBI) for their configuration.

METHODS

execute_again

Yes, this plugin may return dynamic nodes (i.e. template nodes).

init

Initializes this object. Sets $self->{backend} and $self->{template_path}. init will be called by the constructor.

install

Installs the templates.

Parameters:

none

prepare

Prepare method

Parameters:

  • $tag - Reference to the tag (and its children) that shall be handled.

execute

All the work is done in the execute step.

Parameters:

  • $tag - Reference to the tag (and its children) that shall be handled.

add_entry_show

Displays the form to add an article.

add_entry

Takes the HTTP form input and adds a new blog entry.

Desplays a confirmation of the successful addition or error messages otherwise.

extract_and_ping_trackbacks

Accepts the blog entry's content and trackback links, tries to discover trackbacklinks from the pages linked in the content and sends pings to all websites, that have been referenced.

Parameters:

  • $id - The id of the blog entry.

  • $title - The title of the blog entry.

  • $excerpt - The description/excerpt of the blog entry.

  • $content - The content of the blog entry, that may contain links to websites, for which a trackback autodiscovery may be performed.

  • $trackback_discovery - True, if autodiscovery should be performed.

  • $trackback_links - The newline-separated trackback-links that have been explicitly specified by the user

Generates a permalink to a blog entry using the settings or guessing it.

Parameters:

  • $id - The id of the blog entry.

edit_entry_show

Grabs the article from the backend and puts it into a form from which the user may edit the article.

Displays the form to edit an article.

edit_entry

Takes the HTTP form input and updates the requested blog entry.

Displays a confirmation of the successful update or error messages otherwise.

delete_entry_show

Displays the confirmation form to delete an article.

delete_entry

Deletes the specified entry.

Displays a confirmation of the successful removal or error messages otherwise.

show_entry

Shows the requested blog entry including its comments

Displays the entry or error messages otherwise.

Parameters:

  • $id - ID of the entry to show (optional)

show_entries

Shows the blog entries

Displays the entries or error messages otherwise.

format_and_cache_content

Take plain text and formats it using the wiki plugin. Caches the result. If a cached file already exists, the cached result will be used.

Returns a field tag node contatining the formatted output nodes.

Parameters:

  • $id - The ID of the article

  • $content - The (plaintext) content

delete_cache_content

Deletes the content cache for a given article

Parameters:

  • $id - The ID of the article

add_comment_show

Takes the specified entry ID or HTTP form input and shows the form to add a comment.

Displays the form to add a comment.

Parameters:

  • $id - ID of the entry, which shall be commented. (optional)

add_comment

Takes the HTTP form input and adds a new comment.

Displays a confirmation of the successful addition or error messages otherwise.

delete_comment

Takes the HTTP form input and removes an existing comment.

Displays a confirmation of the successful removal or error messages otherwise.

filter_show

Displays the form to select articles.

export_rss

Generates an RSS 2.0 compliant XML file with the content from the database.

trackback_ping

Pings a specified trackback address with the specified information.

Returns true on success, false otherwise.

Parameters:

  • $url - The URL of the trackback link

  • $info - The information about the pinging article. A hashref containing this information:

            {
                    url => 'URL of the entry (required)',
                    title => 'Title of the entry (optional)',
                    excerpt => 'Excerpt of the entry (optional)',
                    blog_name => 'Name of the blog (optional)',
            }

trackback_discover

Downloads a blog entry and tries to discover the trackback link to this entry.

Returns the URL of the trackback link on success, undef otherwise.

Parameters:

  • $url - The URL of the blog entry

trackback_process

Processes an incoming trackback request. The ID of the blog entry must be specified as an URL parameter:

        http://your.site/blog/trackback/id=42

Returns the appropriate response to the client.

Parameters: none

delete_trackback

Takes the HTTP form input and removes an existing trackback.

Displays a confirmation of the successful removal or error messages otherwise.

AUTHOR

Copyright 2006 Thomas Wittek (mail at gedankenkonstrukt dot de). All rights reserved.

This document is free software. It is distributed under the same terms as Perl itself.

SEE ALSO

Konstrukt::Plugin::blog::DBI, Konstrukt::Plugin, Konstrukt