Kaynağa Gözat

Dropped support for the 2015 app sync.

Iñigo Valentin 9 yıl önce
ebeveyn
işleme
f24bc02007

+ 20 - 18
www/app/index.php

@@ -1,7 +1,7 @@
 <?php
 	include("../functions.php");
 	$browser_data = get_browser(null, true);
-	$os = $browser_data['platform'];
+	$os = $browser_data["platform"];
 
 	if (strpos(strtolower($os), 'android') !== false){
 		header('Location: https://play.google.com/store/apps/details?id=com.ivalentin.margolariak');
@@ -12,18 +12,14 @@
 		exit(0);
 	}
 	else{
-	
 		session_start();
-		#$proto = $_SERVER['SERVER_PROTOCOL'];
-		#$proto = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,strpos( $_SERVER["SERVER_PROTOCOL"],'/'))).'://';
-		$http_host = $_SERVER['HTTP_HOST'];
+		$http_host = $_SERVER["HTTP_HOST"];
 		$proto = getProtocol();
-		$server = "$server";
+		$server = "$proto$http_host";
 		
 		//Language
 		$lang = selectLanguage();
-		include("../lang/lang_" . $lang . ".php");
-
+		include("../lang/lang_$lang.php");
 ?>
 
 <!DOCTYPE html>
@@ -32,7 +28,7 @@
 		<meta content="text/html; charset=utf-8" http-equiv="content-type"/>
 		<meta charset="utf-8"/>
 		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
-		<title><?=$lng['index_title']?> - App</title>
+		<title><?=$lng["index_title"]?> - App</title>
 		<link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
 		<!-- CSS files -->
 		<style>
@@ -49,29 +45,33 @@
 		</style>
 		<!-- Script files -->
 		<script type="text/javascript">
-			<?php include("../script/ui.js"); ?>
+<?php
+            include("../script/ui.js");
+?>
 		</script>
 		<!-- Meta tags -->
 		<link rel="canonical" href="<?=$server?>/app/"/>
 		<link rel="author" href="<?=$server?>"/>
 		<link rel="publisher" href="<?=$server?>"/>
-		<meta name="description" content="<?=$lng['index_title']?> - App"/>
-		<meta property="og:title" content="<?=$lng['index_title']?> - App"/>
+		<meta name="description" content="<?=$lng["index_title"]?> - App"/>
+		<meta property="og:title" content="<?=$lng["index_title"]?> - App"/>
 		<meta property="og:url" content="<?=$server?>"/>
-		<meta property="og:description" content="<?=$lng['index_title']?> - App"/>
+		<meta property="og:description" content="<?=$lng["index_title"]?> - App"/>
 		<meta property="og:image" content="<?$server?>/img/logo/logo.png"/>
-		<meta property="og:site_name" content="<?=$lng['index_title']?> - App"/>
+		<meta property="og:site_name" content="<?=$lng["index_title"]?> - App"/>
 		<meta property="og:type" content="website"/>
 		<meta property="og:locale" content="<?=$lang?>"/>
 		<meta name="twitter:card" content="summary"/>
-		<meta name="twitter:title" content="<?=$lng['index_title']?> - App"/>
-		<meta name="twitter:description" content="<?=$lng['index_title']?> - App"/>
+		<meta name="twitter:title" content="<?=$lng["index_title"]?> - App"/>
+		<meta name="twitter:description" content="<?=$lng["index_title"]?> - App"/>
 		<meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
 		<meta name="twitter:url" content="<?=$server?>/app/"/>
 		<meta name="robots" content="index follow"/>
 	</head>
 	<body>
-		<?php include("../header.php"); ?>
+<?php
+        include("../header.php");
+?>
 		<div id="content">
 			<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 			<table>
@@ -90,7 +90,9 @@
 			</table>
 			<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
 		</div>
-		<?php include("../footer.php"); ?>
+<?php
+        include("../footer.php");
+?>
 	</body>
 </html>
 

+ 0 - 21
www/app/location.php

@@ -1,21 +0,0 @@
-<?php
-    include("../functions.php");
-    $con = startdb();
-        
-    //Get user entry
-    // DEBUG 1=0. Disabled.
-    $q = mysqli_query($con, "SELECT lat, lon, dtime, username, manual, action FROM location, user WHERE 0=1 AND action = 'report' AND user.id = location.user AND dtime > NOW() - INTERVAL 30 MINUTE ORDER BY dtime DESC LIMIT 1;");
-    if (mysqli_num_rows($q) > 0){
-        $r = mysqli_fetch_array($q);
-        echo("<reporting>1</reporting>\n");
-        echo("<lat>$r[lat]</lat>\n");
-        echo("<lon>$r[lon]</lon>\n");
-        echo("<user>$r[username]</user>\n");
-        echo("<dtime>$r[dtime]</dtime>\n");
-        echo("<manual>$r[manual]</manual>\n");
-        echo("<action>$r[action]</action>\n");
-    }
-    else{
-        echo("<reporting>0</reporting>\n");
-    }
-?>

+ 0 - 61
www/app/locationreport.php

@@ -1,61 +0,0 @@
-<?php
-    include("../functions.php");
-    $con = startdb('rw');
-    
-    //Get fields
-    $user = mysqli_real_escape_string($con, $_GET['user']);
-    $code = mysqli_real_escape_string($con, $_GET['code']);
-    $lat = mysqli_real_escape_string($con, $_GET['lat']);
-    $lon = mysqli_real_escape_string($con, $_GET['lon']);
-    $action = mysqli_real_escape_string($con, $_GET['action']);
-    $manual = mysqli_real_escape_string($con, $_GET['manual']);
-    
-    //Validate code
-    $q = mysqli_query($con, "SELECT id FROM user WHERE id = $user AND md5(concat(password, md5(salt))) = '$code';");
-    //echo "SELECT id FROM user WHERE id = $user AND md5(concat(password, md5(salt))) = '$code'";
-    if (mysqli_num_rows($q) == 0){
-        echo("Reporting location with wrong credentials (IP $_SERVER[REMOTE_ADDR])");
-        error_log("Reporting location with wrong credentials (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    //If its an automatic update, and the last singal from the user was to stop, stop it
-//     if ($manual == 1){
-//         $q = mysqli_query($con, "SELECT action FROM location WHERE user = $user AND (action = 'start' OR action = 'stop') ORDER BY dtime DESC LIMIT 1");
-//         if (mysqli_num_rows($q) == 0){
-//             echo("<status>0</status>\n");
-//             exit(0);
-//         }
-//         else{
-//             $r = mysqli_fetch_array($q);
-//             if ($r['action'] == 'stop'){
-//                 echo("<status>0</status>\n");
-//                 exit(0);
-//             }
-//         }
-//     }
-    
-    //Validate fields
-    if (is_numeric($lat) == false || is_numeric($lon) == false){
-        error_log("Reporting location: invalid coordinates (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    if ($action != "start" && $action != "stop" && $action != "report"){
-        error_log("Reporting location: invalid action '$action' (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    if ($manual != 0 && $manual != 1){
-        error_log("Reporting location: invalid value for manual '$manual' (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    //Insert
-    mysqli_query($con, "INSERT INTO location (lat, lon, manual, action, user) VALUES ($lat, $lon, $manual, '$action', $user);");
-    echo("<status>1</status>\n");
-?>

+ 0 - 22
www/app/login.php

@@ -1,22 +0,0 @@
-<?php
-    include("../functions.php");
-    $con = startdb();
-    
-    //Get fields
-    $user = mysqli_real_escape_string($con, $_GET['name']);
-    $pass = mysqli_real_escape_string($con, $_GET['password']);
-    
-    //Get user entry
-    $q = mysqli_query($con, "SELECT id, md5(salt) AS salt, fname, lname FROM user WHERE active = 1 AND lcase(username) = lcase('$user') AND password = '$pass';");
-    if (mysqli_num_rows($q) > 0){
-        $r = mysqli_fetch_array($q);
-        echo("<status>1</status>\n");
-        echo("<id>$r[id]</id>\n");
-        echo("<fname>$r[fname]</fname>\n");
-        echo("<lname>$r[lname]</lname>\n");
-        echo("<salt>" . $r['salt'] . "</salt>\n");
-    }
-    else{
-        echo("<status>0</status>\n");
-    }
-?>

+ 0 - 20
www/app/notifications.php

@@ -1,20 +0,0 @@
-<?php
-    include("../functions.php");
-    $con = startdb();
-        
-    //Get user entry
-    // 1=0 Old API is now disabled
-    $q = mysqli_query($con, "SELECT id, action, title_es, title_en, title_eu, text_es, text_en, text_eu FROM notification WHERE 1 = 0 AND dtime > NOW() - INTERVAL duration MINUTE ORDER BY dtime DESC ;");
-    while ($r = mysqli_fetch_array($q)){
-        echo("<notification>\n");
-        echo("\t<id>$r[id]</id>\n");
-        echo("\t<action>$r[action]</action>\n");
-        echo("\t<title_es>$r[title_es]</title_es>\n");
-        echo("\t<title_en>$r[title_en]</title_en>\n");
-        echo("\t<title_eu>$r[title_eu]</title_eu>\n");
-        echo("\t<text_es>$r[text_es]</text_es>\n");
-        echo("\t<text_en>$r[text_en]</text_en>\n");
-        echo("\t<text_eu>$r[text_eu]</text_eu>\n");
-        echo("</notification>\n");
-    }
-?>

+ 0 - 62
www/app/sendnotification.php

@@ -1,62 +0,0 @@
-<?php
-    include("../functions.php");
-    $con = startdb('rw');
-    
-    //Get fields
-    $user = mysqli_real_escape_string($con, $_GET['user']);
-    $code = mysqli_real_escape_string($con, $_GET['code']);
-    $title_es = urldecode(mysqli_real_escape_string($con, $_GET['titleEs']));
-    $title_en = urldecode(mysqli_real_escape_string($con, $_GET['titleEn']));
-    $title_eu = urldecode(mysqli_real_escape_string($con, $_GET['titleEu']));
-    $text_es = urldecode(mysqli_real_escape_string($con, $_GET['textEs']));
-    $text_en = urldecode(mysqli_real_escape_string($con, $_GET['textEn']));
-    $text_eu = urldecode(mysqli_real_escape_string($con, $_GET['textEu']));
-    $duration = mysqli_real_escape_string($con, $_GET['duration']);
-    $action = mysqli_real_escape_string($con, $_GET['action']);
-    
-    //Validate code
-    $q = mysqli_query($con, "SELECT id FROM user WHERE id = $user AND md5(concat(password, md5(salt))) = '$code'");
-    //echo "SELECT id FROM user WHERE id = $user AND md5(concat(password, md5(salt))) = '$code'";
-    if (mysqli_num_rows($q) == 0){
-        error_log("Reporting location with wrong credentials (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    //Validate fields
-    if (strlen($title_es) == 0 || strlen($text_es) == 0){
-        error_log("Sending notification: no text (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-
-    if (is_numeric($duration) == false || $duration < 1 && $duration > 48 * 60){
-        error_log("Sending notification: invalid duration: $duration (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    if ($action != 'text' && $action != 'lablanca' && $action != 'gmschedule' && $action != 'cityschedule' && $action != 'location' && $action != 'around' && $action != 'blog' && $action != 'activities' && $action != 'gallery'){
-        error_log("Sending notification: invalid action: '$action' (IP $_SERVER[REMOTE_ADDR])");
-        echo("<status>0</status>\n");
-        exit(-1);
-    }
-    
-    //Handle translations
-    if (strlen($titleEn) == 0){
-        $titleEn = $titleEs;
-    }
-    if (strlen($titleEu) == 0){
-        $titleEu = $titleEs;
-    }
-    if (strlen($textEn) == 0){
-        $textEn = $textEs;
-    }
-    if (strlen($textEu) == 0){
-        $textEu = $textEs;
-    }
-    
-    //Insert
-    mysqli_query($con, "INSERT INTO notification (user, title_es, title_en, title_eu, text_es, text_en, text_eu, action, duration) VALUES ($user, '$title_es', '$title_en', '$title_eu', '$text_es', '$text_en', '$text_eu', '$action', $duration);");
-    echo("<status>1</status>\n");
-?>

+ 0 - 462
www/app/sync.php

@@ -1,462 +0,0 @@
-<?php
-    include('../functions.php');
-    $con = startdb('rw');
-    
-    //Get post data
-    $os = mysqli_real_escape_string($con, $_GET['os']);
-    $user = mysqli_real_escape_string($con, $_GET['code']);
-    $fg = mysqli_real_escape_string($con, $_GET['fg']);
-    $ip = getUserIP();
-    
-    //Get client version
-    $get_version = mysqli_real_escape_string($con, $_GET['v']);
-    
-    //If client version equials server version, theres is nothing to sync
-    $q_v = mysqli_query($con, "SELECT value FROM settings WHERE name = 'version';");
-    if (mysqli_num_rows($q_v) == 0){
-        //Here Im sending the app an OK code, but its not OK.
-        error_log("Trying to sync with a client, but there is no db version!");
-        echo "<synced>1</synced>\n";
-        mysqli_query($con, "INSERT INTO stat_sync (user, fg, os, ip, synced) VALUES ('$user', $fg, '$os', '$ip', 0);");
-        exit(-1);
-    }
-    else{
-        $r_v = mysqli_fetch_array($q_v);
-        if ($r_v['value'] <= $get_version){
-            echo "<synced>1</synced>\n";
-            mysqli_query($con, "INSERT INTO stat_sync (user, fg, os, ip, synced) VALUES ('$user', $fg, '$os', '$ip', 0);");
-            exit(-1);
-        }
-    }
-    
-    mysqli_query($con, "INSERT INTO stat_sync (user, fg, os, ip, synced) VALUES ('$user', $fg, '$os', '$ip', 1);");
-    error_log("INSERT INTO stat_sync (user, fg, os, ip, synced) VALUES ('$user', $fg, '$os', '$ip', 1);");
-    
-    //Header
-    echo "<database>\n";
-    echo "\t<name>gm</name>\n";
-    //Echo version
-    echo "\t<version>$r_v[value]</version>\n";
-    
-    //Rest of settings
-    $q = mysqli_query($con, "SELECT value FROM settings WHERE name = 'photos';");
-    if (mysqli_num_rows($q) > 0){
-        $r = mysqli_fetch_array($q);
-        echo "\t<photos>$r[value]</photos>\n";
-    }
-    $q = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
-    if (mysqli_num_rows($q) > 0){
-        $r = mysqli_fetch_array($q);
-        echo "\t<festivals>$r[value]</festivals>\n";
-    }
-    
-    //Table activity
-    echo "\t<table>\n";
-    echo "\t\t<name>activity</name>\n";
-    $q = mysqli_query($con, "SELECT id, permalink, date, city, title_es, title_en, title_eu, text_es, text_en, text_eu, after_es, after_en, after_eu, price, inscription, max_people, album, dtime, comments FROM activity  WHERE visible = 1;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<permalink>'$r[permalink]'</permalink>\n";
-        echo "\t\t\t<date>'$r[date]'</date>\n";
-        echo "\t\t\t<city>'$r[city]'</city>\n";
-        echo "\t\t\t<title_es>'$r[title_es]'</title_es>\n";
-        echo "\t\t\t<title_en>'$r[title_en]'</title_en>\n";
-        echo "\t\t\t<title_eu>'$r[title_eu]'</title_eu>\n";
-        echo "\t\t\t<text_es>'$r[text_es]'</text_es>\n";
-        echo "\t\t\t<text_en>'$r[text_en]'</text_en>\n";
-        echo "\t\t\t<text_eu>'$r[text_eu]'</text_eu>\n";
-        echo "\t\t\t<after_es>'$r[after_es]'</after_es>\n";
-        echo "\t\t\t<after_en>'$r[after_en]'</after_en>\n";
-        echo "\t\t\t<after_eu>'$r[after_eu]'</after_eu>\n";
-        echo "\t\t\t<price>$r[price]</price>\n";
-        echo "\t\t\t<inscription>$r[inscription]</inscription>\n";
-        echo "\t\t\t<max_people>$r[max_people]</max_people>\n";
-        echo "\t\t\t<album>$r[album]</album>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        echo "\t\t\t<comments>$r[comments]</comments>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table activity_comment
-    echo "\t<table>\n";
-    echo "\t\t<name>activity_comment</name>\n";
-    $q = mysqli_query($con, "SELECT activity_comment.id AS id, activity, text, dtime, fname, username, lang FROM activity_comment, user WHERE activity_comment.user = user.id AND approved = 1;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<activity>$r[activity]</activity>\n";
-        echo "\t\t\t<text>'$r[text]'</text>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        if (strlen($r['username'] == 0)){
-            echo "\t\t\t\<username>'$r[fname]'</username>\n";
-        }
-        else{
-            echo "\t\t\t\<username>'$r[username]'</username>\n";
-        }
-        echo "\t\t\t<lang>'$r[lang]'</lang>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table activity_image
-    echo "\t<table>\n";
-    echo "\t\t<name>activity_image</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM activity_image;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<activity>$r[activity]</activity>\n";
-        echo "\t\t\t<image>'$r[image]'</image>\n";
-        echo "\t\t\t<idx>$r[idx]</idx>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table activity_itinerary
-    echo "\t<table>\n";
-    echo "\t\t<name>activity_itinerary</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM activity_itinerary;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<activity>$r[activity]</activity>\n";
-        echo "\t\t\t<name_es>'$r[name_es]'</name_es>\n";
-        echo "\t\t\t<name_en>'$r[name_en]'</name_en>\n";
-        echo "\t\t\t<name_eu>'$r[name_eu]'</name_eu>\n";
-        echo "\t\t\t<description_es>'$r[description_es]'</description_es>\n";
-        echo "\t\t\t<description_en>'$r[description_en]'</description_en>\n";
-        echo "\t\t\t<description_eu>'$r[description_eu]'</description_eu>\n";
-        echo "\t\t\t<start>'$r[start]'</start>\n";
-        echo "\t\t\t<end>'$r[end]'</end>\n";
-        echo "\t\t\t<place>'$r[place]'</place>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table activity_tag
-    echo "\t<table>\n";
-    echo "\t\t<name>activity_tag</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM activity_tag;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<activity>$r[activity]</activity>\n";
-        echo "\t\t\t<tag>'$r[tag]'</tag>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table album
-    echo "\t<table>\n";
-    echo "\t\t<name>album</name>\n";
-    $q = mysqli_query($con, "SELECT id, permalink, title_es, title_en, title_eu, description_es, description_en, description_eu, open, dtime FROM album;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<permalink>'$r[permalink]'</permalink>\n";
-        echo "\t\t\t<name_es>'$r[title_es]'</name_es>\n";
-        echo "\t\t\t<name_en>'$r[title_en]'</name_en>\n";
-        echo "\t\t\t<name_eu>'$r[title_eu]'</name_eu>\n";
-        echo "\t\t\t<description_es>'$r[description_es]'</description_es>\n";
-        echo "\t\t\t<description_en>'$r[description_en]'</description_en>\n";
-        echo "\t\t\t<description_eu>'$r[description_eu]'</description_eu>\n";
-        echo "\t\t\t<open>$r[open]</open>\n";
-        echo "\t\t\t<time>'$r[dtime]'</time>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table festival
-    echo "\t<table>\n";
-    echo "\t\t<name>festival</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM festival;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<year>$r[year]</year>\n";
-        echo "\t\t\t<text_es>'$r[text_es]'</text_es>\n";
-        echo "\t\t\t<text_en>'$r[text_en]'</text_en>\n";
-        echo "\t\t\t<text_eu>'$r[text_eu]'</text_eu>\n";
-        echo "\t\t\t<img>'$r[img]'</img>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table festival_day
-    echo "\t<table>\n";
-    echo "\t\t<name>festival_day</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM festival_day;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<date>'$r[date] 00:00:00'</date>\n";
-        echo "\t\t\t<name_es>'$r[name_es]'</name_es>\n";
-        echo "\t\t\t<name_en>'$r[name_en]'</name_en>\n";
-        echo "\t\t\t<name_eu>'$r[name_eu]'</name_eu>\n";
-        echo "\t\t\t<price>$r[price]</price>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table festival_event
-    echo "\t<table>\n";
-    echo "\t\t<name>festival_event</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM festival_event;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<gm>$r[gm]</gm>\n";
-        echo "\t\t\t<title_es>'$r[title_es]'</title_es>\n";
-        echo "\t\t\t<title_en>'$r[title_en]'</title_en>\n";
-        echo "\t\t\t<title_eu>'$r[title_eu]'</title_eu>\n";
-        echo "\t\t\t<description_es>'$r[description_es]'</description_es>\n";
-        echo "\t\t\t<description_en>'$r[description_en]'</description_en>\n";
-        echo "\t\t\t<description_eu>'$r[description_eu]'</description_eu>\n";
-        echo "\t\t\t<host>$r[host]</host>\n";
-        echo "\t\t\t<place>$r[place]</place>\n";
-        echo "\t\t\t<start>'$r[start]'</start>\n";
-        echo "\t\t\t<end>'$r[end]'</end>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table festival_event_image
-    echo "\t<table>\n";
-    echo "\t\t<name>festival_event_image</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM festival_event_image;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<event>$r[event]</event>\n";
-        echo "\t\t\t<image>'$r[image]'</image>\n";
-        echo "\t\t\t<idx>$r[idx]</idx>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table festival_offer
-    echo "\t<table>\n";
-    echo "\t\t<name>festival_offer</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM festival_offer;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<year>$r[year]</year>\n";
-        echo "\t\t\t<name_es>'$r[name_es]'</name_es>\n";
-        echo "\t\t\t<name_en>'$r[name_en]'</name_en>\n";
-        echo "\t\t\t<name_eu>'$r[name_eu]'</name_eu>\n";
-        echo "\t\t\t<description_es>'$r[description_es]'</description_es>\n";
-        echo "\t\t\t<description_en>'$r[description_en]'</description_en>\n";
-        echo "\t\t\t<description_eu>'$r[description_eu]'</description_eu>\n";
-        echo "\t\t\t<days>$r[days]</days>\n";
-        echo "\t\t\t<price>$r[price]</price>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table location
-    echo "\t<table>\n";
-    echo "\t\t<name>location</name>\n";
-    $q = mysqli_query($con, "SELECT id, dtime, lat, lon, manual FROM location;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        echo "\t\t\t<lat>$r[lat]</lat>\n";
-        echo "\t\t\t<lon>$r[lon]</lon>\n";
-        echo "\t\t\t<manual>$r[manual]</manual>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table notification
-    echo "\t<table>\n";
-    echo "\t\t<name>notification</name>\n";
-    $q = mysqli_query($con, "SELECT id, dtime, duration, action, title_es, title_en, title_eu, text_es, text_en, text_eu, internal FROM notification;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        echo "\t\t\t<duration>$r[duration]</duration>\n";
-        echo "\t\t\t<action>'$r[action]'</action>\n";
-        echo "\t\t\t<title_es>'$r[title_es]'</title_es>\n";
-        echo "\t\t\t<title_en>'$r[title_en]'</title_en>\n";
-        echo "\t\t\t<title_eu>'$r[title_eu]'</title_eu>\n";
-        echo "\t\t\t<text_es>'$r[text_es]'</text_es>\n";
-        echo "\t\t\t<text_en>'$r[text_en]'</text_en>\n";
-        echo "\t\t\t<text_eu>'$r[text_eu]'</text_eu>\n";
-        echo "\t\t\t<internal>$r[internal]</internal>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table people
-    echo "\t<table>\n";
-    echo "\t\t<name>people</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM people;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<name_es>'$r[name_es]'</name_es>\n";
-        echo "\t\t\t<name_en>'$r[name_en]'</name_en>\n";
-        echo "\t\t\t<name_eu>'$r[name_eu]'</name_eu>\n";
-        echo "\t\t\t<link>'$r[link]'</link>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table photo
-    echo "\t<table>\n";
-    echo "\t\t<name>photo</name>\n";
-    $q = mysqli_query($con, "SELECT photo.id AS id, file, permalink, title_es, title_en, title_eu, description_es, description_en, description_eu, dtime, uploaded, place, width, height, size, fname FROM photo, user WHERE photo.user = user.id AND approved = 1;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<file>'$r[file]'</file>\n";
-        echo "\t\t\t<permalink>$r[city]</permalink>\n";
-        echo "\t\t\t<title_es>'$r[title_es]'</title_es>\n";
-        echo "\t\t\t<title_en>'$r[title_en]'</title_en>\n";
-        echo "\t\t\t<title_eu>'$r[title_eu]'</title_eu>\n";
-        echo "\t\t\t<description_es>'$r[description_es]'</description_es>\n";
-        echo "\t\t\t<description_en>'$r[description_en]'</description_en>\n";
-        echo "\t\t\t<description_eu>'$r[description_eu]'</description_eu>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        echo "\t\t\t<uploaded>'$r[uploaded]'</uploaded>\n";
-        echo "\t\t\t<place>$r[place]</place>\n";
-        echo "\t\t\t<width>$r[width]</width>\n";
-        echo "\t\t\t<height>$r[height]</height>\n";
-        echo "\t\t\t<size>$r[size]</size>\n";
-        if (strlen($r['username'] == 0)){
-            echo "\t\t\t\<username>'$r[fname]'</username>\n";
-        }
-        else{
-            echo "\t\t\t\<username>'$r[username]'</username>\n";
-        }
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table photo_album
-    echo "\t<table>\n";
-    echo "\t\t<name>photo_album</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM photo_album;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<photo>$r[photo]</photo>\n";
-        echo "\t\t\t<album>$r[album]</album>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table photo_comment
-    echo "\t<table>\n";
-    echo "\t\t<name>photo_comment</name>\n";
-    $q = mysqli_query($con, "SELECT photo_comment.id AS id, photo, text, dtime, fname, username, lang FROM photo_comment, user WHERE photo_comment.user = user.id AND approved = 1;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<photo>$r[photo]</photo>\n";
-        echo "\t\t\t<text>'$r[text]'</text>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        if (strlen($r['username'] == 0)){
-            echo "\t\t\t\<username>'$r[fname]'</username>\n";
-        }
-        else{
-            echo "\t\t\t\<username>'$r[username]'</username>\n";
-        }
-        echo "\t\t\t<lang>'$r[lang]'</lang>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table place
-    echo "\t<table>\n";
-    echo "\t\t<name>place</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM place;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<name_es>'$r[name_es]'</name_es>\n";
-        echo "\t\t\t<name_en>'$r[name_en]'</name_en>\n";
-        echo "\t\t\t<name_eu>'$r[name_eu]'</name_eu>\n";
-        echo "\t\t\t<address_es>'$r[address_es]'</address_es>\n";
-        echo "\t\t\t<address_en>'$r[address_en]'</address_en>\n";
-        echo "\t\t\t<address_eu>'$r[address_eu]'</address_eu>\n";
-        echo "\t\t\t<cp>'$r[cp]'</cp>\n";
-        echo "\t\t\t<lat>$r[lat]</lat>\n";
-        echo "\t\t\t<lon>$r[lon]</lon>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table post
-    echo "\t<table>\n";
-    echo "\t\t<name>post</name>\n";
-    $q = mysqli_query($con, "SELECT id, permalink, title_es, title_en, title_eu, text_es, text_en, text_eu, dtime, comments FROM post  WHERE visible = 1;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<permalink>'$r[permalink]'</permalink>\n";
-        echo "\t\t\t<title_es>'$r[title_es]'</title_es>\n";
-        echo "\t\t\t<title_en>'$r[title_en]'</title_en>\n";
-        echo "\t\t\t<title_eu>'$r[title_eu]'</title_eu>\n";
-        echo "\t\t\t<text_es>'$r[text_es]'</text_es>\n";
-        echo "\t\t\t<text_en>'$r[text_en]'</text_en>\n";
-        echo "\t\t\t<text_eu>'$r[text_eu]'</text_eu>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        echo "\t\t\t<comments>$r[comments]</comments>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table post_comment
-    echo "\t<table>\n";
-    echo "\t\t<name>post_comment</name>\n";
-    //$q = mysqli_query($con, "SELECT post_comment.id AS id, post, text, dtime, fname, post_comment.username AS username, lang FROM post_comment, user WHERE post_comment.user = user.id AND approved = 1;");
-    $q = mysqli_query($con, "SELECT id, post, text, dtime, username, lang FROM post_comment WHERE approved = 1;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<post>$r[post]</post>\n";
-        echo "\t\t\t<text>'$r[text]'</text>\n";
-        echo "\t\t\t<dtime>'$r[dtime]'</dtime>\n";
-        //if (strlen($r['username'] == 0)){
-        //    echo "\t\t\t<username>'$r[fname]'</username>\n";
-        //}
-        //else{
-            echo "\t\t\t<username>'$r[username]'</username>\n";
-        //}
-        echo "\t\t\t<lang>'$r[lang]'</lang>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table post_image
-    echo "\t<table>\n";
-    echo "\t\t<name>post_image</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM post_image;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<id>$r[id]</id>\n";
-        echo "\t\t\t<post>$r[post]</post>\n";
-        echo "\t\t\t<image>'$r[image]'</image>\n";
-        echo "\t\t\t<idx>$r[idx]</idx>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    //Table post_tag
-    echo "\t<table>\n";
-    echo "\t\t<name>post_tag</name>\n";
-    $q = mysqli_query($con, "SELECT * FROM post_tag;");
-    while ($r = mysqli_fetch_array($q)){
-        echo "\t\t<row>\n";
-        echo "\t\t\t<post>$r[post]</post>\n";
-        echo "\t\t\t<tag>'$r[tag]'</tag>\n";
-        echo "\t\t</row>\n";
-    }
-    echo "\t</table>\n";
-    
-    echo "</database>\n";
-?>