Changed profile buttons

This commit is contained in:
Lars van Hijfte
2017-01-30 12:44:15 +01:00
parent 877637fcc9
commit c8450f3cb3
5 changed files with 38 additions and 36 deletions

View File

@@ -23,14 +23,14 @@ function placeFriendButtons() {
icon1 = "fa-handshake-o"; icon1 = "fa-handshake-o";
break; break;
case "1": case "1":
value1 = "delete"; value1 = userID;
class1 = "red"; class1 = "green";
text1 = "Verwijder"; text1 = "Chat";
icon1 = "fa-times"; icon1 = "fa-comment-o";
value2 = userID; value2 = "delete";
class2 = "green"; class2 = "red";
text2 = "Chat"; text2 = "Verwijder";
icon2 = "fa-comment-o"; icon2 = "fa-times";
break; break;
case "2": case "2":
value1 = "delete"; value1 = "delete";
@@ -39,14 +39,14 @@ function placeFriendButtons() {
icon1 = "fa-cross"; icon1 = "fa-cross";
break; break;
case "3": case "3":
value1 = "delete"; value1 = "accept";
class1 = "red"; class1 = "green";
text1 = "Weiger"; text1 = "Accepteer";
icon1 = "fa-times"; icon1 = "fa-check";
value2 = "accept"; value2 = "delete";
class2 = "green"; class2 = "red";
text2 = "Accepteer"; text2 = "Weiger";
icon2 = "fa-check"; icon2 = "fa-times";
break; break;
default: default:
console.log(friendshipStatus); console.log(friendshipStatus);

View File

@@ -5,14 +5,14 @@ function fancyText(text) {
// Add images and gifs. // Add images and gifs.
var regex = /(https?:\/\/.[^ ]*)/ig; var regex = /(https?:\/\/.[^ ]*)/ig;
text = text.replace(regex, function(link) { text = text.replace(regex, function(link) {
if (link.match(/(https:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) { if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) {
return "<img alt='" + link + "' src='" + link + "' />"; return "<img alt='" + link + "' src='" + link + "' />";
} else if (link.match(/(https:\/\/.[^ ]*\.(?:mp4))/ig)) { } else if (link.match(/(https?:\/\/.[^ ]*\.(?:mp4))/ig)) {
return "<video width='100%'>" + return "<video width='100%'>" +
"<source src='"+ link +"' type='video/mp4'>" + "<source src='"+ link +"' type='video/mp4'>" +
"<b>Je browser ondersteund geen video</b>" + "<b>Je browser ondersteund geen video</b>" +
"</video><button onclick='$(this).prev().get(0).play();'>Speel af</button>"; "</video><button onclick='$(this).prev().get(0).play();'>Speel af</button>";
} else if (link.match(/(https:\/\/.[^ ]*\.(?:ogg))/ig)) { } else if (link.match(/(https?:\/\/.[^ ]*\.(?:ogg))/ig)) {
return "<video width='100%'>" + return "<video width='100%'>" +
"<source src='"+ link +"' type='video/ogg'>" + "<source src='"+ link +"' type='video/ogg'>" +
"<b>Je browser ondersteund geen video</b>" + "<b>Je browser ondersteund geen video</b>" +

View File

@@ -51,7 +51,7 @@
display: inline-block; display: inline-block;
width: 150px; width: 150px;
height: 150px; height: 150px;
margin-bottom: -25px; margin-bottom: -45px;
} }
/* Old */ /* Old */

View File

@@ -15,7 +15,7 @@ function getOldChatMessages($user2ID) {
`origin` = :user2 AND `origin` = :user2 AND
`destination` = :user1 `destination` = :user1
ORDER BY ORDER BY
`messageID` ASC `creationdate` ASC
"); ");
$stmt->bindParam(":user1", $user1ID); $stmt->bindParam(":user1", $user1ID);
@@ -74,7 +74,7 @@ function getNewChatMessages($lastID, $destination) {
`destination` = :user1) AND `destination` = :user1) AND
`messageID` > :lastID `messageID` > :lastID
ORDER BY ORDER BY
`messageID` ASC `creationdate` ASC
"); ");
$stmt->bindParam(':user1', $_SESSION["userID"]); $stmt->bindParam(':user1', $_SESSION["userID"]);

View File

@@ -1,6 +1,7 @@
<div class="content"> <div class="content">
<div class="user-box"> <div class="user-box">
<img class="profile-picture main-picture" src="<?= $user["profilepicture"] ?>"><br /> <img class="profile-picture main-picture" src="<?= $user["profilepicture"] ?>"><br />
<div class="platform">
<div class="status-buttons-container"> <div class="status-buttons-container">
<button disabled class="gray"><?= $user["onlinestatus"] ?></button> <button disabled class="gray"><?= $user["onlinestatus"] ?></button>
<button disabled class="gray"><?= $user["role"] ?></button> <button disabled class="gray"><?= $user["role"] ?></button>
@@ -9,7 +10,7 @@
<p>:)</p> <p>:)</p>
<p>Je ziet er goed uit vandaag</p> <p>Je ziet er goed uit vandaag</p>
</div> </div>
<div class="profile-info platform"> <div class="profile-info">
<h2><?= $user["fname"]?> <?=$user["lname"]?></h2> <h2><?= $user["fname"]?> <?=$user["lname"]?></h2>
<h5><?=$user["username"]?></h5> <h5><?=$user["username"]?></h5>
<?php if (strlen($user["bio"]) <= 50) { <?php if (strlen($user["bio"]) <= 50) {
@@ -17,6 +18,7 @@
} ?> } ?>
</div> </div>
</div> </div>
</div>
<?php if (strlen($user["bio"]) > 50) { <?php if (strlen($user["bio"]) > 50) {
echo "<div class='platform'><h3>Bio:</h3><p>" . $user["bio"] . "</p></div>"; echo "<div class='platform'><h3>Bio:</h3><p>" . $user["bio"] . "</p></div>";
} ?> } ?>