This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/contrib/news/main.php

33 lines
793 B
PHP
Raw Normal View History

<?php
/**
* Name: News
* Author: Shish <webmaster@shishnet.org>
* License: GPLv2
2009-01-16 07:02:05 +00:00
* Description: Show a short amount of text in a block on the post list
2009-01-16 08:18:41 +00:00
* Documentation:
* Any HTML is allowed
*/
class News implements Extension {
var $theme;
public function receive_event(Event $event) {
global $config, $database, $page, $user;
if(is_null($this->theme)) $this->theme = get_theme_object($this);
2009-01-04 19:18:37 +00:00
if($event instanceof PostListBuildingEvent) {
if(strlen($config->get_string("news_text")) > 0) {
$this->theme->display_news($page, $config->get_string("news_text"));
}
}
if($event instanceof SetupBuildingEvent) {
$sb = new SetupBlock("News");
$sb->add_longtext_option("news_text");
$event->panel->add_block($sb);
}
}
}
add_event_listener(new News());
?>