-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathfunctions.php-func-verlasse_chat.php
More file actions
56 lines (45 loc) · 1.88 KB
/
functions.php-func-verlasse_chat.php
File metadata and controls
56 lines (45 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<?php
function verlasse_chat($u_id, $u_name, $raum)
{
// user $u_id/$u_name verlässt $raum
// Nachricht in Raum $raum wird erzeugt
// Liefert ID des geschriebenen Datensatzes zurück
global $dbase, $chat, $system_farbe, $t, $lustigefeatures;
global $eintritt_individuell, $eintritt_useranzeige;
$back = 0;
// Nachricht an alle
if ($raum && $u_id) {
$text = $t['chat_msg102'];
if ($eintritt_individuell == "1") {
$query = "SELECT u_austritt FROM user where u_id = $u_id";
$result = mysql_query($query);
$row = mysql_fetch_object($result);
if (strlen($row->u_austritt) > 0) {
$text = $row->u_austritt;
if ($eintritt_useranzeige == "1")
$text = "<b><<<</b> " . htmlspecialchars($text)
. " (<b>$u_name</b> - verlässt Chat) ";
else $text = "<b><<<</b> " . htmlspecialchars($text)
. " <!-- (<b>$u_name</b> - verlässt Chat) -->";
}
mysql_free_result($result);
$query = "SELECT r_name FROM raum where r_id = " . intval($raum);
$result = mysql_query($query);
$row = mysql_fetch_object($result);
if (isset($row->r_name)) {
$r_name = $row->r_name;
} else {
$r_name = "[unbekannt]";
}
mysql_free_result($result);
}
$text = str_replace("%u_name%", $u_name, $text);
$text = str_replace("%user%", $u_name, $text);
$text = str_replace("%r_name%", $r_name, $text);
$text = preg_replace("|%nick%|i", $u_name, $text);
$text = preg_replace("|%raum%|i", $r_name, $text);
$back = global_msg($u_id, $raum, $text);
}
return ($back);
}
?>