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/ext/chatbox/main.php

37 lines
1.1 KiB
PHP
Raw Normal View History

2013-06-19 19:59:59 +00:00
<?php
/**
* Name: [Beta] Chatbox
2013-06-19 19:59:59 +00:00
* Author: Drudex Software <support@drudexsoftware.com>
* Link: http://www.drudexsoftware.com
* License: GPLv2
* Description: Places an ajax chatbox at the bottom of each page
* Documentation:
* This chatbox uses YShout 5 as core.
*/
class Chatbox extends Extension {
public function onPageRequest(PageRequestEvent $event) {
global $page, $user;
// Adds header to enable chatbox
$root = get_base_href();
2014-04-20 08:25:08 +00:00
$yPath = make_http("") . "/ext/chatbox/";
2013-06-19 19:59:59 +00:00
$page->add_html_header("
<script src=\"http://code.jquery.com/jquery-migrate-1.2.1.js\" type=\"text/javascript\"></script>
2013-06-19 19:59:59 +00:00
<script src=\"$root/ext/chatbox/js/yshout.js\" type=\"text/javascript\"></script>
<link rel=\"stylesheet\" href=\"$root/ext/chatbox/css/dark.yshout.css\" />
<script type=\"text/javascript\">
nickname = '{$user->name}';
new YShout({ yPath: '$yPath' });
2013-06-19 19:59:59 +00:00
</script>
", 500);
2013-06-19 19:59:59 +00:00
// loads the chatbox at the set location
$html = "<div id=\"yshout\"></div>";
$chatblock = new Block("Chatbox", $html, "main", 97);
$page->add_block($chatblock);
}
}