Konstrukt::Plugin::blog::DBI - Konstrukt blogging DBI backend
#TODO
Konstrukt blogging DBI Backend driver.
Note that you have to create the tables blog_entry and blog_comment. You may turn on the install setting (see "CONFIGURATION" in Konstrukt::Handler) or use the KonstruktBackendInitialization.pl script to accomplish this task.
blog_entry
blog_comment
install
KonstruktBackendInitialization.pl
You may define the source of this backend:
#backend blog/backend/DBI/source dbi:mysql:database:host blog/backend/DBI/user user blog/backend/DBI/pass pass
If no database settings are set the defaults from "CONFIGURATION" in Konstrukt::DBI will be used.
Initialization of this class
Installs the backend (e.g. create tables).
Parameters:
none
Adds a new blog entry and returns its ID.
$title - The title of this entry
$description - A short abstract of this entry
$content - The entry's content (usually wiki "source code")
$author - The entry's author
$private - Is this entry only visible to the author?
Updates an existing blog entry.
$id - The id of the entry, which should be updated
$content - The entry's content
$update - Update the publication date to "now"
Returns the requested blog entry as an hash reference with the keys id, title, description, content, author, year, month, day, hour, minute, private, comment_count and trackback_count.
Returns undef if the entry does not exist.
undef
$id - The id of the entry
Returns the count of the entries.
Returns the blog entries as an array reference of hash references: { id => .., title => .., description => .., content => .., author => .., year => .., month => .., day => .., hour => .., minute => .., private => .., comment_count => .., trackback_count => .. }
$select = { tags => "tag query string", id => 23, author => 42, year => 1234, month => 5, day => 23, text => fulltext } (optional). This argument is OPTIONAL. If not passed, all entries will be retrieved. It is an hash reference which determines which entries will be retrieved. For each set hash-key only the matching entries will be returned Note that these options are "and"-linked. The tag query string is passed to the "get_entries" in Konstrukt::Plugin::tags method.
$start - The first entry to display. starts with 0
$count - The number of entries to display
Removes an existing blog entry.
$id - The id of the entry, which should be removed
Returns the user IDs of all blog authors as an array reference: [5, 7, 1, 6]
Returns the comments with the specified id as an hash reference: { id => .., entry => .., user => .., author => .., text => .., email => .., email_public => .., email_notify => .., year => .., month => .., day => .., hour => .., minute => .. }
$id - The comment's id
Returns the comments of a specified blog entry as an array reference of hash references: { id => .., entry => .., user => .., author => .., text => .., email => .., email_public => .., email_notify => .., year => .., month => .., day => .., hour => .., minute => .. }
The entries should be ordered by ascending date (earliest post first).
$id - The entry's id
Adds a new comment.
$id - The ID of the article where this comment belongs to.
$userid - The user ID of the author, if registered.
$author - The comment's author.
$email - Author's email address.
$email_public - Shall the email address be published?
$email_notify - Shall the comment's author's get a notification on new comments?
$text - The comment itself.
Deletes an existing comment.
$id - The id of the comment, which should be removed
Returns the trackback with the specified id as an hash reference: { id => .., entry => .., url => .., title => .., excerpt => .., blog_name => .., year => .., month => .., day => .., hour => .., minute => .. }
$id - The trackback's id
Returns the trackbacks of a specified blog entry as an array reference of hash references: { id => .., entry => .., url => .., title => .., excerpt => .., blog_name =>.., year => .., month => .., day => .., hour => .., minute => .. }
Adds a new trackback. Or replace it, if a trackback with that url already exists.
$article - The ID of the article where this trackback belongs to.
$url - The URL of the pinging article (required).
$title - The title of the pinging article (optional).
$excerpt - An excerpt of the pinging article (optional).
$blog_name - The name of the pinging blog (optional).
Deletes an existing trackback.
$id - The id of the trackback entry, which should be removed
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.
Konstrukt::Plugin::blog, Konstrukt
To install Konstrukt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Konstrukt
CPAN shell
perl -MCPAN -e shell install Konstrukt
For more information on module installation, please visit the detailed CPAN module installation guide.