Merge branch 'levi' into 'master'
Levi See merge request photowall/photowall-webapp!5
This commit is contained in:
		
						commit
						45aac8d9e8
					
				
							
								
								
									
										18
									
								
								approve.php
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								approve.php
									
									
									
									
									
								
							@ -176,6 +176,16 @@ if ($logged_in) {
 | 
			
		||||
                });
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            // html-be biztonságosan beilleszthető string gyártása
 | 
			
		||||
            // https://stackoverflow.com/a/6234804
 | 
			
		||||
            function escapeHtml(unsafe) {
 | 
			
		||||
                return unsafe
 | 
			
		||||
                     .replace(/&/g, "&")
 | 
			
		||||
                     .replace(/</g, "<")
 | 
			
		||||
                     .replace(/>/g, ">")
 | 
			
		||||
                     .replace(/"/g, """)
 | 
			
		||||
                     .replace(/'/g, "'");
 | 
			
		||||
             }
 | 
			
		||||
        </script>
 | 
			
		||||
        <script>
 | 
			
		||||
            const MAX_TABLE_ROWS = 10;
 | 
			
		||||
@ -224,10 +234,10 @@ if ($logged_in) {
 | 
			
		||||
                <img src="ARTWORKS/thumbnails/${image_data["Image_FileName"]}" style="vertical-align: top" />
 | 
			
		||||
                <section style="display: inline-block; margin-left: 1em;">
 | 
			
		||||
                    <section style="display: block">
 | 
			
		||||
                        <span class="label">Alkotó:</span><span class="fill-in-content" style="margin-right: 0.5em;"><input type="text" class="f-author-c" name="f_author" value="${image_data["Author"]}">,</span>
 | 
			
		||||
                        <span class="label">Csoport:</span><input type="text" class="f-author-group-c" name="f_author_group" value="${image_data["AuthorGroup"]}"></span><br />
 | 
			
		||||
                        <span class="label">Cím:</span><span class="fill-in-content"><input type="text" class="f-title-c" name="f_title" value="${image_data["Title"]}"></span><br />
 | 
			
		||||
                        <span class="label">Leírás:</span><span class="fill-in-content"><textarea placeholder="(nincs)" class="f-desc-c" style="vertical-align: baseline;" name="f_details">${image_data["Description"]}</textarea></span><br />
 | 
			
		||||
                        <span class="label">Alkotó:</span><span class="fill-in-content" style="margin-right: 0.5em;"><input type="text" class="f-author-c" name="f_author" value="${escapeHtml(image_data["Author"])}">,</span>
 | 
			
		||||
                        <span class="label">Csoport:</span><input type="text" class="f-author-group-c" name="f_author_group" value="${escapeHtml(image_data["AuthorGroup"])}"></span><br />
 | 
			
		||||
                        <span class="label">Cím:</span><span class="fill-in-content"><input type="text" class="f-title-c" name="f_title" value="${escapeHtml(image_data["Title"])}"></span><br />
 | 
			
		||||
                        <span class="label">Leírás:</span><span class="fill-in-content"><textarea placeholder="(nincs)" class="f-desc-c" style="vertical-align: baseline;" name="f_details">${escapeHtml(image_data["Description"])}</textarea></span><br />
 | 
			
		||||
                        <span class="label">Feltöltés ideje:</span><span class="fill-in-content">${image_data["TS"]}</span><br />
 | 
			
		||||
                    </section>
 | 
			
		||||
                    <section style="display: block; margin-top: 1em;">
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										16
									
								
								globals.php
									
									
									
									
									
								
							
							
						
						
									
										16
									
								
								globals.php
									
									
									
									
									
								
							@ -1,8 +1,10 @@
 | 
			
		||||
<?php
 | 
			
		||||
    // SQL-paraméterek
 | 
			
		||||
    define("SQL_USER", "photowall_user");
 | 
			
		||||
    define("SQL_PASS", "photowpwd");
 | 
			
		||||
    define("SQL_DB", "photowall_db");
 | 
			
		||||
    define("SQL_IP", "172.28.0.6");
 | 
			
		||||
    define('HASHED_REVIS_PASSWORD', '$2y$10$X9CbRyf3TQ2ka/tucKhPRek3iEi1KX74Wk3XM6jtV4nNt5K6oAc1a');
 | 
			
		||||
    define('DEBUG_MODE', true);
 | 
			
		||||
 | 
			
		||||
// SQL-paraméterek
 | 
			
		||||
define("SQL_USER", "root");
 | 
			
		||||
define("SQL_PASS", "");
 | 
			
		||||
define("SQL_DB", "photowall_db");
 | 
			
		||||
define("SQL_IP", "127.0.0.1");
 | 
			
		||||
define('PHW_DB_GRANTED', true);
 | 
			
		||||
define('HASHED_REVIS_PASSWORD', '$2y$10$r9y4r6Z4/xnI94MhtkYZf.Oj2/uAUNTMANZRgya1d15.m71Ac7exy');
 | 
			
		||||
define('DEBUG_MODE', true);
 | 
			
		||||
 | 
			
		||||
@ -2,13 +2,6 @@
 | 
			
		||||
 | 
			
		||||
include_once "utils.php";
 | 
			
		||||
 | 
			
		||||
// hibakeresés
 | 
			
		||||
if (DEBUG_MODE) {
 | 
			
		||||
    ini_set("display_errors", "On");
 | 
			
		||||
} else {
 | 
			
		||||
    ini_set("display_errors", "Off");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// feltöltési limit 10 percen belül
 | 
			
		||||
define("UPLOAD_LIMIT_10MIN", 10);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -55,7 +55,7 @@ class Color {
 | 
			
		||||
        this.g = Number(components[1]);
 | 
			
		||||
        this.b = Number(components[2]);
 | 
			
		||||
 | 
			
		||||
        if (components.length <= 4) {
 | 
			
		||||
        if (components.length >= 4) {
 | 
			
		||||
            this.a = Number(components[3]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										24
									
								
								js/phw.js
									
									
									
									
									
								
							
							
						
						
									
										24
									
								
								js/phw.js
									
									
									
									
									
								
							@ -493,10 +493,8 @@ function req_update() {
 | 
			
		||||
function recv_update(state, resp) {
 | 
			
		||||
    let img_update_batch = JSON.parse(resp);
 | 
			
		||||
 | 
			
		||||
    // ha nem volt semmi újabb, akkor kilépünk
 | 
			
		||||
    if (img_update_batch.length === 0) {
 | 
			
		||||
        return;
 | 
			
		||||
    }
 | 
			
		||||
    // ha volt újabb, akkor frissítjük a falat
 | 
			
		||||
    if (img_update_batch.length > 0) {
 | 
			
		||||
 | 
			
		||||
        // növeljük az összes és a betöltött művek számát
 | 
			
		||||
        artworks_loaded_n += img_update_batch.length;
 | 
			
		||||
@ -513,6 +511,7 @@ function recv_update(state, resp) {
 | 
			
		||||
 | 
			
		||||
        // fal összeállítása
 | 
			
		||||
        compose_wall();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // update kész
 | 
			
		||||
    update_in_progress = false;
 | 
			
		||||
@ -564,7 +563,7 @@ function init_viewer() {
 | 
			
		||||
 | 
			
		||||
    // betöltéskor a felirat megjelenítése
 | 
			
		||||
    img.addEventListener("load", (e) => {
 | 
			
		||||
        img.style.opacity = "1";
 | 
			
		||||
        img.classList.remove("loading");
 | 
			
		||||
        place_artcaptions();
 | 
			
		||||
        show(caption_sect);
 | 
			
		||||
        hide("viewerloadanim");
 | 
			
		||||
@ -583,11 +582,13 @@ function init_viewer() {
 | 
			
		||||
        change_viewer_magnification(-e.deltaY * magnification_sensitivity);
 | 
			
		||||
    }, false);
 | 
			
		||||
 | 
			
		||||
    // a képre kattintáskor ne záródjon be a nézegető
 | 
			
		||||
    // a képre kattintáskor ne záródjon be a nézegető, ha éppen mozgatjuk
 | 
			
		||||
    img.addEventListener("click", (e) => {
 | 
			
		||||
        if (e.clientX !== viewer_original_mouse_coords.x || e.clientY !== viewer_original_mouse_coords.y) {
 | 
			
		||||
            e.preventDefault();
 | 
			
		||||
            e.stopPropagation();
 | 
			
		||||
            return false;
 | 
			
		||||
        }
 | 
			
		||||
    }, false);
 | 
			
		||||
 | 
			
		||||
    // nézegető billentyű-kombinációk
 | 
			
		||||
@ -605,6 +606,11 @@ function init_viewer() {
 | 
			
		||||
        viewer_original_mouse_coords = {x: e.clientX, y: e.clientY};
 | 
			
		||||
        viewer_grabbing = true;
 | 
			
		||||
        img.style.cursor = "grabbing";
 | 
			
		||||
 | 
			
		||||
        // ne jelölődjön ki a kép
 | 
			
		||||
        e.preventDefault();
 | 
			
		||||
        e.stopPropagation();
 | 
			
		||||
        return false;
 | 
			
		||||
    }, false);
 | 
			
		||||
 | 
			
		||||
    img.addEventListener("mousemove", (e) => {
 | 
			
		||||
@ -679,7 +685,7 @@ var group_logo_repository = "https://mkkozi.hu/user/plugins/mkk-groups/logos";
 | 
			
		||||
// képnézegető megynitása
 | 
			
		||||
function open_viewer(details) {
 | 
			
		||||
    let img = o("viewerimg");
 | 
			
		||||
    img.style.opacity = "0";
 | 
			
		||||
    img.classList.add("loading");
 | 
			
		||||
    img.style.left = img.style.top = "0px";
 | 
			
		||||
    img.src = "ARTWORKS/published/" + details.Image_FileName;
 | 
			
		||||
 | 
			
		||||
@ -719,6 +725,10 @@ function close_viewer() {
 | 
			
		||||
    hide("viewersect");
 | 
			
		||||
    hide("artcaptions");
 | 
			
		||||
 | 
			
		||||
    // kép eltávolítása
 | 
			
		||||
    let img = o("viewerimg");
 | 
			
		||||
    img.src = "";
 | 
			
		||||
 | 
			
		||||
    viewer_open = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										7
									
								
								phw.css
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								phw.css
									
									
									
									
									
								
							@ -267,7 +267,12 @@ img.viewer {
 | 
			
		||||
    z-index: 3000;
 | 
			
		||||
    cursor: grab;
 | 
			
		||||
 | 
			
		||||
    transition: opacity, transform 0.3s ease;
 | 
			
		||||
    transition: opacity 0.3s, transform 0.3s ease;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
img.viewer.loading {
 | 
			
		||||
    transition: opacity 0s;
 | 
			
		||||
    opacity: 0;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@media only screen and (max-width: 600px) {
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										11
									
								
								utils.php
									
									
									
									
									
								
							
							
						
						
									
										11
									
								
								utils.php
									
									
									
									
									
								
							@ -2,6 +2,17 @@
 | 
			
		||||
 | 
			
		||||
include_once "globals.php";
 | 
			
		||||
 | 
			
		||||
// hibakeresés
 | 
			
		||||
if (DEBUG_MODE) {
 | 
			
		||||
    ini_set('display_errors', '1');
 | 
			
		||||
    ini_set('display_startup_errors', '1');
 | 
			
		||||
    error_reporting(E_ALL);
 | 
			
		||||
} else {
 | 
			
		||||
    ini_set('display_errors', '0');
 | 
			
		||||
    ini_set('display_startup_errors', '0');
 | 
			
		||||
    error_reporting(0); // Turn off all error reporting
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// olyan szöveget ad vissza, amibe csak angol ABC betűi és számok szerepelnek (KL)
 | 
			
		||||
function only_alpha_numeric($input)
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user