| Download | plugin-blog.tgz |
|---|---|
| BundleHub | Configure your own DokuWiki blogsuite install package, consisting of all mandatory plugins plus any optional features you want to include: BlogSuite BundleHub |
| Tips | If you intend to use this plugin be sure to take a look at the blogging tips page |
The Blog Plugin makes blogs in your wiki easily possible. The blog component shows the latest entries (pages) from a namespace in reverse chronological order. In this new version, the creation date is the sort key – no longer the date of the last non-minor modification as in previous versions. The archive component lists all entries that were written (created) in the given month.
If you use this plugin for blogging you might want to join Planet DokuWiki.
The blog plugin can be configured using the DokuWiki configuration manager available in the admin menu.
namespace | The default namespace which is used if no namespace was given in the syntax |
|---|---|
formposition | You can choose to display the new entry form either above or below the blog entries |
dateprefix | A date prefix that automatically gets added to pages created with the new entry form. You can use the options from the strftime php function, namespace separators work as well ie. %Y:%m%d |
sortkey | Defines how the blog entries are sorted. Available options are creation date, modification date, page name, page ID and page title (first headline) |
sortorder | Sort the blog entries ascending/descending |
{{blog>[namespace]?[number]&[flags]}}
| [namespace] | namespace for the blog; subspaces will be searched as well; * is the whole wiki, . is the same namespace as the page lies in | optional; default is the blog namespace set in the configuration |
|---|---|---|
| [number] | number of entries to show per page | optional; default is 5 |
| [flags] | include flags delimited by &, see flags | optional |
This includes a specified number of most recent blog entries from the given namespace into the current page. Below the entries a link to the page (permalink), the author, the creation date and the number of comments are shown. Link, author, date and comments info can be hidden. At the end of the blog a link to older entries lets you navigate in the history of the blog. At the very end, if you have enough rights to create new pages, a form for new blog entries is displayed.
{{archive>[namespace]?[month]&[flags]}}
| [namespace] | the namespace for which you want an archive list; * is the whole wiki, . is the same namespace as the page lies in | optional; default is the namespace specified in the configuration |
|---|---|---|
| [month] | the month for the archive list in YYYY-MM format; * for all pages | required |
| [flags] | pagelist flags delimited by &, see flags | optional |
Shows a table with all pages of the given namespace that were created in the specified month.
You can try this plugin here.
Please report bugs at the Bug tracker.
Please also have a look at the blogging tips page!
Make sure you run the latest version of all required plugins and DokuWiki.
Yes, the plugin uses the dformat option to format the date.
You can use the meta plugin to manually set the creation date (and modification date) in the page source, then select the modification date in the blog plugins order setting. An alternative solution would be to alter the timestamps of the created files, and remove the <dokuwiki>/data/index/cdate.idx (make backups if you intent to do that!!)
The namespace parameter seems to be locked to the top of the site. I had thought that specifying a relative namespace (like ”.:news”) in the config would let people add their own news/status item lists to whatever parts of our site that they liked, but new entries were created all together in /news rather than under the namespace of the page where the “blog” tag appeared. Is this the intended behavior? It seems like the plugin would be perfect for news/status items, otherwise.
We have a wiki (http://php.twofourfour.org/dokuwiki/start) with 3 blogs in separate namespaces but one of them (http://php.twofourfour.org/dokuwiki/ltu/lulea) didn't want to show up until I forced the first post. The “New blog entry” box would show up in the preview but not in the saved page. Only after I created a first post via the preview did it work. Possible bug?
Original question was: I 'imported' some blog posts from my old wiki into my new installation by copying the files while preserving the modification date (cp -punder linux). I configured the blog plugin to sort posts by their creation date. But now on the blog overview page all the imported posts show up with a date when I copied the file in their footer instead of the date when the file was originally created (in my old wiki). Where does this date come from? – Robert
I think I already found out something: Could it be that the indexer does some work here? Could it be that the indexer has a bug, when he finds a completely new pages/somepost.txt? I think then it creates meta/somepost.meta with wrong dates or no dates at all. –Robert
This is not a bug of the indexer, but the desired functionality. Imagine someone edited a page outside of DokuWiki with a text editor, the indexer looks at the timestamps, if the timestamp is newer then the latest cached revisions it asumes (correctly) that the page has been modified. The only way to prevent this from happening is to make sure that the way you “import” the blog posts into the new Wiki preserves the file timestamps (Linux:cp -a). — Michael Klier 2008/10/10 17:22
Thank you for your quick reply. Wow I learned a lot about Dokuwiki internals the last two nightsOk, where I am heading to: I would be willing to write a detailed “HowTo import blog posts”. But as it seems an import is only possible if you sort your posts by date last changed. Even
cp -p(in bash) does not preserve the date created, since there is no such thing as date created under linux. php's functionfilectimeonly asks for the time the file's inode was last changed.
Lets dig into the details and have a look at the code. (Please correct me if anything is wrong here. All code is from the most current version of »> dokuwiki. Don't worry I'll soon refactor all this into an easy to read HowTo.)
You copy you blog post into you new dokuwiki:cp -p <oldwiki>/data/pages/mypost.txt <newwiki>/data/pages/
Once you actually view one of your blog posts in your browser, the indexer creates some additional files:
*data/meta/mypost.indexedand
*data/mega/mypost.meta
The meta index DOES NOT contain any date information. Thelib/exe/indexer.php(lines 218) tries to extract some$infofrom thechange.log. Which of course does not exist for the newly copied page, yet. As a consequece (line 226) no date can be written to themypost.meta.
lib/exe/indexer.php:
>>> // gather some additional info from changelog >>> $info = io_grep($conf['changelog'], >>> '/^(\d+)\t(\d+\.\d+\.\d+\.\d+)\t'.preg_quote($ID,'/').'\t([^\t]+)\t([^\t\n]+)/', >>> 0,true); >>> >>> $meta = array(); >>> if(!empty($info)){ ... } # $info array will be empty for new files (=imported blog posts) >>>
When you look at your blog overview page the blog plugin
* first tries to get the date last modified from the meta information (plugin/blog/helper.phpline 88)
* since that fails, it gets the date last modified via the php function filectime()
plugin/blog/helper.php:
>>> $date = $meta['date']['created']; >>> if (!$date) $date = filectime(wikiFN($id)); >>>
PHP manual about filectime:
Note also that in some Unix texts the ctime of a file is referred to as being the creation time of the file. This is wrong. There is no creation time for Unix files in most Unix filesystems.
To conclude: The blog plugin does the best it can to get the correct date created. But in the end this is not possible cause of limitations from the underlying filesystem.
⇒ Could I write a script that manually sets the metadata of my blog posts to a date I want. (When the metadata exists, it would be used by the blog plugin?
⇒ I am happy about any comments and/or corrections. As I said don't worry, I'll soon refactor all this. To all the dokuwiki developers: Keep up the good work! Robert
I've exactly got the same problem. Currently, i'm using the blog plugin version linked at the top of this page (the 2008-07-18 version). There is more this problem … but … i've got an other problem with it !! In the title, there a link on the post. It's very ugly! How can I remove the link ?? — Arnaud Fouquaut 2008/10/29 00:30
Hello I need to know where the blog plugin saves the data of the content. I have troubles restoring because in the file under the blog directory there is only the Entry
~~DISCUSSION~~
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 3.0 Unported