PHP Headliner |
|
- Bugs
( 9 open / 25 total )
- Support Requests
( 2 open / 5 total )
- Patches
( 2 open / 2 total )
- Feature Requests
( 23 open / 30 total ) - PHP Headliner Development |
PHP Headliner - ManualOverviewHeadliner is a PHP component which provides a web-based portal to usenet news. This guide provides detailed configuration instructions. For a fast route to installation, please read the Quick Start guide. LicenceHeadliner is circulated under the GNU General Public Licence (GPL). Requirements
InstallationExtract to server
Scheduled tasksPHP Headliner needs to be able to periodically load articles from the news server. Also, the cache and read-articles lists need to be purged periodically. The two PHP files in the tasks directory should be executed periodically, this is best done through a cron job, for example: # Every five minutes, query the news server */5 * * * * /usr/bin/php ???/headliner/tasks/synchronise.php # Every night purge the caches 0 1 * * * /usr/bin/php ???/headliner/tasks/purge.php Your must of course replace the '???' above with the installed location of PHP Headliner. A cron job is a scheduled task that is created by inserting an entry into a crontab. Access to the crontab in order to create cron jobs is a typical feature of most commercial Linux/Unix hoting packages. If you do not have access to this facility, you should ask your service provider whether they can provide it. If you do not have access to a crontab or other means of scheduling the above scripts, you can edit 'index.php' at the commented lines so that the news server is querried each time the page is loaded. However, this is not an ideal solution as it will make your site run a bit slower. Configure groupsThe next step is to configure the groups which you wish to provide
a portal for. Within MyConfig.php edit the The following code snippet shows how to configure Headliner to provide a portal to two USENET groups (rec.juggling and rec.gardens) and two local (non-USENET) groups:
$this->groups = array (
"1" => array("name" => "rec.juggling",
"description" => "a readonly USENET forum for juggling and related circus arts",
"posting" => DISABLED),
"2" => array("name" => "rec.gardens",
"description" => "a readonly USENET forum for gardening chat",
"posting" => DISABLED),
"3" => array("name" => "local.headliner.test",
"description" => "a local (non-USENET) forum for test posts",
"posting" => ANON,
"type" => LOCAL),
"4" => array("name" => "local.headliner.help",
"description" => "a local (non-USENET) forum for help with, or questions about Headliner",
"posting" => ANON,
"type" => LOCAL)
);
Construct SchemaOnce the groups have been configured, you must run a script whcih will generate the required
database schema. Simply execute the file TestYou should now be able to navigate to your installation directory of Headliner and see the list of groups which you
configured. In order to populate these groups perform an initial run of the schedule task Applying templatesIt is a relatively straightforward task to configure Headliner so that it blends in with your existing website template. The following files are used by Headliner to render pages: index.php search.php rightpane.php leftpane.php All these files following the same pattern as illustrated in the following example: <? // construct the Headliner GUI class; require_once("lib/NewsReaderGUI.php"); $gui = new NewsReaderGUI(); ?> <html> <head> <title>News Reader</title> <link rel="StyleSheet" href="docs.php?f=docs/news.css" type="text/css"> <? // obtain any javascript required by this page $gui->javaScript(); ?> </head> <body <? echo $gui->bodyEvents(); ?>> <? // render the page $gui->display(); ?> </body> </html> The format of the page can be changed in any way, with extra GUI elements such as menus added. However you must ensure that
the ConfigurationAll configuration changes to Headliner should be performed by modifying
class Config
{
...
// the number of articles to include in an RSS feed
var $rssArticleCount = 50;
...
}
If for example you wish to include just 10 items within the RSS feed, override the default within the constructor
of
class MyConfig extends Config
{
function MyConfig()
{
...
$this->rssArticleCount = 10;
...
// call the super-class constructor
$this->Config();
}
}
Some of the more important configuration changes are detailed below. However a definitive list of configuration changes can be seen
by looking at the code for Data cachingThe construction of thread trees and reference lists can be a time consuming process if Headliner is being used as a portal
for busy groups with a lot of traffic. In order to improve performance Headliner has a data cache which stores thread trees
and other generated data. This is enabled by setting the persistence type to MYSQL_CACHED within $this->persistence = MYSQL_CACHED; There are a couple of variables that can be sued to tune the cache. The first is If caching is being used it should be ensure that the purge task, Marking of read articlesBy default, all articles read by anonymous or authenticated users are marked as read. The IP address of anonymous users is used
to store their read article list. The marking of read articles for anonymous users can be disabled by changing
The read article 'flags' are stored in the database for a 30 day period as a default. This can be changed by modifying
The purign of the read article 'flags' is performed by the purge task, AuthenticationCurrently PHP Headliner does not provide a mechanism for user authentication, i.e. it does not store lists of users with passwords
or present a login screen. Instead, it is designed to plug in to an existing authentication system. To provide plug in to an
existing authentication service you must implement the |
| © Colin Eberhardt | |