2013-06-19 20:59:59 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2014-02-18 07:24:26 +00:00
|
|
|
* Name: [Beta] Chatbox
|
2013-06-19 20:59:59 +01: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
|
2014-03-30 13:26:48 +01:00
|
|
|
$root = get_base_href();
|
2015-10-26 11:22:57 -04:00
|
|
|
$yPath = make_http( $root . "/ext/chatbox/");
|
2013-06-19 20:59:59 +01:00
|
|
|
$page->add_html_header("
|
2014-04-20 04:51:19 -04:00
|
|
|
<script src=\"http://code.jquery.com/jquery-migrate-1.2.1.js\" type=\"text/javascript\"></script>
|
2013-06-19 20:59:59 +01: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\">
|
2014-04-20 04:51:19 -04:00
|
|
|
nickname = '{$user->name}';
|
|
|
|
new YShout({ yPath: '$yPath' });
|
2013-06-19 20:59:59 +01:00
|
|
|
</script>
|
2014-04-23 23:07:10 -04:00
|
|
|
", 500);
|
2013-06-19 20:59:59 +01:00
|
|
|
|
2015-10-26 11:22:57 -04:00
|
|
|
// loads the chatbox at the set location
|
2013-06-19 20:59:59 +01:00
|
|
|
$html = "<div id=\"yshout\"></div>";
|
|
|
|
$chatblock = new Block("Chatbox", $html, "main", 97);
|
2017-08-24 10:17:24 +01:00
|
|
|
$chatblock->is_content = false;
|
2013-06-19 20:59:59 +01:00
|
|
|
$page->add_block($chatblock);
|
|
|
|
}
|
|
|
|
}
|