BlogSimple

Summary: Experimental blog bundle using pagelists
Status: Stable
Version: 2006-12-12
Prerequisites: pmwiki-2.1
Maintainer:
Categories: CMS Blog

Question

How can I create a simple blog using pagelists?

Answer

Download and install blogsimple.zipΔ
Download and install commentboxplus.zipΔ
Download and install newpageboxplus.phpΔ

  • Blogsimple is an experimental blog bundle built on pagelists.
  • It uses the enhanced pagelist and page variables capabilities introduced in pmwiki version 2.1.beta15.
  • It has been developed for use with Triad skin?, which is a three column skin
  • It uses both SideBar and RightBar.
(It could be adapted for a two column skin by moving lists from RightBar to SideBar.)

Included are blogsimple.php and a number of wiki pages for an automatic set up of the blog in groups Blog, BlogPages, BlogComments, BlogArchive and BlogCategories.

Installation

unzip into the cookbook/ directory which should create directories

 cookbook/blogsimple/            
         files:blogsimple.php
               README.txt 
 cookbook/blogsimple/wikilib.d/  pmwiki page store with blog configuration pages

add to config.php:

 include_once("$FarmD/cookbook/blogsimple/blogsimple.php");
 # the following only if not installed already in cookbook:
 include_once("$FarmD/cookbook/newpageboxplus.php"); 
 include_once("$FarmD/cookbook/commentboxplus.php");

You can only use either commentboxplus.php or commentbox.php, so if you have commentbox.php installed uninstall it and install commentboxplus.php instead.

Use:

Open the wiki and go to Blog.Blog, which is the blog homepage.

  • Configuration pages are in group Blog.
  • Blog pages are in group BlogPages.
  • Blog comments are in group BlogComments.
  • Archive pages are in group BlogArchive.
  • Category pages are in group BlogCategories.

This means all your blog pages are in one group. If you need blog pages in several groups try BlogSimple2 instead.

Notes

This blog works basically using pmwiki’s pagelist markup to generate the various lists you see:

  1. the blog homepage with a number of most recent blog pages (this is a pagelist!)
  2. archive and category pages with the relevant blog pages (as pagelists)
  3. a list with recent posts on the left sidebar
  4. a list with monthly archives on the right bar
  5. a list with blog categories on the right bar
  6. a list with recent comments to blog posts on the right bar

The blog entries are stored as wiki pages in the group BlogPages. The names can carry a date prefix for easy page handling, but this part of the name gets hidden in the page title. It is also not strictly necessay to have the date part in the page name, but it makes file management perhaps easier. Any comments are stored in the group BlogComments on a page with the same name as the blog page. Blog category pages are stored in the group BlogCategories, and archive pages are stored in the group BlogArchive. All the template pages are in the group Blog.

New blog entries are added with the newpagebox form using NewPageBoxPlus. Comments are added with a commentbox using CommentBoxPlus.

A comment page is included in the blog page with (:include ..:) markup, as is the blog page on top in the comment page, i.e. they always appear together when viewed in both Blog Pages and Blog Comments group.

The blog has a BlogConfiguration page from where all the various configuration pages can be accessed, as well as new category and archive pages been added using again a newpagebox form. Blog category and archive pages need to be manually created using the form on the config page. Categorising a blog page is the same as for a normal wiki page using the [[!category]] link syntax. Pages categorised that way appear on the normal wiki category page, as well as on the specially created blog category page. So blog categories are a subset of all categories and show only blog pages, not pages from other groups.

Advantages

  • Using pagelist to create the various lists and blog homepage and archives etc makes the blog very dynamic. Adding blog pages and any later removals of them is automatically reflected in the lists. No further maintainance is required.

Disadvantages (but not so bad really)

  • Pagelist does not permit (as yet) creation of any hard wikitrail pages, which may mean a slower page display as the pagelists need to be generated first.
  • This recipe was last tested on PmWiki version: 2.1.beta26
  • This recipe requires at least PmWiki version: 2.1.beta26

Updates

  • 2006-12-12: Maintenance update for use with lates commentboxplus script. Removed commentboxplus and newpageboxplus from the zip file to help future upgrades. Small changes to the config page and to BlogPages.GroupFooter.
  • 2006-10-28: Added $RecipeInfo. Adjusted some links on default pages to work with pmwiki 2.2.0beta
  • 2006-08-21: Fixed in BlogPages.GroupFooter link to new BlogComments page. Replaced in BlogComments.GroupFooter form based on(:input:) markup with (:commentboxchrono:). Revised README.txt.
  • 2006-08-18: Updated newpageboxplus.php and commentboxplus.php in zip file.

