info.html
KM|net News 1.1.1
Copyright 1999, 2000 Kendermedia LLC. Created by Kevin Dangoor ([email protected]).
License
The user of this package is granted a non-exclusive license to use, redistribute and/or modify this package in source or binary forms if all of these conditions are met:
- This file is included in the source and/or binary distribution.
- The names of the author (Kevin Dangoor) and copyright holder (Kendermedia LLC) may not be used to promote any product derived from this one without prior written consent.
- If you are distributing a modified version of the package, a notice should be included stating that fact.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
Introduction
KM|net News is a system designed to allow Zope users an easy way to post news to their websites. It is derived from the Zope 1.10 code that originally drove News Byproducts:http://www.byproducts.com.
Features
- Articles may be submitted by readers for review by the editors
- Writers can enter article text on the web or upload it. They can also upload graphics that are stored with the articles.
- Readers can rate the articles, and a list of Favorites (sorted by average rating) can be generated.
- Articles may be set for release at a particular time.
- Articles are automatically sorted based on "importance" and release time.
- Articles may be broken down into different categories.
- Articles have stable URLs.
- Articles that are not "current" in any one of the categories can be viewed in an archive.
- Content can be syndicated in RDF, RSS 0.91 and ScriptingNews formats.
- Articles can point to external sources, as many weblogs do
Getting Started
After installing the package, your first step is to create a "KMArticleStore" instance. This is where all of your articles will go. KMNN will automatically create a ZCatalog within the KMArticleStore. This catalog is called Catalog and will be used to index the articles (which are CatalogAware). If you wish to use a site-wide catalog, you can remove the Catalog object.
Additional Configuration
There are two tabs of configuration information within the KMArticleStore object.
Properties
cat_list: list of categories that articles can belong to article_notify: email address(es) to send new article notifications to. Right now, KM|net News expects to see a MailHost object called "MailHost" in order to send mail.
Syndication
The information on the syndication tab is primarily used for posting your articles to my.netscape.com, my.userland.com and other sites that accept RDF, RSS and ScriptingNews XML formats.
channeltitle: Name of your channel
channeldesc: Description of your channel
channellink: link to your channel's main web page
channellang: language of the channel (table of codes is on Netscape's website)
channelcopyright: copyright info
channeleditor: editor's email address
rdfimageurl: a small image file (old-style my.netscape.com)
imageurl: main image file to be associated with this channel
imagetitle: title to go along with the image
imagelink: URL that the image should link to
imagewidth, imageheight: image width and height
skiphours, skipdays: tokens
properties that accept a list of
hours and days during which you do not publish content
webmaster: your webmaster's email address
Restoring Defaults
There is a "Restore Defaults" tab which will allow you to replace the customizable methods (incoming.html, article_header, etc.) with the original KMNN default methods.
There is also an option to rebuild the Catalog object. This option will delete the old Catalog, create a new one and add all of your articles to the new Catalog.
Submitting Articles
To submit an article go to KMArticleStore/incoming.html (where KMArticleStore is the id of your KMArticleStore instance). This form is reasonably self-explanatory. If you select a file for "Upload Article Text", the file will take the place of anything entered in the text window. This form accepts up to three images files. The "image name" field specifies the id that the image object should have. This should correspond to whatever you put in the tag in your article text.
Note: the AddArticle
method has a proxy role of Manager to
allow it to add the KMArticle object.
Editing Articles
After an article has been submitted, the email addresses listed in the "article_notify" property will receive a message with a link to the edit page for that article. This is equivalent to the Properties tab if you are working in the management interface. In addition to the fields on the "incoming.html" form, there are some fields used to control the display of the article:
status: can be Pending, Approved or Rejected category: the category that the article belongs to label: additional text to print beside the summary (like a "department" on slashdot) top: check this if the article should appear on the top stories page current: check this if the article should appear on the top stories and/or the category page. (If this is not checked, the article may still appear in the archive.) createtime: just for historical purposes release: date/time to release this article. It will not show up in the main article listings or the archive before this time. importance; see below topimg: if you enter the id of an image here, that image will be displayed instead of the normal headline title
The importance value is used to determine where the article appears in the article listings. The articles are sorted based on release and importance. For every 10 points of difference in importance, an article will remain ahead for a day. For example, if an article has an importance of 60, and the other articles that come after it have importance of 50, the 60 point article will be on top until a 50 point article is added at least 24 hours later.
Listing Articles
Methods are provided for listing the articles. You may wish to wrap these methods in other methods to make a cleaner interface for the reader. If you view the KMArticleStore object, you will see the top stories list.
For an article to show up in the top stories list, the following must be true:
- "current" must be checked
- "release" must be earlier than the current date/time
- "status" must be "approved"
- "top" must be checked
For an article to appear in a standard category listing, all of the above must be true, except for the last item.
If you wish to make your main page the top stories list, you could just set up index_html to incorporate the list (remove the "!" character in front of each DTML tag):
<!dtml-var standard_html_header> <!dtml-with art> <!dtml-var "index_html(_.None, _, category='top')"> <!/dtml-with> <!dtml-var standard_html_footer>
Similarly, you can make an "index.rss" method at the top for syndicating the articles:
<!dtml-with art><!dtml-var "index_rss(_.None, _, category = 'top')"><!/dtml-with>
The KMArticleStore methods "index_html", "index_rdf", "index_rss", and "index_sn" all accept a "category" parameter to determine which category of articles is displayed.
Other Methods
KMArticleStore has other useful methods for dealing with the articles.
- article_header and article_footer are created automatically. Article listings use standard_html_header and standard_html_footer, but you may wish to use a different layout when actually viewing articles. The default article_header and article_footer incorporate the standard header/footer.
- genpop is an external method. It updates the "popular.html" method which lists the favorite articles, sorted by user rating.
KMArticle has a method called "rate". Use this method to allow readers to rate the articles. The "rate" method expects form data that includes a field called "newpoints" to be submitted to it. The newpoints value is added to the article's points, and one additional vote is tallied. This is used to calculate a simple average for the "popular.html" listing.
KMArticle also has a "send to a friend" fee Dee. This is implemented via the "send" and "sendit" methods.