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

27 lines
679 B
PHP
Raw Normal View History

<?php
2009-08-20 22:37:17 +00:00
/*
* Name: News
* Author: Shish <webmaster@shishnet.org>
* Link: http://code.shishnet.org/shimmie2/
* 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 extends Extension {
public function onPostListBuilding(PostListBuildingEvent $event) {
2009-05-11 21:09:24 +00:00
global $config, $page;
if(strlen($config->get_string("news_text")) > 0) {
$this->theme->display_news($page, $config->get_string("news_text"));
}
2009-05-11 21:09:24 +00:00
}
public function onSetupBuilding(SetupBuildingEvent $event) {
2009-05-11 21:09:24 +00:00
$sb = new SetupBlock("News");
$sb->add_longtext_option("news_text");
$event->panel->add_block($sb);
}
}
?>