How do I create a preview for an entry, eg. in a forum?

<!-- The following entry in the template is already enough: --><textareaid="inputfield"name="text"></textarea>[%preview%]

Figure: Example of the representation in the Browser

How do I create "micro-summaries" for Firefox 2.0 and higher?

"Micro Summaries" are "active bookmarks", meaning hyperlinks, whose text can be dynamically updated when the content of the website changes, to which the link points. The Firefox browser offers Micro Summaries automatically, if the user creates a bookmark of a page that has that feature.

Examples of this would be:

The number of downloads on a download site

The latest headline on a news website

The number of new, unread messages in your inbox at a web-mail service

The current amount of donations to a nonprofit initiative

The date of the last modification of a file

Or the latest entry in a guestbook or forum

Other variants are of course possible.

Micro Summaries are supported by the Yana Framework. They are created using the utility-class "Micro Summary". Take a look at the following examples:

<?php
/* creating a mirco-summary in your plug-in */
Microsummary::set($this->name, 'link text');
/* Please note:
Â * The first parameter is an unique id,
Â * which identifies the entry.
Â * Here: $this->name is used as id,
Â * because the name of the plug-in is unique.
Â * However, it is possible to use any other text.
Â * For example, when you want to create multiple entries for the
Â * same plug-in.
Â */
/* reading a micro-summary in your plug-in */
$microsummary = Microsummary::get($this->name);
/* publishing a micro-summary in your plug-in,
Â * so that the browser can find it, when viewing the page
Â */
Microsummary::publish($this->name);
/* To open the micro-summary in your browser: */
index.php?action=get_microsummary&target=guestbook
/* For testing, the URL must be copied to your browser.
Â * The argument "target" names the id of the micro-summary you want to view.
Â */
?>

How do I create RSS feeds?

"RSS-Feeds" are electronic, (mostly) automatically generated and updated lists, which may provide various information. A visitor may read these with any "RSS reader" software. Modern browsers already have this functionality built in, so that visitors no longer need additional software.

Examples for RSS-Feeds:

The recent reports of an electronic newspaper

The latest entries of a web-log

The latest comments in a guest book

The Yana Framework supports the creation of RSS feeds for your applications. Therefor you can use the prepared classes "RSS" and "RSSitem". The following are some examples.

<?php
/* To create a RSS feed for your plug-in, first create a new function.
(Change the name as you see fit. Note that the name must be unique.) */
function my_rss_feed($ARGS)
{
$rss = new RSS();
// choose a title and description
$rss->title = 'Mike Miller\'s News';
$rss->description = 'this is my RSS feed for my web site';
// add an entry
$item = new RSSitem();
$item->title = 'Entry 1';
$item->link = 'http://any.url';
$item->description = 'A short text, describing the content, or a text excerpt.';
// add the entry to the RSS feed
$rss->addItem($item);
// a 2nd eintry
$item = new RSSitem();
$item->title = 'another item';
$item->link = 'http://any.other.url';
$item->description = '2nd description';
$rss->addItem($item);
// output the RSS feed to the browser
print utf8_encode($rss->toString());
exit(0);
}
/* You can have a link to the RSS feed viewed in the application.
To do so use the function RSS::publish() and the name of the function,
that creates the RSS feed.
Tip: The best place to do this is is the constructor
of your plug-in.*/
function plugin_my_test($name)
{
RSS::publish('my_rss_feed');
// more source code may follow here
}
?>