Initial commit
This commit is contained in:
commit
43ad32700c
7085 changed files with 447606 additions and 0 deletions
56
modules/chat/chat.plugins.php
Normal file
56
modules/chat/chat.plugins.php
Normal file
|
@ -0,0 +1,56 @@
|
|||
<?php
|
||||
If (!defined("in_astat")) {
|
||||
die("Dieses Script kann nicht ausserhalb des Frameworks laufen!");
|
||||
}
|
||||
include dirname(__FILE__).'/chatfunctions.inc.php';
|
||||
class plugins_chat{
|
||||
|
||||
function register_plugins(& $plugin){
|
||||
$plugin->use_hook('nav_finish',array($this,"cusers"));
|
||||
$plugin->use_hook('frontpage_start',array($this,"cusers_head"));
|
||||
$plugin->use_hook('register_end',array($this,"register"));
|
||||
$plugin->use_hook('register_openid_end',array($this,"register"));
|
||||
$plugin->use_hook('admin_user_before_delete',array($this,"delete"));
|
||||
$plugin->use_hook('admin_user_after_create',array($this,"register"));
|
||||
}
|
||||
|
||||
function cusers(& $cont){
|
||||
global $db, $config, $session;
|
||||
$data=chat_online();
|
||||
if ($data["chat_offline"]===true){
|
||||
$data['usercount']='offline';
|
||||
}
|
||||
$cont=str_replace('[users]',$data['usercount'],$cont);
|
||||
}
|
||||
|
||||
function cusers_head($tpl){
|
||||
global $db, $config, $session, $log;
|
||||
$data=chat_online();
|
||||
if ($data["chat_offline"]===true){
|
||||
$tpl->assign('users',"offline");
|
||||
return;
|
||||
}else{
|
||||
$tpl->assign('users',$data['usercount']);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function userlist(){
|
||||
global $db, $config, $rightnav;
|
||||
$rightnav.='<div id="functions"><span id="colorSelector" style="float:left;"><div id="bgcol" style="background-color: #ffffff"></div></span></div>';
|
||||
return;
|
||||
}
|
||||
|
||||
function register($rdata){
|
||||
global $db, $config, $session, $functions;
|
||||
$db->query("INSERT INTO `ptc_users` (`uid`, `color`, `whisperwindow`, `submit`) VALUES ('".$rdata["uid"]."','000000','true',1)");
|
||||
}
|
||||
|
||||
function delete($rdata){
|
||||
global $db, $config, $session, $functions;
|
||||
$db->query("DELETE FROM `ptc_users` WHERE `uid` = '".$rdata["uid"]."'");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
Loading…
Add table
Add a link
Reference in a new issue