Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
PHP-Chat
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BA_SST
PHP-Chat
Commits
7adffcb5
Commit
7adffcb5
authored
Jul 25, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
neue Funkion für das eintragen einer CHatmessage eingebaut
parent
1437503f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
config.php
config.php
+8
-2
No files found.
config.php
View file @
7adffcb5
...
@@ -30,7 +30,9 @@ function ChatNachricht($text, $admin, $userchange ){
...
@@ -30,7 +30,9 @@ function ChatNachricht($text, $admin, $userchange ){
$UserID
=
UsernametoID
(
$name
);
$UserID
=
UsernametoID
(
$name
);
$text
=
substr
(
$text
,
$end
+
1
);
$text
=
substr
(
$text
,
$end
+
1
);
}
}
mysql_query
(
"INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('
{
$_SESSION
[
'chatuserid'
]
}
', '
$text
', '
$userchange
', '
$admin
', '"
.
time
()
.
"', '
$UserID
')"
);
/*mysql_query("INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES
('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')");*/
sendMessage
(
$text
,
$_SESSION
[
'chatuserid'
],
$userchange
,
0
,
$admin
,
time
(),
0
,
$UserID
);
//echo "INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')";
//echo "INSERT INTO chat (user_id, nachricht, userchange, admin, chat_time, privat) VALUES ('{$_SESSION['chatuserid']}', '$text', '$userchange', '$admin', '" . time() . "', '$UserID')";
//mysql_query("UPDATE user SET chat = '".mysql_insert_id()."' WHERE id = '{$_SESSION['chatuserid']}'");
//mysql_query("UPDATE user SET chat = '".mysql_insert_id()."' WHERE id = '{$_SESSION['chatuserid']}'");
if
((
preg_match
(
"/James/i"
,
$text
))
OR
(
$UserID
==
1
))
if
((
preg_match
(
"/James/i"
,
$text
))
OR
(
$UserID
==
1
))
...
@@ -46,6 +48,10 @@ function ChatNachricht($text, $admin, $userchange ){
...
@@ -46,6 +48,10 @@ function ChatNachricht($text, $admin, $userchange ){
}
}
return
$text
;
return
$text
;
}
}
function
sendMessage
(
$nachricht
,
$user_id
,
$userchange
,
$hideuser
,
$admin
,
$chat_time
,
$hidden
,
$privat
){
mysql_query
(
'INSERT INTO chat (nachricht, user_id, userchange, hideuser, admin, chat_time, hidden, privat)
VALUES ("'
.
$nachricht
.
'", "'
.
$user_id
.
'", "'
.
$userchange
.
'", "'
.
$hideuser
.
'", "'
.
$admin
.
'", "'
.
$chat_time
.
'", "'
.
$hidden
.
'", "'
.
$privat
.
'")'
);
}
function
BBcode
(
$text
){
function
BBcode
(
$text
){
# Formatierungen
# Formatierungen
$text
=
preg_replace
(
'#\[b\](.*?)\[/b\]#si'
,
'<b>\1</b>'
,
$text
);
$text
=
preg_replace
(
'#\[b\](.*?)\[/b\]#si'
,
'<b>\1</b>'
,
$text
);
...
@@ -156,7 +162,7 @@ function MessageFormat($hide, $admin, $privat, $name, $time, $nachricht, $vonid)
...
@@ -156,7 +162,7 @@ function MessageFormat($hide, $admin, $privat, $name, $time, $nachricht, $vonid)
//return "<p class=\"chatp$style\">".date("H:i:s",$time)." | (Privat) <b>Du an ".IDtoUsername($privat)."</b>: $nachricht</p>";
//return "<p class=\"chatp$style\">".date("H:i:s",$time)." | (Privat) <b>Du an ".IDtoUsername($privat)."</b>: $nachricht</p>";
return
'<div class="panel '
.
$style
.
' chatpanel">
return
'<div class="panel '
.
$style
.
' chatpanel">
<div class="panel-heading">
<div class="panel-heading">
<div class="panel-title pull-left">(Privat) Du an '
.
$name
.
':</div>
<div class="panel-title pull-left">(Privat) Du an '
.
IDtoUsername
(
$privat
)
.
':</div>
<div class="pull-right hidden-xs">'
.
date
(
"H:i:s"
,
$time
)
.
'</div>
<div class="pull-right hidden-xs">'
.
date
(
"H:i:s"
,
$time
)
.
'</div>
<div class="clearfix"></div>
<div class="clearfix"></div>
</div>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment