2007-04-16 11:58:25 +00:00
|
|
|
<?php
|
2009-08-20 23:37:17 +01:00
|
|
|
/*
|
2008-04-11 06:12:07 +00:00
|
|
|
* Name: News
|
|
|
|
* Author: Shish <webmaster@shishnet.org>
|
|
|
|
* License: GPLv2
|
2009-01-15 23:02:05 -08:00
|
|
|
* Description: Show a short amount of text in a block on the post list
|
2009-01-16 00:18:41 -08:00
|
|
|
* Documentation:
|
|
|
|
* Any HTML is allowed
|
2008-04-11 06:12:07 +00:00
|
|
|
*/
|
2007-04-16 11:58:25 +00:00
|
|
|
|
2009-05-11 14:09:24 -07:00
|
|
|
class News extends SimpleExtension {
|
|
|
|
public function onPostListBuilding($event) {
|
|
|
|
global $config, $page;
|
|
|
|
if(strlen($config->get_string("news_text")) > 0) {
|
|
|
|
$this->theme->display_news($page, $config->get_string("news_text"));
|
2007-04-16 11:58:25 +00:00
|
|
|
}
|
2009-05-11 14:09:24 -07:00
|
|
|
}
|
2007-07-17 18:07:18 +00:00
|
|
|
|
2009-05-11 14:09:24 -07:00
|
|
|
public function onSetupBuilding($event) {
|
|
|
|
$sb = new SetupBlock("News");
|
|
|
|
$sb->add_longtext_option("news_text");
|
|
|
|
$event->panel->add_block($sb);
|
2007-04-16 11:58:25 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|