Note: Remove any old blog configuration pages which have been edited first.

  • 2006-04-10: Added double horizontal rule markup (as comment). Deleted (:if exist ... :) markup definition (now part of pmwiki core). Updated commentboxplus.php and newpageboxplus.php.
  • 2006-03-27: Updated commentboxplus and newpageboxplus.php.
  • 2006-02-27: Added a "save" option to newpageboxplus, which is used to add new archive and category pages: enter name, click button, and the page is created. Changed the BlogArchive and BlogCategories index pages to use pagelists, so they don't need manual additions of links. Changed Blog.RightBar to use pagelists for archives and categories and not using the index pages as trailpage. Updated Blog.BlogConfiguration.
  • 2006-02-22: Added anchors for comments and commentbox, so link to add comment opens page at commentbox, and link to latest comment opens page at that comment. All this facilitated through changes to commentboxplus.php and pages Blog.BlogListTemplates, BlogComments.GroupFooter, BlogPages.GroupFooter, BlogComments.GroupHeader. Also restructured page Blog.BlogConfiguration. This version needs pmwiki 2.1.beta26
  • 2006-02-11: Added rss and atom feed links for html headers, so visitors with browsers like Firefox can add the blog as a bookmark feed link. Removed entry in list=blog pattern which prevented listing of current page. Current page will be listed in SideBar now.
  • 2006-01-22: Changed directory structure for installation (all in cookbook/blogsimple/). Changed blog group structure by creating BlogArchive for archive pages and BlogCategories for category pages. Note: existing installations need a complete new install because of these changes.
  • 2006-01-17: Initial experimental release.

Notes

The latest CommentBoxPlus script allows use of Access Codes. If you use a custom build form to enter comment, using (:input:) markup (as distributed up till now) and want to use Access Codes, then you need to modify your form, or replace it with (:commentboxchrono:) in BlogComments.GroupFooter. A modified version with AccessCode may look like this:

[[<<]](:title {$BlogTitle}:)
>>left<<[[#commentbox]]
(:input form name=cboxform action={$PageUrl} method=post:)
(:input hidden n {$FullName}:)
(:input hidden action comment:)
(:input hidden accesscode {$AccessCode}:)(:input hidden order chrono:)'''Add Comment:'''[[<<]]
(:input textarea text rows=7 cols=50 class=inputtext:)[[<<]]
Author: (:input text author {$Author} class='inputbox':)
Enter code %red%'''{$AccessCode}'''%% (:input text access size='4' maxlength='3' class=inputbox:)\
 (:input submit post Post class='inputbutton':)\
 (:input reset reset Reset class='inputbutton':)(:input end:)
>><<
----
Back to [[BlogPages/{$Name}|{$BlogTitle}]]\
  -- [[Blog.Blog| Blog Home Page]]

Comments

The $BlogMonth and/or $BlogMonthTitle variables ( cannot contain special characters. I have a problem with a German wiki using blogsimple. The Archive name for march in German is "März" and the umlaut doesn't get recognized. The wiki is utf-8 encoded. Can you help me here? hombre June 12, 2006, at 05:14 AM


I am really happy about this good working skript. But I have the problem even with the file names when using special characters like "ü" in the title. For example , while the title is shown correctly, the file name is like "Für" instead of "Für". Then as consequence there are lines like {BlogComments.2006-06-23-Für} on the website, a line that is not meant to be seen at all. I think somebody who knows programming php just has to add a line to the script to change that...? I would appreciate it a lot. michi? June 24, 2006, at 20:10 PM


The $Title variable seems to be the same like $Name...why? I want a title which is lower case like (:title this is lower case:). flox July 12, 2006, at 06:38 PM


This has been a great startup for my blog website. A new interesting feature would be to have trackback comments, meaning being able to be notified when someone talks about our post. It begins to be more popular, see http://codex.wordpress.org/Glossary#Trackback. I'm just writing the idea cause I'm not a PHP expert so maybe someone else will see how to implement this faster than me. joelmig? July 21, 2006, at 20:10 PM

I have no idea how to add Trackback/Ping to pmwiki. Maybe someone else is working on it? ~HansB


Spammers have found my site and I get very boring comments. What's the best thing to do about this? Is it easy to force the user to enter a password

when creating a comment (and then for instance display the password somewhere on the page)? JeeBee March 19, 2007. Use a CommentBox with an Accesscode field. See CommentBoxPlus - HansB


Hi, HansB, I installed this recipe and it worked perfectly with only one little problem. While the "recent comments" display the comment page name(with no date), it's somehow difficult to understand when using, say, Chinese characters. I'm wondering if it is possible to use {$Title} instead of {$BlogTitle} ? In my simple thinking, maybe it can be done by copy the blog page (:title:) PTV to comment page while a comment had been summit. imoc 2007-12-30

Hi Hans! It seems like I have quite a bit of contact with you now and then. ;-) So, I have a very simple question that could probably be answered by anyone, so hopefully anyone will do so. Anyway, I've installed Blog Simple exactly as stated and am using PMWiki 2.2.0 beta 65 with the Triadskin. So, my problem is that the title on the [[Blog/Blog]] page is "BlogListTemplates." How would I change this title to say "Blog Forum" or something of that nature? thanks, Chris March 19, 2024, at 06:57 AM

perhaps put a title markup like (:title Blog forum:) at the bottom of the page. HansB

C: Perfect! Thanks Hans -Chris March 19, 2024, at 06:57 AM

Thanks Hans! Great work with all your stuff. A little tweak I did was I changed the #Today variable to display the time as well. This way, if there are multiple blogs in a day, it's ordered correctly.

$FmtPV['$Today'] = 'strftime("%Y%m%d-%H%M", time() )';

I put the short list in the rightbar and I used the blog as a new tracker for my website/associated game. It's working out much better than I had hoped! --Sarif - Dec 14, 2008

See Also

Contributors


Category: Blog CMS

User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.