Small layout and compliance updates
This commit is contained in:
parent
fe9ecfad73
commit
45ca500cc3
6 changed files with 66 additions and 40 deletions
|
@ -17,23 +17,13 @@ class chat extends ajax_module{
|
|||
|
||||
function daytime() {
|
||||
$now = time();
|
||||
$sunrise = date_sunrise($now, SUNFUNCS_RET_TIMESTAMP, 47.6880, 13.1344);
|
||||
$sunset = date_sunset( $now, SUNFUNCS_RET_TIMESTAMP, 47.6880, 13.1344);
|
||||
return ($sunrise < $now && $now < $sunset);
|
||||
$sun = date_sun_info($now, 47.6880, 13.1344);
|
||||
return ($sun['sunrise'] < $now && $now < $sun['sunset']);
|
||||
}
|
||||
|
||||
|
||||
if($_POST['call']=='userlist'){
|
||||
if($session->userdata['uid']!=0){
|
||||
/*if (!$fh = fopen('http://'.$curl.':'.$config['SOCK_PORT'].'/room?yacsid='.$_GET['yacsid'], 'r')){
|
||||
return false;
|
||||
}
|
||||
// Read data and close
|
||||
while(!feof($fh))
|
||||
$content .= fread($fh, 1024);
|
||||
|
||||
fclose($fh);*/
|
||||
//$content = $ccache->get('userroom'.$_GET['yacsid']);
|
||||
$room = json_decode($_POST['dat']);
|
||||
//{"roomname":"Lounge","usercolor":"25a1ed","roomusers":[{"nick":"genuineparts","color":"25a1ed","typing":false,"notice":0}]}
|
||||
foreach($room->roomusers as $user) {
|
||||
|
@ -81,7 +71,7 @@ class chat extends ajax_module{
|
|||
{ name: \"report\", action: function (element) { reportwindow($(element).attr('id')); } }
|
||||
];";
|
||||
}
|
||||
$users[]=array('nick'=>$user->nick,'color'=>$user->color,'notice'=>$notice,'gender'=>$gen,'typing'=>$user->typing,'location'=>$location);
|
||||
$users[]=array('nick'=>$user->nick,'color'=>$user->color,'notice'=>$notice,'gender'=>$gen,'typing'=>$user->typing);
|
||||
}
|
||||
$tpl->assign('col',$room->usercolor);
|
||||
$tpl->assign('room',$room->roomname);
|
||||
|
@ -94,10 +84,7 @@ class chat extends ajax_module{
|
|||
if($_POST['call']=='rooms'){
|
||||
if($session->userdata['uid']!=0){
|
||||
$rooms = json_decode($_POST['dat']);
|
||||
foreach($rooms as $room) {
|
||||
if($session->userdata['allow_grimdark']==0 && $room->type=='grimdark'){
|
||||
continue;
|
||||
}
|
||||
foreach($rooms as $room) {
|
||||
$userlist[$room->room]['s'] = $room->lock;
|
||||
$userlist[$room->room]['g'] = $room->type;
|
||||
$userlist[$room->room]['u'] = array();
|
||||
|
@ -110,9 +97,9 @@ class chat extends ajax_module{
|
|||
}
|
||||
$result = $db->query("SELECT * FROM `aa_v_nickpage` WHERE `username`='".$user->nick."'");
|
||||
$gender = $db->fetch_array($result);
|
||||
if($gender['fid3']=='Männlich'){
|
||||
if($gender['gender']=='m'){
|
||||
$gen='male';
|
||||
}elseif($gender['fid3']=='Weiblich'){
|
||||
}elseif($gender['gender']=='f'){
|
||||
$gen='female';
|
||||
}else{
|
||||
$gen='na';
|
||||
|
@ -121,7 +108,6 @@ class chat extends ajax_module{
|
|||
$userlist[$room->room]['u'][$i]['n'] = $user->nick;
|
||||
$userlist[$room->room]['u'][$i]['i'] = $notice;
|
||||
$userlist[$room->room]['u'][$i]['g'] = $gen;
|
||||
$userlist[$room->room]['u'][$i]['l'] = $location;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
@ -321,24 +307,24 @@ class chat extends ajax_module{
|
|||
}
|
||||
}
|
||||
if($_GET['call']=='chars'){
|
||||
$chars='';
|
||||
$chars = array();
|
||||
$result = $db->query("SELECT `name` FROM `" . $config["prefix"] . "rp_chars` WHERE `name` LIKE '".$db->escape($_GET['term'])."%'");
|
||||
while($n = $db->fetch_array($result)){
|
||||
$chars[] = $n['name'];
|
||||
}
|
||||
if(!empty($chars)){
|
||||
return '["'.join($chars,'","').'"]';
|
||||
return '["'.join('","', $chars).'"]';
|
||||
}
|
||||
}
|
||||
|
||||
if($_GET['call']=='users'){
|
||||
$chars='';
|
||||
$chars = array();
|
||||
$result = $db->query("SELECT `username` FROM `" . $config["prefix"] . "users` WHERE `username` LIKE '".$db->escape($_GET['term'])."%'");
|
||||
while($n = $db->fetch_array($result)){
|
||||
$chars[] = $n['username'];
|
||||
}
|
||||
if(!empty($chars)){
|
||||
return '["'.join($chars,'","').'"]';
|
||||
return '["'.join('","', $chars).'"]';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,5 +411,4 @@ class chat extends ajax_module{
|
|||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue