Add to git.
[monolith.git] / widgets / ml_bulletins.h
1 /* Monolith bulletins (recent news spool).
2  * - by Richard W.M. Jones <rich@annexia.org>
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Library General Public
6  * License as published by the Free Software Foundation; either
7  * version 2 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Library General Public License for more details.
13  *
14  * You should have received a copy of the GNU Library General Public
15  * License along with this library; if not, write to the Free
16  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17  *
18  * $Id: ml_bulletins.h,v 1.4 2003/02/22 15:34:32 rich Exp $
19  */
20
21 #ifndef ML_BULLETINS_H
22 #define ML_BULLETINS_H
23
24 #include <pool.h>
25
26 #include "monolith.h"
27
28 struct ml_bulletins;
29 typedef struct ml_bulletins *ml_bulletins;
30
31 /* Function: new_ml_bulletins - monolith bulletins (recent news spool)
32  *
33  * The bulletins widget is a database-backed recent news spool.
34  * Designated administrators may insert short messages which
35  * appear at the top of the widget. Older items appear below.
36  * Ordinary users see the bulletins, newest at the top, and may
37  * also navigate through older items of news using previous/next
38  * buttons.
39  *
40  * Items are arranged into "sections", each with a unique name.
41  * This allows you to have different bulletins in different applications,
42  * or if building a website with MSP, on different pages in the site.
43  *
44  * News items are stored in a PostgreSQL database. You can find the
45  * schema in the @code{sql/ml_bulletins_create.sql} file in the
46  * source distribution.
47  *
48  * @code{new_ml_bulletins} creates a new widget. You must pass
49  * a @code{pool} for allocation and the current @code{session}
50  * object. For database access, a database connection @code{conninfo}
51  * must be passed in. The @code{section_name} is the name of the
52  * section (from the @code{ml_bulletins_sections} table).
53  *
54  * This function returns the widget, or @code{NULL} if the section
55  * could not be found in the database.
56  */
57 extern ml_bulletins new_ml_bulletins (pool pool, ml_session session, const char *conninfo, const char *section_name);
58
59 #endif /* ML_BULLETINS_H */