Added fancy text to posts and comments

This commit is contained in:
Lars van Hijfte
2017-01-31 13:54:31 +01:00
parent e85a685b0f
commit 794b5ab294
7 changed files with 21 additions and 12 deletions

View File

@@ -2,10 +2,10 @@
session_start(); session_start();
require("../../queries/post.php"); require_once("../../queries/post.php");
require_once("../../queries/connect.php"); require_once("../../queries/connect.php");
require("../../queries/checkInput.php"); require_once("../../queries/checkInput.php");
print_r($_POST);
if ($_POST['button'] == 'reaction') { if ($_POST['button'] == 'reaction') {
if (empty($_POST['newcomment-content'])) { if (empty($_POST['newcomment-content'])) {
echo 0; echo 0;

View File

@@ -2,9 +2,9 @@
session_start(); session_start();
require("../../queries/post.php"); require_once("../../queries/post.php");
require("../../queries/connect.php"); require_once("../../queries/connect.php");
require("../../queries/checkInput.php"); require_once("../../queries/checkInput.php");
if (empty($_POST['newpost-title'])) { if (empty($_POST['newpost-title'])) {
} else { } else {

View File

@@ -3,7 +3,7 @@ var months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "a
function fancyText(text) { function fancyText(text) {
// Add links, images, gifs and (youtube) video's. // Add links, images, gifs and (youtube) video's.
var regex = /(https?:\/\/.[^ ]*)/ig; var regex = /(https?:\/\/.[^ <>"]*)/ig;
text = text.replace(regex, function(link) { text = text.replace(regex, function(link) {
// Add images // Add images
if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) { if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) {

View File

@@ -19,7 +19,7 @@ function requestPost(postID) {
var scrollBarWidth = window.innerWidth - document.body.offsetWidth; var scrollBarWidth = window.innerWidth - document.body.offsetWidth;
scrollbarMargin(scrollBarWidth, 'hidden'); scrollbarMargin(scrollBarWidth, 'hidden');
$('#modal-response').show(); $('#modal-response').show();
$('#modal-response').html(data); $('#modal-response').html(fancyText(data));
}); });
} }
@@ -52,7 +52,7 @@ function masonry(mode) {
* Initialise columns. * Initialise columns.
*/ */
var columns = new Array(columnCount); var columns = new Array(columnCount);
var $columns = new Array(columnCount);
for (i = 0; i < columnCount; i++) { for (i = 0; i < columnCount; i++) {
$column = $("<div class=\"column\">"); $column = $("<div class=\"column\">");
$column.width(100/columnCount + "%"); $column.width(100/columnCount + "%");
@@ -100,7 +100,7 @@ function masonry(mode) {
$.each(posts, function() { $.each(posts, function() {
$post = $("<div class=\"post platform\" onclick=\"requestPost(\'"+this['postID']+"\')\">"); $post = $("<div class=\"post platform\" onclick=\"requestPost(\'"+this['postID']+"\')\">");
$post.append($("<h2>").html(this["title"])); $post.append($("<h2>").html(this["title"]));
$post.append($("<p>").html(this["content"])); $post.append($("<p>").html(fancyText(this["content"])));
$post.append($("<p class=\"subscript\">").text(this["nicetime"])); $post.append($("<p class=\"subscript\">").text(this["nicetime"]));
$post.append($("<p class=\"subscript\">").text("comments: " + this["comments"] + ", niet slechts: " + this["niet_slechts"])); $post.append($("<p class=\"subscript\">").text("comments: " + this["comments"] + ", niet slechts: " + this["niet_slechts"]));

View File

@@ -4,7 +4,7 @@
.admin-panel input[type="radio"], input[type="checkbox"] { .admin-panel input[type="radio"], input[type="checkbox"] {
vertical-align: middle; vertical-align: middle;
height: auto; height: 28px;
margin: 2px; margin: 2px;
} }

View File

@@ -307,9 +307,16 @@ div[data-title]:hover:after {
body { body {
font-size: 28px!important; font-size: 28px!important;
} }
button, input { button, input, select {
font-size: 28px; font-size: 28px;
height: 42px; height: 42px;
} }
textarea {
font-size: 28px;
}
input[type="checkbox"], input[type="radio"] {
width: 28px;
height: 28px;
}
} }

View File

@@ -16,6 +16,8 @@ function getOldChatMessages($user2ID) {
`destination` = :user1 `destination` = :user1
ORDER BY ORDER BY
`creationdate` ASC `creationdate` ASC
LIMIT
100
"); ");
$stmt->bindParam(":user1", $user1ID); $stmt->bindParam(":user1", $user1ID);