Mikedowney.co.uk
What's New
Site Map

Diary
Astronomy
Bits N Bobs
Computing
Food And Drink
Links
Photography
Welcome


Selected Entries
Pinhole Photography
Keeping Quail
Coventry
Recipes
Friends websites
A list of pet related websites
Celebrity Stiffs League

Most popular clicks
Hamsters
Coventry
Pinhole
Shopping
Bits N Bobs
Astronomy
Food And Drink
Animals
Recipes
Humour


RSS Feeds:
RSS Feed Entire Site.
RSS Feed Diary only.


Advanced Search


Powered by Blosxom


Pinhole Photography Ring
pinhole webring logo
powered by RingSurf
Next | Previous
Random Site | List Sites

Previewing Posts

Story location: Home / computing / blosxom /
05/Apr/2008

The Blosxom blogging system doesn't have a built in way of previewing posts before making them publicly visible. There are various plugins available but for me they seemed to overcomplicate things.

I have been using the Blosedit post editor which includes a preview option but if any Blosxom plugins are used to alter the page appearance (such as Markdown or photo galleries) then the page won't display correctly.

My solution requires the entriescache plugin to keep track of posted stories. Normally, any stories will only show if entriescache knows about them. I set the delay variable to a high number eg.

$delay = 9999;

to stop the index from being rebuilt unless I say so. This means that I can add new posts without them showing, until I tell it to rebuild the index.

To display all posts, not just those in the index, I made the following change to entriescache:

sub start {
    # Force a reindex
    $reindex = 1 if (CGI::param('reindex'));
    return 0 if (CGI::param('preview'));
    return 1;
}

Entries are written as normal, then they are viewed by adding ?preview=yes to the end of the URL. If am I happy with the entry, I put ?reindex=yes instead.

This method can also work with the wikieditish plugin too, by adding:

<input type="hidden" name="preview" value="yes" />

to the form in the foot.wikieditish file.


0 comments, click here to add the first permanent link
Keywords:  

Leave a comment...

 
Name:
URL/Email: [http://... or mailto:you@wherever] (optional)
Subject: (optional)
Comments:
How many animals?

Type in how many animals you see.
This is required to verify
that you are an actual human
to reduce 'comment spam'.
Type in how many animals appear in the image. Sorry, this does not work without the image being visible  



Streamline.Net The home of good value web hosting