1 /* Monolith bulletins (recent news spool).
2 * - by Richard W.M. Jones <rich@annexia.org>
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.
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.
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.
18 * $Id: ml_bulletins.h,v 1.4 2003/02/22 15:34:32 rich Exp $
21 #ifndef ML_BULLETINS_H
22 #define ML_BULLETINS_H
29 typedef struct ml_bulletins *ml_bulletins;
31 /* Function: new_ml_bulletins - monolith bulletins (recent news spool)
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
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.
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.
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).
54 * This function returns the widget, or @code{NULL} if the section
55 * could not be found in the database.
57 extern ml_bulletins new_ml_bulletins (pool pool, ml_session session, const char *conninfo, const char *section_name);
59 #endif /* ML_BULLETINS_H */