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/tagger/main.php
Artanis aa2d6537de [ext | tagger]
git-svn-id: file:///home/shish/svn/shimmie2/trunk@493 7f39781d-f577-437e-ae19-be835c7a54ca
2007-09-26 07:23:16 +00:00

37 lines
767 B
PHP

<?php
class tagger extends Extension {
var $theme;
public function receive_event ($event) {
if(is_null($this->theme))
$this->theme = get_theme_object("tagger", "taggerTheme");
if(is_a($event,"DisplayingImageEvent")) {
//show tagger box
global $database;
global $page;
global $config;
$base_href = $config->get_string('base_href');
$tags = $database->Execute("
SELECT tag
FROM `tags`
WHERE count > 1 AND substring(tag,1,1) != '.'
ORDER BY tag");
$this->theme->build($page, $tags);
}
if(is_a($event,"PageRequestEvent") && $event->page_name == "about"
&& $event->get_arg(0) == "tagger")
{
global $page;
$this->theme->show_about($page);
}
}
}
add_event_listener( new tagger());
?>