Remove date_translate (redundant with date_fullname)
[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
43 site, that is compatible with multiple themes.  For example, you can create a
44 blue flavor, and a red flavor for your site that change the appearance, but
45 still have writebacks enabled.  With the default writebacks plugin, this gets
46 complicated and requires a separate writebacks flavor for each primary flavor.
47
48 Well, say goodbye to that!!
49
50         1) Drop this plugin into your plugins directory.
51         2) Copy the writebacksform.general file to your flavor directory or your datadir.
52         3) Make sure you still have the writeback.$flavour file of your choosing installed
53         4) Put "$seewritebacks::writebacksform" at the end of your story.$flavor file
54         5) Make the following changes to your story.$flavor file:
55 Original:
56 (<a href="$url$path/$fn.$flavour">$writeback::count Comments</a>)
57
58 Modified:
59 (<a href="$url$path/$fn.$flavour?seewritebacks=y">$writeback::count Comments</a>)
60
61 Note that your story.flavor file may be slightly different.  You are adding
62 the ?seewritebacks=y to the url, which causes this plugin to act.
63
64         6) Repeat steps 4-5 for each flavor that you wish to update.
65     7) If you choose, you can create a writebacksform.$flavor file to
66        customize the appearance for each flavor, but this is unnecessary.
67
68 It sounds complicated, but it's not that bad.  If you have suggestions on how
69 to improve these instructions, let me know.
70
71 The upshot is that you can now have multiple flavors for your site that change
72 the appearance, and all of them can use writebacks, and plugins such as
73 breadcrumbs don't give unexpected results.
74
75 =head1 CHANGES
76
77 0.3     Forced interpolation as interpolate_fancy broke the previous
78 interpolation.  Thanks to Andy for this report.
79
80 0.2     Added a patch to allow the writebacks plugin to set $seewritebacks to 1 to
81 ensure that a comment is displayed as soon as it is posted
82
83 0.1     Initial Release
84
85 =head1 BUGS
86
87 None known; please send bug reports and feedback to the Blosxom
88 development mailing list <blosxom-devel@lists.sourceforge.net>.
89
90 =head1 AUTHOR
91
92 Fletcher T. Penney - http://fletcher.freeshell.org
93
94 This plugin is now maintained by the Blosxom Sourceforge Team,
95 <blosxom-devel@lists.sourceforge.net>.
96
97 =head1 LICENSE
98
99 This source is submitted to the public domain.  Feel free to use and modify
100 it.  If you like, a comment in your modified source attributing credit to
101 myself for my original work would be appreciated.
102
103 THIS SOFTWARE IS PROVIDED AS IS AND WITHOUT ANY WARRANTY OF ANY KIND.  USE AT
104 YOUR OWN RISK!