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
78561aae
Commit
78561aae
authored
Aug 29, 2016
by
Nico Schallehn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Verschiedene Änderungen u.a.:
Leere Zeilen Entfernt Hilfeausgabe beim ersten Login
parent
62b92df7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
23 deletions
+10
-23
chat.php
chat.php
+0
-20
config.php
config.php
+1
-1
index.php
index.php
+9
-2
No files found.
chat.php
View file @
78561aae
...
...
@@ -61,7 +61,6 @@ if(isset($_GET['logoff'])){
</div>
</nav>
<div
class=
"row"
>
<div
class=
"col-xs-0 col-sm-3 col-md-3 col-lg-2 hidden-xs"
style=
"position:fixed;height:100%;overflow-y:auto;"
id=
"UsersOnlineBox"
>
<div
class=
"panel panel-default"
id=
"UsersOnlinePanel"
>
...
...
@@ -86,24 +85,11 @@ if(isset($_GET['logoff'])){
while
(
$chat
=
mysql_fetch_array
(
$result
))
{
echo
MessageFormat
(
$chat
[
'hideuser'
],
$chat
[
'admin'
],
$chat
[
'privat'
],
$chat
[
'name'
],
$chat
[
'chat_time'
],
$chat
[
'nachricht'
],
$chat
[
'user_id'
]);
}
/*$JqueryDo = '$(\'html, body\').animate({
scrollTop: $(document).height()-$(window).height()},
1400,
"easeOutQuint"
);';*/
?>
</div>
</div>
<nav
class=
"navbar navbar-default navbar-fixed-bottom chatnavbar"
>
<div
class=
"container-fluid"
>
<form
class=
""
role=
"form"
id=
"chatbar"
>
<div
class=
"input-group"
>
<span
class=
"input-group-addon hidden-xs"
>
<?php
echo
$users
[
'name'
];
?>
:
</span>
...
...
@@ -139,13 +125,7 @@ if(isset($_GET['logoff'])){
</form>
</div>
</nav>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"
></script>
<!-- Latest compiled and minified JavaScript -->
...
...
config.php
View file @
78561aae
...
...
@@ -46,7 +46,7 @@ function ChatNachricht($text, $admin, $userchange ){
$JamesText
=
"Folgende Befehle unterstützt dieser Chat:
<ul>
<li>/w [Username]:[Nachricht] - sendet eine private Nachricht (/p ist alias)</li>
<li>/
commands
- gibt diese Hilfe aus</li>
<li>/
?
- gibt diese Hilfe aus</li>
</ul>
Außerdem kannst ich auf folgenden Sachen Antworten:
<ul>
...
...
index.php
View file @
78561aae
...
...
@@ -6,7 +6,6 @@ if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){
header
(
'Location: '
.
$redirect
);
exit
();
}
include
(
"config.php"
);
// $result = mysql_query("SELECT * FROM user WHERE name = '{$_SESSION['chatuserid']}'");
...
...
@@ -26,7 +25,7 @@ if(isset($_POST['ok']))
}
else
{
$result
=
mysql_query
(
"SELECT id, pass, name FROM user WHERE name = '
$username
'"
);
$result
=
mysql_query
(
"SELECT id, pass, name
, chat
FROM user WHERE name = '
$username
'"
);
$user
=
mysql_fetch_array
(
$result
);
if
(
$user
[
'pass'
]
==
hash
(
"sha256"
,
$passwort
))
// )
{
...
...
@@ -36,6 +35,12 @@ if(isset($_POST['ok']))
mysql_query
(
"INSERT INTO chat (nachricht, user_id, userchange, hideuser, chat_time) VALUES ('<b>
{
$user
[
'name'
]
}
</b> betritt den Chat', '
{
$_SESSION
[
'chatuserid'
]
}
', '1', '1', '"
.
time
()
.
"')"
);
$meldung
.=
"<font color=
\"
green
\"
>Du hast dich erfolgreich angemeldet!</font>"
;
$JqueryDo
=
"$('#showLogin').click();"
.
PHP_EOL
.
"setTimeout(function(){ window.location =
\"
/chat.php
\"
; }, 700);"
;
if
(
$user
[
'chat'
]
==
0
)
// Wenn sich der Benutzer das erste mal anmedet, dann bekommt er die Hilfe angezeigt.
{
ChatNachricht
(
"/?"
,
0
,
0
);
}
}
else
{
$meldung
.=
"<font color=
\"
red
\"
>Name (
$username
) oder Passwort falsch!</font>"
;
...
...
@@ -54,6 +59,8 @@ if(isset($_POST['ok']))
$_POST
[
'pass'
]
=
hash
(
"sha256"
,
htmlentities
(
$_POST
[
'pass'
]));
mysql_query
(
"INSERT INTO user (name, pass) VALUES ('
{
$_POST
[
'username'
]
}
', '
{
$_POST
[
'pass'
]
}
')"
);
mysql_query
(
"INSERT INTO chat (nachricht, user_id, userchange, hideuser, chat_time) VALUES ('<b>
{
$_POST
[
'username'
]
}
</b> hat sich registriert', '
{
$_SESSION
[
'chatuserid'
]
}
', '1', '1', '"
.
time
()
.
"')"
);
AdminLogAdd
(
"
{
$_POST
[
'username'
]
}
hat sich registiert!"
,
$_SESSION
[
'chatuserid'
],
0
);
$meldung
=
'<font color="green">Du hast dich erfolgreich registriert!</font><br>'
;
$JqueryDo
=
"$('#showRegis').click();"
.
PHP_EOL
.
"setTimeout(function(){ $('#showLogin').click(); }, 1000);"
;
...
...
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