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
e9c7b74d
Commit
e9c7b74d
authored
Jul 18, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UserTabele als Array in Update.php
parent
b5318646
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
5 deletions
+19
-5
config.php
config.php
+18
-4
update.php
update.php
+1
-1
No files found.
config.php
View file @
e9c7b74d
...
...
@@ -87,18 +87,32 @@ function UsernametoID($name)
return
$User
[
'id'
];
}
}
function
UserTable
(){
$content
=
"<tr><th align=
\"
left
\"
>Name</th><th>Rang</th></tr>"
;
function
UserTable
(
$asarray
=
FALSE
){
if
(
$asarray
){
$content
=
array
();
}
else
{
$content
=
"<tr><th align=
\"
left
\"
>Name</th><th>Rang</th></tr>"
;
}
$result
=
mysql_query
(
"SELECT name, admin FROM user WHERE online = '1' ORDER BY admin DESC"
);
while
(
$user
=
mysql_fetch_array
(
$result
))
{
$content
.=
"<tr><td><font class=
\"
online
\"
><b>
{
$user
[
'name'
]
}
</b></font></td><td align=
\"
center
\"
valign=
\"
middle
\"
>(
{
$user
[
'admin'
]
}
)</td></tr>"
;
if
(
$asarray
){
$content
[]
=
array
(
"online"
,
$user
[
'name'
],
$user
[
'admin'
]);
}
else
{
$content
.=
"<tr><td><font class=
\"
online
\"
><b>
{
$user
[
'name'
]
}
</b></font></td><td align=
\"
center
\"
valign=
\"
middle
\"
>(
{
$user
[
'admin'
]
}
)</td></tr>"
;
}
}
$content
.=
"<tr><td> </td><td> </td></tr>"
;
$result
=
mysql_query
(
"SELECT name, admin FROM user WHERE online = '0' ORDER BY name"
);
while
(
$user
=
mysql_fetch_array
(
$result
))
{
$content
.=
"<tr><td><font class=
\"
offline
\"
><b>
{
$user
[
'name'
]
}
</b></font></td><td align=
\"
center
\"
valign=
\"
middle
\"
>(
{
$user
[
'admin'
]
}
)</td></tr>"
;
if
(
$asarray
){
$content
[]
=
array
(
"offline"
,
$user
[
'name'
],
$user
[
'admin'
]);
}
else
{
$content
.=
"<tr><td><font class=
\"
offline
\"
><b>
{
$user
[
'name'
]
}
</b></font></td><td align=
\"
center
\"
valign=
\"
middle
\"
>(
{
$user
[
'admin'
]
}
)</td></tr>"
;
}
}
return
$content
;
}
...
...
update.php
View file @
e9c7b74d
...
...
@@ -23,7 +23,7 @@ if(isset($_SESSION['chatuserid']) AND $users['online'] == 1)
// Liste der Benutzer:
$array
[
'UsersTable'
]
=
UserTable
();
$array
[
'UsersTable'
]
=
UserTable
(
true
);
echo
json_encode
(
$array
,
JSON_PRETTY_PRINT
);
}
...
...
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