Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
V
VMS-SUEE_2.0
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eric Laufer
VMS-SUEE_2.0
Commits
875cdfb7
Commit
875cdfb7
authored
7 years ago
by
isaack
Browse files
Options
Downloads
Patches
Plain Diff
kleine bugs
parent
502e9f08
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
content/konto/nickpage.php
+1
-1
1 addition, 1 deletion
content/konto/nickpage.php
lib/class/chat.class.php
+33
-34
33 additions, 34 deletions
lib/class/chat.class.php
with
34 additions
and
35 deletions
content/konto/nickpage.php
+
1
−
1
View file @
875cdfb7
...
...
@@ -99,7 +99,7 @@ if($esc['bdate'] == 0){
if
(
$nickpage
[
'ava'
]
==
''
){
echo
'<div class="alert alert-info">Kein Avatar gewählt</div>'
;
}
else
{
echo
'<a href="#" class="thumbnail"><img src="'
.
$nickpage
[
'ava'
]
.
'" alt="'
.
$_SESSIO
n
[
'uid'
]
.
'"></a>'
;
echo
'<a href="#" class="thumbnail"><img src="'
.
$nickpage
[
'ava'
]
.
'" alt="'
.
$_SESSIO
N
[
'uid'
]
.
'"></a>'
;
}
?>
</td>
...
...
This diff is collapsed.
Click to expand it.
lib/class/chat.class.php
+
33
−
34
View file @
875cdfb7
<?php
class
chatClass
{
public
static
function
getRestChatLines
(
$id
)
{
global
$db_host
,
$db_user
,
$db_pass
,
$db_base
;
$arr
=
array
();
$jsonData
=
'{"results":['
;
$db_connection
=
new
mysqli
(
$db_host
,
$db_user
,
$db_pass
,
$db_base
);
$db_connection
->
query
(
"SET NAMES 'UTF8'"
);
$statement
=
$db_connection
->
prepare
(
"SELECT id, absender, nachricht, time FROM vms_chat WHERE id > ? "
);
$statement
->
bind_param
(
'i'
,
$id
);
$statement
->
execute
();
$statement
->
bind_result
(
$id
,
$usrname
,
$chattext
,
$chattime
);
$line
=
new
stdClass
;
while
(
$statement
->
fetch
())
{
$line
->
id
=
$id
;
$line
->
usrname
=
$usrname
;
$line
->
chattext
=
$chattext
;
$line
->
chattime
=
date
(
'H:i:s'
,
$chattime
);
$arr
[]
=
json_encode
(
$line
);
}
$statement
->
close
();
$db_connection
->
close
();
$jsonData
.
=
implode
(
","
,
$arr
);
$jsonData
.
=
']}'
;
return
$jsonData
;
class
chatClass
{
public
static
function
getRestChatLines
(
$id
){
global
$db_host
,
$db_user
,
$db_pass
,
$db_base
;
$arr
=
array
();
$jsonData
=
'{"results":['
;
$db_connection
=
new
mysqli
(
$db_host
,
$db_user
,
$db_pass
,
$db_base
);
$db_connection
->
query
(
"SET NAMES 'UTF8'"
);
$statement
=
$db_connection
->
prepare
(
"SELECT id, absender, nachricht, time FROM vms_chat WHERE id > ? "
);
$statement
->
bind_param
(
'i'
,
$id
);
$statement
->
execute
();
$statement
->
bind_result
(
$id
,
$usrname
,
$chattext
,
$chattime
);
$line
=
new
stdClass
;
while
(
$statement
->
fetch
())
{
$line
->
id
=
$id
;
$line
->
usrname
=
$usrname
;
$line
->
chattext
=
$chattext
;
$line
->
chattime
=
date
(
'H:i:s'
,
$chattime
);
$arr
[]
=
json_encode
(
$line
);
}
$statement
->
close
();
$db_connection
->
close
();
$jsonData
.
=
implode
(
","
,
$arr
);
$jsonData
.
=
']}'
;
return
$jsonData
;
}
public
static
function
setChatLines
(
$chattext
,
$usrname
,
$color
)
{
$db_connection
=
new
mysqli
(
mysqlServer
,
mysqlUser
,
mysqlPass
,
mysqlDB
);
$db_connection
->
query
(
"SET NAMES 'UTF8'"
);
$statement
=
$db_connection
->
prepare
(
"INSERT INTO chat( usrname, color, chattext) VALUES(?, ?, ?)"
);
$statement
->
bind_param
(
'sss'
,
$usrname
,
$color
,
$chattext
);
$statement
->
execute
();
$statement
->
close
();
$db_connection
->
close
();
global
$db_host
,
$db_user
,
$db_pass
,
$db_base
;
$db_connection
=
new
mysqli
(
$db_host
,
$db_user
,
$db_pass
,
$db_base
);
$db_connection
->
query
(
"SET NAMES 'UTF8'"
);
$statement
=
$db_connection
->
prepare
(
"INSERT INTO chat( usrname, color, chattext) VALUES(?, ?, ?)"
);
$statement
->
bind_param
(
'sss'
,
$usrname
,
$color
,
$chattext
);
$statement
->
execute
();
$statement
->
close
();
$db_connection
->
close
();
}
}
}
?>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment