diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..5cb71ef
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,6 @@
+
';
+ $extra = "";
if($istat==1){
$extra='disabled="disabled"';
}
diff --git a/modules/chat/chat.ajax.php b/modules/chat/chat.ajax.php
index 2184989..7b86e97 100644
--- a/modules/chat/chat.ajax.php
+++ b/modules/chat/chat.ajax.php
@@ -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{
}
-}
-?>
+}
\ No newline at end of file
diff --git a/template_1.txt b/template_1.txt
index 1a0f529..038198c 100644
--- a/template_1.txt
+++ b/template_1.txt
@@ -1,5 +1,5 @@
# Welcome message
-txtWelcome|SourceUser =