Add Fletcher Penney plugins to general.
[matthijs/upstream/blosxom-plugins.git] / general / seewritebacks
1 # Bloxsom Plugin:SeeWritebacks
2 # Author: Fletcher T. Penney
3 # Version: 0.3
4
5 package seewritebacks;
6
7 use CGI;
8
9
10 $seewritebacks = 0;
11 $writebacksform = "";
12
13 sub start {
14         1;
15 }
16
17 sub story {
18         my($pkg, $path, $filename, $story_ref, $title_ref, $body_ref) = @_;
19
20         if ((CGI::param("seewritebacks")) || (CGI::param("plugin") eq 'writeback') || 
21 ($blosxom::path_info =~ /\./)) {
22                 $seewritebacks = 1;
23                 $writebacksform = &$blosxom::template($path,'writebacksform',$blosxom::flavour) || &$blosxom::template($path,'writebacksform','general');
24                 $writebacksform = &$blosxom::interpolate($writebacksform);
25         }
26
27         1;
28 }
29
30 1;
31
32
33 __END__
34
35
36 =head1 NAME
37
38 Blosxom Plug-in: seewritebacks
39
40 =head1 DESCRIPTION
41
42 This plugin makes it easy to have a consistent writebacks interface to your site, that is compatible with multiple themes.  For example, you can create a blue flavor, and a red flavor for your site that change the appearance, but still have writebacks enabled.  With the default writebacks plugin, this gets complicated and requires a separate writebacks flavor for each primary flavor.
43
44 Well, say goodbye to that!!
45
46         1) Drop this plugin into your plugins directory.
47         2) Copy the writebacksform.general file to your flavor directory or your datadir.
48         3) Make sure you still have the writeback.$flavour file of your choosing installed
49         4) Put "$seewritebacks::writebacksform" at the end of your story.$flavor file
50         5) Make the following changes to your story.$flavor file:
51 Original:
52 (<a href="$url$path/$fn.$flavour">$writeback::count Comments</a>)
53
54 Modified:
55 (<a href="$url$path/$fn.$flavour?seewritebacks=y">$writeback::count Comments</a>)
56
57 Note that your story.flavor file may be slightly different.  You are adding the ?seewritebacks=y to the url, which causes this plugin to act.
58
59         6) Repeat steps 4-5 for each flavor that you wish to update.
60         7) If you choose, you can create a writebacksform.$flavor file to customize the appearance for each flavor, but this is unnecessary.
61
62         It sounds complicated, but it's not that bad.  If you have suggestions on how to improve these instructions, let me know.
63
64         The upshot is that you can now have multiple flavors for your site that change the appearance, and all of them can use writebacks, and plugins such as breadcrumbs don't give unexpected results.
65
66  
67 =head1 CHANGES
68
69 0.3     Forced interpolation as interpolate_fancy broke the previous interpolation.  Thanks to Andy for this report.
70
71 0.2     Added a patch to allow the writebacks plugin to set $seewritebacks to 1 to ensure that a comment is displayed as soon as it is posted
72
73 0.1     Initial Release
74
75 =head1 AUTHOR
76
77 Fletcher T. Penney - http://fletcher.freeshell.org
78
79
80 =head1 LICENSE
81
82 This source is submitted to the public domain.  Feel free to use and modify it.  If you like, a comment in your modified source attributing credit to myself for my original work would be appreciated.
83
84 THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY WARRANTY OF ANY KIND.  USE AT YOUR OWN RISK!