Bladeren bron

Several more pages reformatted.

Iñigo Valentin 9 jaren geleden
bovenliggende
commit
697eb44b17

+ 78 - 78
www/app/index.php

@@ -1,101 +1,101 @@
 <?php
-	include("../functions.php");
-	$browser_data = get_browser(null, true);
-	$os = $browser_data["platform"];
+    include("../functions.php");
+    $browser_data = get_browser(null, true);
+    $os = $browser_data["platform"];
 
-	if (strpos(strtolower($os), 'android') !== false){
-		header('Location: https://play.google.com/store/apps/details?id=com.ivalentin.margolariak');
-		exit(0);
-	}
-	elseif (strpos(strtolower($os), 'ios') !== false){
-		header('Location: https://itunes.apple.com/us/app/gasteizko-margolariak/id1227846624');
-		exit(0);
-	}
-	else{
-		session_start();
-		$http_host = $_SERVER["HTTP_HOST"];
-		$proto = getProtocol();
-		$server = "$proto$http_host";
-		
-		//Language
-		$lang = selectLanguage();
-		include("../lang/lang_$lang.php");
+    if (strpos(strtolower($os), 'android') !== false){
+        header('Location: https://play.google.com/store/apps/details?id=com.ivalentin.margolariak');
+        exit(0);
+    }
+    elseif (strpos(strtolower($os), 'ios') !== false){
+        header('Location: https://itunes.apple.com/us/app/gasteizko-margolariak/id1227846624');
+        exit(0);
+    }
+    else{
+        session_start();
+        $http_host = $_SERVER["HTTP_HOST"];
+        $proto = getProtocol();
+        $server = "$proto$http_host";
+        
+        //Language
+        $lang = selectLanguage();
+        include("../lang/lang_$lang.php");
 ?>
 
 <!DOCTYPE html>
 <html>
-	<head>
-		<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>
-		<link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
-		<!-- CSS files -->
-		<style>
+    <head>
+        <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>
+        <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
+        <!-- CSS files -->
+        <style>
 <?php 
-			include("../css/ui.css"); 
-			include("../css/app.css");
+            include("../css/ui.css"); 
+            include("../css/app.css");
 ?>
-		</style>
-		<!-- CSS for mobile version -->
-		<style media="(max-width : 990px)">
+        </style>
+        <!-- CSS for mobile version -->
+        <style media="(max-width : 990px)">
 <?php 
-			include("../css/m/ui.css"); 
+            include("../css/m/ui.css"); 
 ?>
-		</style>
-		<!-- Script files -->
-		<script type="text/javascript">
+        </style>
+        <!-- Script files -->
+        <script type="text/javascript">
 <?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 property="og:url" content="<?=$server?>"/>
-		<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: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:image" content="<?=$server?>/img/logo/logo.png"/>
-		<meta name="twitter:url" content="<?=$server?>/app/"/>
-		<meta name="robots" content="index follow"/>
-	</head>
-	<body>
+        </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 property="og:url" content="<?=$server?>"/>
+        <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: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: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");
 ?>
-		<div id="content">
-			<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
-			<table>
-				<tr>
-					<td>
-						<a target="_blank" href="https://play.google.com/store/apps/details?id=com.ivalentin.margolariak">
-							<img src="<?=$server?>/img/app/android.gif"/>
-						</a>
-					</td>
-					<td>	
-						<a target="_blank" href="https://itunes.apple.com/us/app/gasteizko-margolariak/id1227846624">
-							<img src="<?=$server?>/img/app/ios.gif"/>
-						</a>
-					</td>
-				</tr>
-			</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>
+        <div id="content">
+            <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
+            <table>
+                <tr>
+                    <td>
+                        <a target="_blank" href="https://play.google.com/store/apps/details?id=com.ivalentin.margolariak">
+                            <img src="<?=$server?>/img/app/android.gif"/>
+                        </a>
+                    </td>
+                    <td>    
+                        <a target="_blank" href="https://itunes.apple.com/us/app/gasteizko-margolariak/id1227846624">
+                            <img src="<?=$server?>/img/app/ios.gif"/>
+                        </a>
+                    </td>
+                </tr>
+            </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");
 ?>
-	</body>
+    </body>
 </html>
 
 <?php
-	}
+    }
 ?>

+ 90 - 76
www/galeria/album.php

@@ -1,19 +1,19 @@
 <?php
     session_start();
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("../functions.php");
     $con = startdb();
     $proto = getProtocol();
-    #server = "$proto$http_host";
+    $server = "$proto$http_host";
     
     //Language
     $lang = selectLanguage();
-    include("../lang/lang_" . $lang . ".php");
+    include("../lang/lang_$lang.php");
     
-    $cur_section = $lng['section_gallery'];
+    $cur_section = $lng["section_gallery"];
     
     //Get album
-    $perm = mysqli_real_escape_string($con, $_GET['perm']);
+    $perm = mysqli_real_escape_string($con, $_GET["perm"]);
     $q = mysqli_query($con, "SELECT id, permalink, title_$lang AS title, description_$lang AS description, user, open, dtime FROM album WHERE permalink = '$perm';");
     if (mysqli_num_rows($q) == 0){
         header("Location: /galeria/");
@@ -21,109 +21,123 @@
     }
     else{
         $r = mysqli_fetch_array($q);
-        $id = $r['id'];
+        $id = $r["id"];
 ?>
 <!DOCTYPE html>
 <html>
     <head>
-        <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+        <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><?php echo $r['title'];?> - Gasteizko Margolariak</title>
-        <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
+        <meta name='viewport' content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
+        <title><?=$r["title"]?> - Gasteizko Margolariak</title>
+        <link rel="shortcut icon" href="<?php echo "$server/img/logo/favicon.ico";?>">
         <!-- CSS files -->
         <style>
-            <?php
-                include("../css/ui.css");
-                include("../css/galeria.css");
-            ?>
+<?php
+            include("../css/ui.css");
+            include("../css/galeria.css");
+?>
         </style>
         <!-- CSS for mobile version -->
         <style media="(max-width : 990px)">
-            <?php
-                include("../css/m/ui.css");
-                include("../css/m/galeria.css");
-            ?>
+<?php
+            include("../css/m/ui.css");
+            include("../css/m/galeria.css");
+?>
         </style>
         <!-- Script files -->
         <script type="text/javascript">
-            <?php
-                include("../script/ui.js");
-                include("../script/galeria.js");
-            ?>
+<?php
+            include("../script/ui.js");
+            include("../script/galeria.js");
+?>
         </script>
         <!-- Meta tags -->
-        <link rel="canonical" href="<?php echo "$proto$http_host/galeria/$perm"; ?>"/>
-        <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
-        <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
-        <meta name="description" content="<?php echo strip_tags($r['description']);?>"/>
-        <meta property="og:title" content="<?php echo $l['title'];?> - Gasteizko Margolariak"/>
-        <meta property="og:url" content="<?php echo "$proto$http_host/galeria/$perm"; ?>"/>
-        <meta property="og:description" content="<?php echo strip_tags($r['description']); ?>"/>
-        <meta property="og:image" content="<?php  echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta property="og:site_name" content="Gasteizko Margolariak"/>
-        <meta property="og:type" content="website"/>
-        <meta property="og:locale" content="<?php echo $lang; ?>"/>
-        <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" content="<?php echo $l['title'];?> - Gasteizko Margolariak"/>
-        <meta name="twitter:description" content="<?php echo strip_tags($r['description']); ?>"/>
-        <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta name="twitter:url" content="<?php echo "$proto$http_host/galeria/$perm"; ?>"/>
-        <meta name="robots" content="index follow"/>
+        <link rel='canonical' href='<?=$server?>/galeria/<?=$perm?>'/>
+        <link rel='author' href='<?=$server?>'/>
+        <link rel='publisher' href='<?=$server?>'/>
+        <meta name='description' content='<?=strip_tags($r["description"])?>'/>
+        <meta property='og:title' content='<?=$r["title"]?> - Gasteizko Margolariak'/>
+        <meta property='og:url' content='<?=$server?>/galeria/<?=$perm?>'/>
+        <meta property='og:description' content='<?=strip_tags($r["description"])?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta property='og:site_name' content='Gasteizko Margolariak'/>
+        <meta property='og:type' content='website'/>
+        <meta property='og:locale' content='<?=$lang?>'/>
+        <meta name='twitter:card' content='summary'/>
+        <meta name='twitter:title' content='<?=$r["title"]?> - Gasteizko Margolariak'/>
+        <meta name='twitter:description' content='<?=strip_tags($r["description"]) ?>'/>
+        <meta name='twitter:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta name='twitter:url' content='<?=$server?>/galeria/<?=$perm?>'/>
+        <meta name='robots' content='index follow'/>
     </head>
     <body onLoad="populatePhotos();" onkeypress="keyDown(event);">
-        <?php include("../header.php"); ?>
-        <div id="content">
-            <div class="section" id="album" itemscope itemtype='https://schema.org/ImageGallery'>
+<?php
+        include("../header.php");
+?>
+        <div id='content'>
+            <div class='section' id='album' itemscope itemtype='https://schema.org/ImageGallery'>
                 <div class='hidden' itemprop='author creator' itemscope itemtype='http://schema.org/Organization'>
                     <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
                     <meta itemprop='name' content='Gasteizko Margolariak'/>
-                    <meta itemprop='logo' content='$proto$http_host/img/logo/logo.png'/>
+                    <meta itemprop='logo' content='$server/img/logo/logo.png'/>
                     <meta itemprop='foundingDate' content='03-02-2013'/>
                     <meta itemprop='telephone' content='+34637140371'/>
                     <meta itemprop='url' content='<?=$server ?>'/>
                 </div>
-
-                <?php
-                    //Header
-                    echo("<h3 class='section_title' itemprop='name' id='album_title'>$r[title]</h3>\n");
-                    if ($r['description'] != ''){
-                        echo "<div class='entry' id='album_header'>\n";
-                        echo $r['description'];
-                        echo "</div>\n";
-                    }
-
-                    //Photos of the album
-                    $q_photo = mysqli_query($con, "SELECT id, file, permalink, title_$lang AS title, description_$lang AS description, photo.dtime AS dtime, uploaded, width, height, size, user, username FROM photo, photo_album WHERE photo_album.photo = id AND album = $r[id] ORDER BY photo.dtime DESC;");
-                    /* TODO AND approved = 1*/
-                    while ($r_photo = mysqli_fetch_array($q_photo)){
-                        echo "<div class='entry photo'>\n<div class='photo_container'>\n";
-                        echo "<img class='pointer photo_img' path='$r_photo[file]' onClick=\"showPhotoByPath('$r_photo[file]');\" src='/img/galeria/miniature/$r_photo[file]' /></div>\n";
-                        echo("<meta itemprop='image' content='$proto$http_host/img/galeria/view/$r_photo[file]'/>\n");
-                        if (strlen($r_photo['title']) > 0 ){
-                            echo "<h3 class='entry_title'><a href='javascript:;' onClick=\"showPhotoByPath('$r_photo[file]');\">$r_photo[title]</a></h4>\n";
+                <h3 class='section_title' itemprop='name' id='album_title'><?=$r["title"]?></h3>
+<?php
+                if ($r["description"] != ''){
+?>
+                    <div class='entry' id='album_header'>
+                        <?=$r["description"]?>
+                    </div>
+<?php
+                }
+                //Photos of the album
+                $q_photo = mysqli_query($con, "SELECT id, file, permalink, title_$lang AS title, description_$lang AS description, photo.dtime AS dtime, uploaded, width, height, size, user, username FROM photo, photo_album WHERE photo_album.photo = id AND album = $r[id] AND approved = 1 ORDER BY photo.dtime DESC;");
+                while ($r_photo = mysqli_fetch_array($q_photo)){
+?>
+                    <div class='entry photo'>
+                        <div class='photo_container'>
+                            <img class='pointer photo_img' path='<?=$r_photo["file"]?>' onClick='showPhotoByPath("<?=$r_photo["file"]?>");' src='<?=$server?>/img/galeria/miniature/<?=$r_photo["file"]?>'/>
+                        </div>
+                        <meta itemprop='image' content='<?=$server?>/img/galeria/view/<?=$r_photo["file"]?>'/>
+<?php
+                        if (strlen($r_photo["title"]) > 0 ){
+?>
+                            <h3 class='entry_title'>
+                                <a onClick='showPhotoByPath("<?=$r_photo["file"]?>");'><?=$r_photo["title"]?></a>
+                            </h3>
+<?php
                         }
-                        if (strlen($r_photo['description']) > 0 ){
-                            echo "<span class='photo_description'>" . cutText($r_photo['description'], 50) . "</span>\n";
+                        if (strlen($r_photo["description"]) > 0 ){
+?>
+                            <span class='photo_description'><?=cutText($r_photo["description"], 50)?></span>
+<?php
                         }
                         //Count comments
                         $q_comments = mysqli_query($con, "SELECT id FROM photo_comment WHERE photo = $r_photo[id];");
-                        echo "<span class='comment_counter'>" . mysqli_num_rows($q_comments) . "<img src='$proto$http_host/img/misc/comment.png' alt=' '/></span>\n"; //TODO: icon
-                        echo "\n</div>\n";
-                    }
-                ?>
+?>
+                        <span class='comment_counter'><?=mysqli_num_rows($q_comments)?><img src='<?=$server?>/img/misc/comment.png' alt=' '/></span>
+                    </div> <!-- entry photo -->
+<?php
+                }
+?>
             </div>
         </div>
-        <div id="screen_cover" onClick="closeViewer();">
+        <div id='screen_cover' onClick="closeViewer();">
         </div>
-        <div id="photo_viewer" class="section">
+        <div id='photo_viewer' class='section'>
         </div>
-        <?php
-            include("../footer.php");
-            $ad = ad($con, $lang, $lng); 
-            stats($ad, $ad_static, "galeria", "$id");
-        ?>
+<?php
+        include("../footer.php");
+        $ad = ad($con, $lang, $lng); 
+        stats($ad, $ad_static, "galeria", "$id");
+?>
     </body>
 </html>
 
-<?php } ?>
+<?php
+    }
+?>

+ 13 - 8
www/galeria/comment.php

@@ -3,6 +3,8 @@
     $http_host = $_SERVER['HTTP_HOST'];
     include("../functions.php");
     $con = startdb('rw');
+    $proto = getProtocol();
+    $server = "$proto$http_host";
     
     //Get post values
     $from =mysqli_real_escape_string($con, $_POST["from"]);
@@ -55,16 +57,19 @@
     }
     
     //Prepare the page to update the comment section
-    //WARNING: If changes are done here, do the same in album.php
     $q_comment = mysqli_query($con, "SELECT id, photo, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate, dtime, user, username, lang, text FROM photo_comment WHERE photo = $photo AND approved = 1 ORDER BY dtime;");
     error_log("SELECT id, photo, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate, dtime, user, username, lang, text FROM photo_comment WHERE photo = $photo AND approved = 1 ORDER BY TIME;");
     while ($r_comment = mysqli_fetch_array($q_comment)){
-        echo "<div itemprop='comment' itemscope itemtype='http://schema.org/UserComments' id='comment_$r_comment[id]' class='comment'>\n";
-        //When official users are implementes, see if there is user or username
-        echo "<span itemprop='creator' class='comment_user'>$r_comment[username]</span>\n";
-        echo "<span class='comment_date date'><meta itemprop='commentTime' content='$r_comment[isodate]'/>" . formatDate($r_comment['dtime'], $lang) . "</span>\n";
-        echo "<p itemprop='commentText' class='comment_text'>$r_comment[text]</p>";
-        echo "<hr class='comment_line'/>\n";
-        echo "</div>\n";
+?>
+        <div itemprop='comment' itemscope itemtype='http://schema.org/UserComments' id='comment_<?=$r_comment["id"]?>' class='comment'>
+            <span itemprop='creator' class='comment_user'><?=$r_comment["username"]?></span>
+            <span class='comment_date date'>
+                <meta itemprop='commentTime' content='<?=$r_comment["isodate"]?>'/>
+                <?=formatDate($r_comment["dtime"], $lang)?>
+            </span>
+            <p itemprop='commentText' class='comment_text'><?$r_comment["text"]?></p>
+            <hr class='comment_line'/>
+        </div>
+<?php
     }
 ?>

+ 103 - 82
www/galeria/index.php

@@ -1,122 +1,143 @@
 <?php
     session_start();
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("../functions.php");
     $con = startdb();
     $proto = getProtocol();
+	$server = "$proto$http_host";
     
     //Language
     $lang = selectLanguage();
     include("../lang/lang_" . $lang . ".php");
     
-    $cur_section = $lng['section_gallery'];
+    $cur_section = $lng["section_gallery"];
 ?>
 <!DOCTYPE html>
 <html>
     <head>
-        <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+        <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><?php echo $lng['gallery_title'];?> - Gasteizko Margolariak</title>
-        <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
+        <meta name='viewport' content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
+        <title><?=$lng["gallery_title"]?> - Gasteizko Margolariak</title>
+        <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
         <!-- CSS files -->
         <style>
-            <?php 
-                include("../css/ui.css"); 
-                include("../css/galeria.css");
-            ?>
+<?php 
+            include("../css/ui.css"); 
+            include("../css/galeria.css");
+?>
         </style>
         <!-- CSS for mobile version -->
         <style media="(max-width : 990px)">
-            <?php 
+<?php 
                 include("../css/m/ui.css"); 
                 include("../css/m/galeria.css");
-            ?>
+?>
         </style>
         <!-- Script files -->
         <script type="text/javascript">
-            <?php
+<?php
                 include("../script/ui.js");
-            ?>
+?>
         </script>
         <!-- Meta tags -->
-        <link rel="canonical" href="<?php echo "$proto$http_host"; ?>"/>
-        <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
-        <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
-        <meta name="description" content="<?php echo $lng['gallery_description'];?>"/>
-        <meta property="og:title" content="<?php echo $lng['gallery_title'];?> - Gasteizko Margolariak"/>
-        <meta property="og:url" content="<?php echo "$proto$http_host"; ?>"/>
-        <meta property="og:description" content="<?php echo $lng['gallery_description'];?>"/>
-        <meta property="og:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta property="og:site_name" content="<?php echo $lng['gallery_title'];?>"/>
-        <meta property="og:type" content="website"/>
-        <meta property="og:locale" content="<?php echo $lang; ?>"/>
-        <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" content="<?php echo $lng['gallery_title'];?> - Gasteizko Margolariak"/>
-        <meta name="twitter:description" content="<?php echo $lng['gallery_description'];?>"/>
-        <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta name="twitter:url" content="<?php echo"$proto$http_host"; ?>"/>
-        <meta name="robots" content="index follow"/>
+        <link rel='canonical' href='<?=$server?>'/>
+        <link rel='author' href='<?=$server?>'/>
+        <link rel='publisher' href='<?=$server?>'/>
+        <meta name='description' content='<?=$lng["gallery_description"]?>'/>
+        <meta property='og:title' content='<?=$lng["gallery_title"]?> - Gasteizko Margolariak'/>
+        <meta property='og:url' content='<?=$server?>'/>
+        <meta property='og:description' content='<?=$lng["gallery_description"]?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta property='og:site_name' content='<?=$lng["gallery_title"]?>'/>
+        <meta property='og:type' content='website'/>
+        <meta property='og:locale' content='<?=$lang?>'/>
+        <meta name='twitter:card' content='summary'/>
+        <meta name='twitter:title' content='<?=$lng["gallery_title"]?> - Gasteizko Margolariak'/>
+        <meta name='twitter:description' content='<?=$lng["gallery_description"]?>'/>
+        <meta name='twitter:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta name='twitter:url' content='<?=$server?>'/>
+        <meta name='robots' content='index follow'/>
     </head>
     <body>
-        <?php include("../header.php"); ?>
-        <div id="content">
+<?php include("../header.php"); ?>
+        <div id='content'>
             <br/>
-            <div class="section" id="album_list">
-                <?php
-                    echo "<h3 class='section_title'>$lng[gallery_albums]</h3>\n";
+            <div class='section' id='album_list'>
+                    <h3 class='section_title'><?=$lng["gallery_albums"]?></h3>
+<?php
                     //Album with photos with dates
                     $q = mysqli_query($con, "SELECT album.id AS id, album.permalink AS permalink, album, album.title_$lang AS title, album.description_$lang AS description FROM photo_album, photo, album WHERE album.id = photo_album.album AND photo = photo.id GROUP BY album ORDER BY avg(photo.uploaded) DESC;");
                     while ($r = mysqli_fetch_array($q)){
-                        echo("<div class='entry album_list' itemscope itemtype='https://schema.org/ImageGallery'>\n");
-                        echo("<div class='hidden' itemprop='author creator' itemscope itemtype='http://schema.org/Organization'>\n");
-                        echo("<meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>\n");
-                        echo("<meta itemprop='name' content='Gasteizko Margolariak'/>\n");
-                        echo("<meta itemprop='logo' content='$proto$http_host/img/logo/logo.png'/>\n");
-                        echo("<meta itemprop='foundingDate' content='03-02-2013'/>\n");
-                        echo("<meta itemprop='telephone' content='+34637140371'/>\n");
-                        echo("<meta itemprop='url' content='$proto$http_host'/>\n");
-                        echo("</div>\n");
-                        echo "<table class='album_thumbnails'>\n";
-                        echo "<tr>\n";
-                        $i = 0;
-                        $q_photo = mysqli_query($con, "SELECT * FROM photo, photo_album WHERE id = photo AND album = $r[album] ORDER BY rand() LIMIT 4;");
-                        while ($r_photo = mysqli_fetch_array($q_photo)){
-                            echo("<td><a itemprop='url' href='$proto$http_host/galeria/$r[permalink]'>");
-                            echo("<meta itemprop='image' content='$proto$http_host/img/galeria/view/$r_photo[file]'/>\n");
-                            echo("<img src='$proto$http_host/img/galeria/miniature/$r_photo[file]'/></a></td>\n");
-                            $i ++;
-                            if ($i == 2)
-                                echo "</tr>\n<tr>";
-                        }
-                        echo "</tr>\n</table>\n";
-                        $q_count = mysqli_query($con, "SELECT album FROM photo_album WHERE album = $r[id];");
-                        if (mysqli_num_rows($q_count) == 1){
-                            echo "<h3 class='entry_title' itemprop='name'><a href='$proto$http_host/galeria/$r[permalink]'>$r[title]</a></h3>\n";
-                            echo("1 $lng[gallery_photos_singular]");
-                        }
-                        else{
-                            echo "<h3 class='entry_title' itemprop='name'><a href='$proto$http_host/galeria/$r[permalink]'>$r[title]</a></h3>\n";
-                            echo(mysqli_num_rows($q_count) . " $lng[gallery_photos_plural]");
-                        }
-                        if (strlen($r['description']) > 0){
-                            echo("<p itemprop='description'>". cutText($r['description'], 100, "$lng[gallery_read_more]", "$proto$http_host/galeria/$r[permalink]") . "</p>\n");
-                        }
-                        echo "</div>\n";
+?>
+                        <div class='entry album_list' itemscope itemtype='https://schema.org/ImageGallery'>
+							<div class='hidden' itemprop='author creator' itemscope itemtype='http://schema.org/Organization'>
+								<meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
+								<meta itemprop='name' content='Gasteizko Margolariak'/>
+								<meta itemprop='logo' content='<?=$server?>/img/logo/logo.png'/>
+								<meta itemprop='foundingDate' content='03-02-2013'/>
+								<meta itemprop='telephone' content='+34637140371'/>
+								<meta itemprop='url' content='<?=$server?>'/>
+							</div>
+							<table class='album_thumbnails'>
+								<tr>
+<?php
+									$i = 0;
+									$q_photo = mysqli_query($con, "SELECT * FROM photo, photo_album WHERE id = photo AND album = $r[album] ORDER BY rand() LIMIT 4;");
+									while ($r_photo = mysqli_fetch_array($q_photo)){
+?>
+										<td>
+											<a itemprop='url' href='<?=$server?>/galeria/<?=$r["permalink"]?>'>
+												<meta itemprop='image' content='<?=$server?>/img/galeria/view/<?=$r_photo["file"]?>'/>
+												<img src='<?=$server?>/img/galeria/miniature/<?=$r_photo["file"]?>'/>
+											</a>
+										</td>
+<?php
+										$i ++;
+										if ($i == 2){
+?>
+											</tr>
+											<tr>
+<?php
+										}
+									}
+?>
+								</tr>
+							</table>
+							<h3 class='entry_title' itemprop='name'>
+								<a href='<?=$server?>/galeria/<?=$r["permalink"]?>'><?=$r["title"]?></a>
+							</h3>
+<?php
+							$q_count = mysqli_query($con, "SELECT album FROM photo_album WHERE album = $r[id];");
+							if (mysqli_num_rows($q_count) == 1){
+?>
+								1 <?=$lng["gallery_photos_singular"]?>
+<?php
+							}
+							else{
+?>
+								<?=mysqli_num_rows($q_count)?> <?=$lng["gallery_photos_plural"]?>
+<?php
+							}
+							if (strlen($r["description"]) > 0){
+?>
+								<p itemprop='description'><?=cutText($r["description"], 100, "$lng[gallery_read_more]", "$server/galeria/$r[permalink]")?></p>
+<?php
+							}
+?>							
+                        </div> <!--.album_list -->
+<?php
                     }
-                    
-                    //Albums with no photos or photos without dates
-                    $q = mysqli_query($con, "SELECT id, title_es FROM album WHERE id NOT IN (SELECT album FROM photo_album, photo WHERE photo = photo.id GROUP BY album);");
-                ?>
-                <div class="entry" id="gallery_entry_contribute">
-                    <?php echo $lng['gallery_header']; ?>
+?>
+                <div class='entry' id='gallery_entry_contribute'>
+                    <?=$lng["gallery_header"]?>
                 </div>
             </div>
         </div>
-        <?php
-            include("../footer.php");
-            $ad = ad($con, $lang, $lng); 
-            stats($ad, $ad_static, "galeria", "");
-        ?>
+<?php
+        include("../footer.php");
+        $ad = ad($con, $lang, $lng); 
+        stats($ad, $ad_static, "galeria", "");
+?>
     </body>
 </html>

+ 46 - 34
www/galeria/load_photo.php

@@ -1,17 +1,16 @@
 <?php
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("../functions.php");
     $con = startdb();
     $proto = getProtocol();
     $server = "$proto$http_host";
 
-    
     //Language
     $lang = selectLanguage();
-    include("../lang/lang_" . $lang . ".php");
+    include("../lang/lang_$lang.php");
     
     //Get photo data
-    $path = mysqli_real_escape_string($con, $_GET['path']);
+    $path = mysqli_real_escape_string($con, $_GET["path"]);
     $q = mysqli_query($con, "SELECT id, file, permalink, title_$lang AS title, description_$lang AS description, uploaded, size, user, username FROM photo WHERE file = '$path' AND approved = 1");
     if (mysqli_num_rows($q) == 0){
         exit(0);
@@ -25,11 +24,11 @@
 ?>
         <h3 class='section_title'>
 <?php
-            if (strlen($r['title']) > 0){
-                echo($r['title']);
+            if (strlen($r["title"]) > 0){
+                echo($r["title"]);
             }
             else{
-                echo($r_album['title']);
+                echo($r_album["title"]);
             }
 ?>
             <div id='viewer_close_container'>
@@ -48,7 +47,7 @@
                                     </td>
                                     <td id='image'>
                                         <div id='photo_viewer_image_container'>
-                                            <img id='photo_viewer_image' src='/img/galeria/preview/<?=$r['file']?>'/>
+                                            <img id='photo_viewer_image' src='/img/galeria/preview/<?=$r["file"]?>'/>
                                         </div>
                                     </td>
                                     <td class='arrow'>
@@ -56,18 +55,19 @@
                                     </td>
                                 </tr>
                             </table>
-                            <!-- Arrows -->
-                            <!--<div id='viewer_controls'>
-                                <img id='viewer_arrow_left' class='viewer_arrow pointer' alt=' ' src='<?=$server?>/img/misc/slid-left.png' onClick='scrollPhoto(-1);'/>
-                                <img id='viewer_arrow_right' class='viewer_arrow pointer' alt=' ' src='<?=$server?>/img/misc/slid-right.png' onClick='scrollPhoto(1);'/>
-                            </div>  #viewer_controls -->
 <?php
-                            if (strlen($r['description']) > 0){
-                                echo("<span id='photo_description'>$r[description]</span>\n");
+                            if (strlen($r["description"]) > 0){
+?>
+                                <span id='photo_description'><?=$r["description"]?></span>
+<?php
                             }
-                            echo("<span id='photo_date'>" . formatDate($r['uploaded'], $lang) . "</span>\n");
-                            if (strlen($r['username']) > 0){
-                                echo("<span id='photo_user'>$lng[gallery_user]$r[username]</span>\n");
+?>
+                            <span id='photo_date'><?=formatDate($r["uploaded"], $lang)?></span>
+<?php
+                            if (strlen($r["username"]) > 0){
+?>
+                                <span id='photo_user'><?=$lng["gallery_user"]?><?=$r["username"]?></span>
+<?php
                             }
 ?>
                         </div> <!-- #photo_data -->
@@ -78,30 +78,41 @@
                             $q_comment = mysqli_query($con, "SELECT * FROM photo_comment WHERE photo = $r[id];");
                             $comment_count = mysqli_num_rows($q_comment);
 ?>
-                            <div class='entry' id='comments_section'/>
+                            <div class='entry' id='comments_section'>
                                 <div id='photo_viewer_comment_counter'>
 <?php
                                     switch ($comment_count){
                                         case 0:
-                                            echo("<h3 class='entry_title'><meta itemprop='interactionCount' content='0'/>$lng[gallery_comment_count_0]</h3>\n");
+?>
+                                            <h3 class='entry_title'>
+                                                <meta itemprop='interactionCount' content='0'/><?=$lng["gallery_comment_count_0"]?>
+                                            </h3>
+<?php
                                             break;
                                         case 1:
-                                            echo("<h3 class='entry_title'><span itemprop='interactionCount'>1</span> $lng[gallery_comment_count_1]</h3>\n");
+?>
+                                            <h3 class='entry_title'>
+                                                <span itemprop='interactionCount'>1 </span><?=$lng["gallery_comment_count_1"]?>
+                                            </h3>
+<?php
                                             break;
                                         default:
-                                            echo("<h3 class='entry_title'><span itemprop='interactionCount'>$comment_count</span> $lng[gallery_comment_count_several]</h3>\n");
+?>
+                                            <h3 class='entry_title'>
+                                                <span itemprop='interactionCount'><?=$comment_count?></span> <?=$lng["gallery_comment_count_several"]?>
+                                            </h3>
+<?php
                                     }
 ?>
                                 </div> <!-- #photo_viewer_comment_counter -->
                                 <div id='comment_list'>
 <?php
-                                    //WARNING: If changes are done here, do the same in comment.php
                                     while ($r_comment = mysqli_fetch_array($q_comment)){
 ?>
-                                        <div itemprop='comment' itemscope itemtype='http://schema.org/UserComments' id='comment_<?=$r_comment['id']?>' class='comment'>
-                                            <span itemprop='creator' class='comment_user'><?=$r_comment['username']?></span>
-                                            <span class='comment_date date'><meta itemprop='commentTime' content='<?=$r_comment['isodate']?>'/><?=formatDate($r_comment['dtime'], $lang)?></span>
-                                            <p itemprop='commentText' class='comment_text'><?=$r_comment['text']?></p>
+                                        <div itemprop='comment' itemscope itemtype='http://schema.org/UserComments' id='comment_<?=$r_comment["id"]?>' class='comment'>
+                                            <span itemprop='creator' class='comment_user'><?=$r_comment["username"]?></span>
+                                            <span class='comment_date date'><meta itemprop='commentTime' content='<?=$r_comment["isodate"]?>'/><?=formatDate($r_comment["dtime"], $lang)?></span>
+                                            <p itemprop='commentText' class='comment_text'><?=$r_comment["text"]?></p>
                                             <hr class='comment_line'/>
                                         </div>
 <?php
@@ -110,21 +121,22 @@
                                 </div> <!-- #comment_list -->
                                 <!-- Comment form -->
                                 <div class='comment' id='comment_new'>
-                                    <form id='comment_form' method='post' action='/' onsubmit='event.preventDefault();postComment(<?=$r['id']?>, "<?=$lang?>");'>
+                                    <form id='comment_form' method='post' action='/' onsubmit='event.preventDefault();postComment(<?=$r["id"]?>, "<?=$lang?>");'>
                                         <textarea id='new_comment_text' name='text' maxlength='1800' onChange='defaultInputBorder(this);' onKeyDown='defaultInputBorder(this);' placeholder='<?=$lng[blog_placeholder_text]?>'></textarea>
                                         <div id='identification_form'>
                                             <br/>
-                                            <input id='new_comment_user' name='user' maxlength='50' type='text' placeholder='<?=$lng['blog_placeholder_name']?>' onChange='defaultInputBorder(this);' onKeyDown='defaultInputBorder(this);'/>
-                                            <input type='submit' value='<?=$lng['blog_send']?>'/>
+                                            <input id='new_comment_user' name='user' maxlength='50' type='text' placeholder='<?=$lng["blog_placeholder_name"]?>' onChange='defaultInputBorder(this);' onKeyDown='defaultInputBorder(this);'/>
+                                            <input type='submit' value='<?=$lng["blog_send"]?>'/>
                                         </div> <!-- #identification_form -->
                                     </form>
                                 </div> <!-- #comment_new -->
                             </div> <!-- #comments_section -->
-                        <!-- </div>  #cell_details -->
+                        </div> <!-- $photo_viewer_details -->
+                    </div> <!-- #cell_comments -->
+                </div> <!-- #viewer_row -->
+            </div> <!-- #viewer_table -->
+        </div> <!-- #viewer_container -->
 <?php
-        echo "</div>\n"; //Row
-        echo "</div></div>\n"; //Container
-        
         stats(-1, 0, "photo", "$r[id]");
     }
 ?>

+ 37 - 41
www/galeria/save.php

@@ -1,16 +1,16 @@
 <?php
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("../functions.php");
-    $con = startdb('rw');
-    
+    $con = startdb("rw");
+
     //Language
     $lang = selectLanguage();
-    include("../lang/lang_" . $lang . ".php");
-    
+    include("../lang/lang_$lang.php");
+
     //Get post data
     $username = mysqli_real_escape_string($con, $_POST["username"]);
     $album = mysqli_real_escape_string($con, $_POST["album"]);
-        
+
     //Get the data form the photos
     $total = 0;
     $files = [];
@@ -21,33 +21,30 @@
         $img = $_POST["file_$total"];
         error_log("FILE: " . $img);
         //The next line wont work
-        if (strpos($img, 'data:image/jpeg;base64,') < 10){
-            $ext = 'jpg';
-            $img = str_replace('data:image/jpeg;base64,', '', $img);
+        if (strpos($img, "data:image/jpeg;base64,") < 10){
+            $ext = "jpg";
+            $img = str_replace("data:image/jpeg;base64,", "", $img);
         }
-        else if (strpos($img, 'data:image/png;base64,') < 10){
-            $ext = 'png';
-            $img = str_replace('data:image/png;base64,', '', $img);
+        else if (strpos($img, "data:image/png;base64,") < 10){
+            $ext = "png";
+            $img = str_replace("data:image/png;base64,", "", $img);
         }
-        $img = str_replace(' ', '+', $img);
-        //echo "IMG idx " . $total . ": " . $img . "<br/><br/><br/>br/><br/>";
+        $img = str_replace(" ", "+", $img);
         $files[$total] = base64_decode($img);
-        
-        //$file = 'image.png';
-        //$success = file_put_contents($file, $data);
+
         $titles[$total] = mysqli_real_escape_string($con, $_POST["title_$total"]);
         $descriptions[$total] = mysqli_real_escape_string($con, $_POST["description_$total"]);
         //Save image to file
-        $file = 'image.' . $ext;
+        $file = "image." . $ext;
         $success = file_put_contents($file, $files[$total]);
         $total ++;
     }
-    
+
     //Get next photo id
     $q_id = mysqli_query($con, "SELECT max(id) AS maxid FROM photo;");
     $r_id = mysqli_fetch_array($q_id);
     $id = $r_id["maxid"] + 1;
-    
+
     //Store information
     for ($i = 0; $i < $total; $i++){
         //Get filename
@@ -63,27 +60,27 @@
         error_log("SUCCESS" . $success);
         //Convert to jpg and create miniature and preview_image
         //$im = new imagick("../img/galeria/$fname.png");
-        //$handle = fopen("../img/galeria/$fname.png", 'rb');
+        //$handle = fopen("../img/galeria/$fname.png", "rb");
         $im = new Imagick("../img/galeria/$fname.$ext");
-        //$im->readImageFile($handle);
-        $im->setImageBackgroundColor('white');
-        $im = $im->flattenImages();
-        $im->setImageFormat('jpg');
-        $im->writeImage("../img/galeria/$fname.jpg");
-        $im->resizeImage(800, 0, Imagick::FILTER_POINT, true);
-        $im->resizeImage(0, 800, Imagick::FILTER_POINT, true);
-        $im->writeImage("../img/galeria/view/$fname.jpg");
-        $im->resizeImage(600, 0, Imagick::FILTER_POINT, true);
-        $im->resizeImage(0, 600, Imagick::FILTER_POINT, true);
-        $im->writeImage("../img/galeria/preview/$fname.jpg");
-        $im->resizeImage(400, 0, Imagick::FILTER_POINT, true);
-        $im->resizeImage(0, 400, Imagick::FILTER_POINT, true);
-        $im->writeImage("../img/galeria/miniature/$fname.jpg");
-        $im->resizeImage(200, 0, Imagick::FILTER_POINT, true);
-        $im->resizeImage(0, 200, Imagick::FILTER_POINT, true);
-        $im->writeImage("../img/galeria/thumb/$fname.jpg");
-        $im->clear();
-        $im->destroy();
+        //$im -> readImageFile($handle);
+        $im -> setImageBackgroundColor("white");
+        $im = $im -> flattenImages();
+        $im -> setImageFormat("jpg");
+        $im -> writeImage("../img/galeria/$fname.jpg");
+        $im -> resizeImage(800, 0, Imagick::FILTER_POINT, true);
+        $im -> resizeImage(0, 800, Imagick::FILTER_POINT, true);
+        $im -> writeImage("../img/galeria/view/$fname.jpg");
+        $im -> resizeImage(600, 0, Imagick::FILTER_POINT, true);
+        $im -> resizeImage(0, 600, Imagick::FILTER_POINT, true);
+        $im -> writeImage("../img/galeria/preview/$fname.jpg");
+        $im -> resizeImage(400, 0, Imagick::FILTER_POINT, true);
+        $im -> resizeImage(0, 400, Imagick::FILTER_POINT, true);
+        $im -> writeImage("../img/galeria/miniature/$fname.jpg");
+        $im -> resizeImage(200, 0, Imagick::FILTER_POINT, true);
+        $im -> resizeImage(0, 200, Imagick::FILTER_POINT, true);
+        $im -> writeImage("../img/galeria/thumb/$fname.jpg");
+        $im -> clear();
+        $im -> destroy();
         //Delete initial png
         //unlink("../img/galeria/$fname.png");
         //Get width, height ans size
@@ -97,5 +94,4 @@
         version();
         $id ++;
     }
-    
 ?>

+ 70 - 60
www/galeria/upload.php

@@ -1,115 +1,125 @@
 <?php
     session_start();
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("../functions.php");
     $con = startdb();
     $proto = getProtocol();
-    
+    $server = "$proto$http_host";
+
     //Language
     $lang = selectLanguage();
-    include("../lang/lang_" . $lang . ".php");
+    include("../lang/lang_$lang.php");
     
-    $cur_section = $lng['section_gallery'];
+    $cur_section = $lng["section_gallery"];
     
-    //TODO: Set metadata
 ?>
 <!DOCTYPE html>
 <html>
     <head>
-        <meta content="text/html; charset=utf-8" http-equiv="content-type"/>
+        <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><?php echo $lng['gallery_title'];?> - Gasteizko Margolariak</title>
-        <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
+        <meta name='viewport' content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1">
+        <title><?=$lng["gallery_title"]?> - Gasteizko Margolariak</title>
+        <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico";?>">
         <!-- CSS files -->
         <style>
-            <?php 
-                include("../css/ui.css"); 
-                include("../css/galeria.css");
-            ?>
+<?php 
+            include("../css/ui.css"); 
+            include("../css/galeria.css");
+?>
         </style>
         <!-- CSS for mobile version -->
         <style media="(max-width : 990px)">
-            <?php 
-                include("../css/m/ui.css"); 
-                include("../css/m/galeria.css");
-            ?>
+<?php 
+            include("../css/m/ui.css"); 
+            include("../css/m/galeria.css");
+?>
         </style>
         <!-- Script files -->
         <script type="text/javascript">
-            <?php
-                include("../script/ui.js");
-                include("../script/galeria.js");
-            ?>
+<?php
+            include("../script/ui.js");
+            include("../script/galeria.js");
+?>
         </script>
         <!-- Meta tags -->
-        <link rel="canonical" href="<?php echo "$proto$http_host"; ?>"/>
-        <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
-        <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
-        <meta name="description" content="<?php echo $lng['gallery_description'];?>"/>
-        <meta property="og:title" content="<?php echo $lng['gallery_title'];?> - Gasteizko Margolariak"/>
-        <meta property="og:url" content="<?php echo "$proto$http_host"; ?>"/>
-        <meta property="og:description" content="<?php echo $lng['gallery_description'];?>"/>
-        <meta property="og:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta property="og:site_name" content="<?php echo $lng['gallery_title'];?>"/>
-        <meta property="og:type" content="website"/>
-        <meta property="og:locale" content="<?php echo $lang; ?>"/>
-        <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" content="<?php echo $lng['gallery_title'];?> - Gasteizko Margolariak"/>
-        <meta name="twitter:description" content="<?php echo $lng['gallery_description'];?>"/>
-        <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta name="twitter:url" content="<?php echo"$proto$http_host"; ?>"/>
-        <meta name="robots" content="noindex nofollow"/>
+        <link rel='canonical' href='<?=$server?>'/>
+        <link rel='author' href='<?=$server?>'/>
+        <link rel='publisher' href='<?=$server?>'/>
+        <meta name='description' content='<?=$lng["gallery_description"]?>'/>
+        <meta property='og:title' content='<?=$lng["gallery_title"]?> - Gasteizko Margolariak'/>
+        <meta property='og:url' content='<?=$server?>'/>
+        <meta property='og:description' content='<?=$lng["gallery_description"]?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta property='og:site_name' content='<?=$lng["gallery_title"]?>'/>
+        <meta property='og:type' content='website'/>
+        <meta property='og:locale' content='<?php echo $lang; ?>'/>
+        <meta name='twitter:card' content='summary'/>
+        <meta name='twitter:title' content='<?=$lng["gallery_title"]?> - Gasteizko Margolariak'/>
+        <meta name='twitter:description' content='<?=$lng["gallery_description"]?>'/>
+        <meta name='twitter:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta name='twitter:url' content='<?=$server?>'/>
+        <meta name='robots' content='noindex nofollow'/>
     </head>
     <body>
-        <?php include("../header.php"); ?>
-        <div id="content">
-            <form onSubmit="event.preventDefault(); submitPhotos();">
-                <div class="section">
-                    <h3 class="section_title"><?php echo($lng['gallery_upload_submit']); ?></h3>
-                    <div class="entry">
-                        <?php echo $lng["gallery_upload_header"]; ?>
+<?php
+        include("../header.php");
+?>
+        <div id='content'>
+            <form onSubmit='event.preventDefault(); submitPhotos();'>
+                <div class='section'>
+                    <h3 class='section_title'><?=$lng["gallery_upload_submit"]?></h3>
+                    <div class='entry'>
+                        <?=$lng["gallery_upload_header"]?>
                     </div>
                 
-                    <div id="file_box" ondragover="event.preventDefault();" ondrop="dropFile(event, '<?php echo $lng['gallery_upload_placeholder_title'] ?>', '<?php echo $lng['gallery_upload_placeholder_description'] ?>');">
+                    <div id='file_box' ondragover='event.preventDefault();' ondrop='dropFile(event, "<?=$lng["gallery_upload_placeholder_title"]?>", "<?=$lng["gallery_upload_placeholder_description"]?>");'>
                         <br/><br/><br/>
-                        <span id='drag'><?php echo $lng["gallery_upload_drag"]; ?></span>
-                        <input class='hidden' multiple accept='image/x-png, image/gif, image/jpeg' type='file' id='file_selector' onChange="selectFile(event, this, '<?php echo $lng['gallery_upload_placeholder_title'] ?>', '<?php echo $lng['gallery_upload_placeholder_description'] ?>');"/>
+                        <span id='drag'><?=$lng["gallery_upload_drag"]?></span>
+                        <input class='hidden' multiple accept='image/x-png, image/gif, image/jpeg' type='file' id='file_selector' onChange='selectFile(event, this, "<?=$lng["gallery_upload_placeholder_title"]?>", "<?=$lng["gallery_upload_placeholder_description"]?>");'/>
                         <br/><br/>
-                        <span id='select' class='desktop'><a href='javascript:launchFileSelector();'><?php echo $lng["gallery_upload_select"];?></a></span>
+                        <span id='select' class='desktop'>
+                            <a href='javascript:launchFileSelector();'><?=$lng["gallery_upload_select"]?></a>
+                        </span>
                         <br/><br/><br/>
                     </div>
                     
-                    <div  id="photo_upload_preview">
-                        <div id="file_list">
+                    <div  id='photo_upload_preview'>
+                        <div id='file_list'>
                         </div>
                         <table>
                             <tr>
                                 <td class='entry'>
-                                    <?php echo $lng["gallery_upload_tooltip_album"]; ?>
+                                    <?=$lng["gallery_upload_tooltip_album"]?>
                                     <br/><br/>
-                                    <select id="album" type="select">
-                                        <option value="-1" selected="selected"><?php echo $lng['gallery_upload_select_album'] ?></option>
-                                        <?php
+                                    <select id='album' type='select'>
+                                        <option value="-1" selected='selected'>
+                                            <?=$lng["gallery_upload_select_album"]?>
+                                        </option>
+<?php
                                             $q_album = mysqli_query($con, "SELECT id, title_$lang AS title FROM album ORDER BY title;");
                                             while ($r_album = mysqli_fetch_array($q_album)){
-                                                echo "<option value='$r_album[id]'>$r_album[title]</option>\n";
+?>                                                
+                                                <option value='<?=$r_album["id"]?>'><?=$r_album[title]?></option>
+<?php
                                             }
-                                        ?>
+?>
                                     </select>
                                 </td>
                                 <td class='entry'>
-                                    <?php echo $lng["gallery_upload_tooltip_name"]; ?>
+                                    <?=$lng["gallery_upload_tooltip_name"]?>
                                     <br/><br/>
                                     <input type='text' id='username'/>
                                 </td>
                             </tr>
                         </table>
-                        <input type="submit" id="photo_submit" value="<?php echo $lng["gallery_upload_submit"];?>">
+                        <input type="submit" id='photo_submit' value="<?=$lng["gallery_upload_submit"]?>">
                     </div>
                 </div>
             </form>
         </div>
-        <?php include("../footer.php"); ad($con, $lang, $lng); ?>
+<?php
+        include("../footer.php");
+?>
     </body>
 </html>

+ 180 - 152
www/index.php

@@ -1,6 +1,6 @@
 <?php
     session_start();
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("functions.php");
     $proto = getProtocol();
     $con = startdb();
@@ -10,7 +10,7 @@
     $lang = selectLanguage();
     include("lang/lang_" . $lang . ".php");
 
-    $cur_section = $lng['section_home'];
+    $cur_section = $lng["section_home"];
 ?>
 <!DOCTYPE html>
 <html>
@@ -18,7 +18,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']?></title>
+        <title><?=$lng["index_title"]?></title>
         <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico"/>
         <!-- CSS files -->
         <style>
@@ -42,23 +42,25 @@
         <link rel="canonical" href="<?=$server?>"/>
         <link rel="author" href="<?=$server?>"/>
         <link rel="publisher" href="<?=$server?>"/>
-        <meta name="description" content="<?php echo $lng['index_us_content'];?>"/>
-        <meta property="og:title" content="<?php echo $lng['index_title'];?>"/>
+        <meta name="description" content="<?php echo $lng["index_us_content"];?>"/>
+        <meta property="og:title" content="<?php echo $lng["index_title"];?>"/>
         <meta property="og:url" content="<?=$server?>"/>
-        <meta property="og:description" content="<?=$lng['index_us_content']?>"/>
+        <meta property="og:description" content="<?=$lng["index_us_content"]?>"/>
         <meta property="og:image" content="<?=$server?>/img/logo/logo.png"/>
-        <meta property="og:site_name" content="<?=$lng['index_title']?>"/>
+        <meta property="og:site_name" content="<?=$lng["index_title"]?>"/>
         <meta property="og:type" content="website"/>
         <meta property="og:locale" content="<?php echo $lang; ?>"/>
         <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" content="<?=$lng['index_title']?>"/>
-        <meta name="twitter:description" content="<?=$lng['index_us_content']?>"/>
+        <meta name="twitter:title" content="<?=$lng["index_title"]?>"/>
+        <meta name="twitter:description" content="<?=$lng["index_us_content"]?>"/>
         <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
         <meta name="twitter:url" content="<?=$server?>"/>
         <meta name="robots" content="index follow"/>
     </head>
     <body>
-        <?php include("header.php"); ?>
+<?php
+        include("header.php");
+?>
         <div id="content">
 
 <?php
@@ -68,9 +70,9 @@
                     $r_location = mysqli_fetch_array($q_location);
 ?>
                     <div class='section' id='location'>
-                    <h3 class='section_title'><?=$lng[index_festivals_location]?></h3>
+                    <h3 class='section_title'><?=$lng["index_festivals_location"]?></h3>
                         <div class='entry' id='map'>
-                            <iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=<?=$r_location[lat]?>,<?=$r_location[lon]?>' allowfullscreen></iframe>
+                            <iframe src='https://www.google.com/maps/embed/v1/place?key=AIzaSyCZHP7t2on_G3eyyoCTfhGAlDx1mJnX7iI&q=<?=$r_location["lat"]?>,<?=$r_location["lon"]?>' allowfullscreen></iframe>
                         </div>
                     </div>
 <?php
@@ -80,7 +82,7 @@
                 $year = date("Y");
                 $q_settings = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
                 $r_settings = mysqli_fetch_array($q_settings);
-                $festivals = $r_settings['value'];
+                $festivals = $r_settings["value"];
                 if ($festivals == 1){
 ?>
                     <div class='section' id='festivals' itemscope itemtype='http://schema.org/Event'>
@@ -93,8 +95,8 @@
                         </div> <!-- .hidden -->
 
                         <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                        <meta itemprop='name' content='<?=$lng['index_festivals_header']?> <?=$year?>'/>
-                        <meta itemprop='description' content='<?=$lng['index_festivals_header']?> <?=$year?>'/>
+                        <meta itemprop='name' content='<?=$lng["index_festivals_header"]?> <?=$year?>'/>
+                        <meta itemprop='description' content='<?=$lng["index_festivals_header"]?> <?=$year?>'/>
                         <meta itemprop='startDate' content='<?=$year?>-08-04'/>
                         <meta itemprop='endDate' content='<?=$year?>-08-09'/>
                         <meta itemprop='url' content='<?=$server?>/lablanca/'/>
@@ -102,7 +104,7 @@
                             <meta itemprop='name' content='Vitoria-Gasteiz'/>
                             <meta itemprop='address' content='Vitoria-Gasteiz'/>
                         </span>
-                        <h3 class='section_title'><?=$lng['index_festivals_header']?> <?=$year?></h3>
+                        <h3 class='section_title'><?=$lng["index_festivals_header"]?> <?=$year?></h3>
                         <div class='entry' id='festivals_summary'>
 <?php
                             // Offers (for metadata)
@@ -110,9 +112,9 @@
                             while($r_offer = mysqli_fetch_array($q_offer)){
 ?>
                                 <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
-                                    <meta itemprop='name' content='<?=$r_offer['name']?>'/>
-                                    <meta itemprop='description' content='<?=$r_offer['description']?>'/>
-                                    <meta itemprop='price' content='<?=$r_offer['price']?>'/>
+                                    <meta itemprop='name' content='<?=$r_offer["name"]?>'/>
+                                    <meta itemprop='description' content='<?=$r_offer["description"]?>'/>
+                                    <meta itemprop='price' content='<?=$r_offer["price"]?>'/>
                                     <meta itemprop='priceCurrency' content='EUR'/>
                                     <meta itemprop='url' content='<?=$server?>/lablanca/'/>
                                     <meta itemprop='availability' content='Sold Out'/>
@@ -124,25 +126,25 @@
                             $q_festivals = mysqli_query($con, "SELECT text_$lang AS text, summary_$lang AS summary, img FROM festival WHERE year = $year;");
                             if(mysqli_num_rows($q_festivals)){
                                 $r_festivals = mysqli_fetch_array($q_festivals);
-                                if ($r_festivals['img'] != ''){
+                                if ($r_festivals["img"] != ''){
 ?>
-                                    <meta itemprop='image' content='<?=$server?>/img/fiestas/view/<?=$r_festivals['img']?>'/>
-                                    <img id='festivals_image' alt='<?=$lng['index_festivals_header'] . ' ' . $year?>' src='<?=$server?>/img/fiestas/preview/<?=$r_festivals['img']?>'/>
+                                    <meta itemprop='image' content='<?=$server?>/img/fiestas/view/<?=$r_festivals["img"]?>'/>
+                                    <img id='festivals_image' alt='<?=$lng["index_festivals_header"]?> <?=$year?>' src='<?=$server?>/img/fiestas/preview/<?=$r_festivals["img"]?>'/>
 <?php
                                 }
-                                if ($r_festivals['summary'] != ''){
+                                if ($r_festivals["summary"] != ''){
 ?>
-                                    <br/><span class='entry_title' id='festivals_summary_text'><?=$r_festivals['summary']?></span>
+                                    <br/><span class='entry_title' id='festivals_summary_text'><?=$r_festivals["summary"]?></span>
                                     <br/><br/><br/>
-                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='<?=$server?>/lablanca/'><?=$lng['index_festivals_link']?></a>
+                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href='<?=$server?>/lablanca/'><?=$lng["index_festivals_link"]?></a>
 <?php
                                 }
                                 else{
 ?>
                                     <span id='festivals_summary_text'>
                                         <br/>
-                                        <span class='mobile'><?=cutText($r_festivals['text'], 300, "$lng[index_read_more]", "$server/lablanca/")?></span>
-                                        <span class='desktop'><?=cutText($r_festivals['text'], 500, "$lng[index_read_more]", "$server/lablanca/")?></span>
+                                        <span class='mobile'><?=cutText($r_festivals["text"], 300, "$lng[index_read_more]", "$server/lablanca/")?></span>
+                                        <span class='desktop'><?=cutText($r_festivals["text"], 500, "$lng[index_read_more]", "$server/lablanca/")?></span>
                                     </span>
 <?php
                                 }
@@ -159,7 +161,7 @@
                                     if (mysqli_num_rows($q_sch_curr) > 0 || mysqli_num_rows($q_sch_next) > 0){
 ?>
                                         <div class='entry festival_schedule' id='festivals_gm'>
-                                            <h3 class='entry_title'><?=$lng['index_festivals_gm_schedule']?></h3>
+                                            <h3 class='entry_title'><?=$lng["index_festivals_gm_schedule"]?></h3>
 <?php
                                         if (mysqli_num_rows($q_sch_curr) > 0){
                                             $r_sch_curr = mysqli_fetch_array($q_sch_curr);
@@ -167,47 +169,47 @@
                                             <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
                                                 <h4><?=$lng[index_festivals_schedule_now]?></h4>
                                                 <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                                                <meta itemprop='name' content='<?=$r_sch_curr['title']?>'/>
-                                                <meta itemprop='startDate' content='<?=$r_sch_curr['isostart']?>'/>
+                                                <meta itemprop='name' content='<?=$r_sch_curr["title"]?>'/>
+                                                <meta itemprop='startDate' content='<?=$r_sch_curr["isostart"]?>'/>
                                                 <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
                                                     <meta itemprop='address' content='Vitoria-Gasteiz'/>
                                                 </span>
 <?php
-                                                if (strlen($r_sch_curr['isoend']) > 0){
+                                                if (strlen($r_sch_curr["isoend"]) > 0){
 ?>
-                                                    <meta itemprop='endDate' content='<?=$r_sch_curr['isoend']?>'/>
+                                                    <meta itemprop='endDate' content='<?=$r_sch_curr["isoend"]?>'/>
 <?php
                                                 }
 ?>
                                                 <div class='schedule_content'>
-                                                    <span class='title'><?=$r_sch_curr['title']?></span>
+                                                    <span class='title'><?=$r_sch_curr["title"]?></span>
 <?php
                                                     if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
 ?>
-                                                        <br/><p class='description'><?=$r_sch_curr['description']?></p>
-                                                        <meta itemprop='description' content='<?=$r_sch_curr['description']?>'/>
+                                                        <br/><p class='description'><?=$r_sch_curr["description"]?></p>
+                                                        <meta itemprop='description' content='<?=$r_sch_curr["description"]?>'/>
 <?php
                                                     }
 ?>
                                                     <table class='location'>
                                                         <tr>
                                                             <td>
-                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr[lat]?>,<?=$r_sch_curr[lon]?>+Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_curr[lat]?>,<?=$r_sch_curr[lon]?>'>
-                                                                    <img alt='<?=$r_sch_curr['title']?>'' src='<?server?>/img/misc/pinpoint.png'/>
+                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>+Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>'>
+                                                                    <img alt='<?=$r_sch_curr["title"]?>'' src='<?=$server?>/img/misc/pinpoint.png'/>
                                                                 </a>
                                                             </td>
                                                             <td>
 <?php
                                                                 //If name and address are the same, show only name
-                                                                if ($r_sch_curr['place'] == $r_sch_curr['address']){
+                                                                if ($r_sch_curr["place"] == $r_sch_curr["address"]){
 ?>
-                                                                    <?=$r_sch_curr['place']?>
+                                                                    <?=$r_sch_curr["place"]?>
 <?php
                                                                 }
                                                                 else{
 ?>
-                                                                    <?=$r_sch_curr['place']?><br/>
-                                                                    <span class='address'><?=$r_sch_curr['address']?></span>
+                                                                    <?=$r_sch_curr["place"]?><br/>
+                                                                    <span class='address'><?=$r_sch_curr["address"]?></span>
 <?php
                                                                 }
 ?>
@@ -222,45 +224,49 @@
                                             $r_sch_next = mysqli_fetch_array($q_sch_next);
 ?>
                                             <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
-                                                <h4><?=$lng['index_festivals_schedule_next']?></h4>
+                                                <h4><?=$lng["index_festivals_schedule_next"]?></h4>
                                                 <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                                                <meta itemprop='name' content='<?=$r_sch_next['title']?>'/>
-                                                <meta itemprop='startDate' content='<?=$r_sch_next['isostart']?>'/>
+                                                <meta itemprop='name' content='<?=$r_sch_next["title"]?>'/>
+                                                <meta itemprop='startDate' content='<?=$r_sch_next["isostart"]?>'/>
                                                 <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
                                                     <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
                                                 </span>
 <?php
-                                                if (strlen($r_sch_curr['isoend']) > 0){
+                                                if (strlen($r_sch_curr["isoend"]) > 0){
 ?>
-                                                    <meta itemprop='endDate' content='<?=$r_sch_next['isoend']?>'/>
+                                                    <meta itemprop='endDate' content='<?=$r_sch_next["isoend"]?>'/>
 <?php
                                                 }
 ?>
                                                 <div class='schedule_content'>
-                                                    <span class='title'><?=$r_sch_next['title']?> - <?=$r_sch_next['st']?></span>
+                                                    <span class='title'><?=$r_sch_next["title"]?> - <?=$r_sch_next["st"]?></span>
 <?php
                                                     if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
 ?>
-                                                        <br/><p class='description'><?=$r_sch_next['description']?></p>
-                                                        <meta itemprclass='entry'op='description' content='<?=$r_sch_next['description']?>'/>
+                                                        <br/><p class='description'><?=$r_sch_next["description"]?></p>
+                                                        <meta itemprclass='entry' itemprop='description' content='<?=$r_sch_next["description"]?>'/>
 <?php
                                                     }
 ?>
                                                     <table class='location'>
                                                         <tr>
                                                             <td>
-                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_next[lat]?>,<?=$r_sch_next[lon]?>+(My+Point)&z=14&ll=<?=$r_sch_next[lat]?>,<?=$r_sch_next[lon]?>'>
+                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>+(Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>'>
                                                                     <img alt=' ' src='<?=server?>/img/misc/pinpoint.png'/>
                                                                 </a>
                                                             </td>
                                                             <td>
 <?php
                                                                 //If name and address are the same, show only name
-                                                                if ($r_sch_next['place'] == $r_sch_next['address']){
-                                                                    echo("$r_sch_next[place]\n");
+                                                                if ($r_sch_next["place"] == $r_sch_next["address"]){
+?>
+                                                                    <?$r_sch_next["place"]?>
+<?php
                                                                 }
                                                                 else{
-                                                                    echo("$r_sch_next[place] </br><span class='address'> $r_sch_next[address]</span>\n");
+?>
+                                                                    <?=$r_sch_next["place"]?> </br><span class='address'> <?=$r_sch_next["address"]?></span>
+<?php
                                                                 }
 ?>
                                                             </td>
@@ -288,41 +294,52 @@
                                             $r_sch_curr = mysqli_fetch_array($q_sch_curr);
 ?>
                                             <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
-                                                <h4><?=$lng['index_festivals_schedule_now']?></h4>
+                                                <h4><?=$lng["index_festivals_schedule_now"]?></h4>
                                                 <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                                                <meta itemprop='name' content='<?=$r_sch_curr['title']?>'/>
-                                                <meta itemprop='startDate' content='<?=$r_sch_curr['isostart']?>'/>
+                                                <meta itemprop='name' content='<?=$r_sch_curr["title"]?>'/>
+                                                <meta itemprop='startDate' content='<?=$r_sch_curr["isostart"]?>'/>
                                                 <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
                                                     <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
                                                 </span>
 <?php
-                                                if (strlen($r_sch_curr['isoend']) > 0){
-                                                    echo("<meta itemprop='endDate' content='$r_sch_curr[isoend]'/>\n");
+                                                if (strlen($r_sch_curr["isoend"]) > 0){
+?>
+                                                    <meta itemprop='endDate' content='<?=$r_sch_curr["isoend"]?>'/>
+<?php
                                                 }
 ?>
                                                 <div class='schedule_content'>
-                                                    <span class='title'><?=$r_sch_curr['title']?></span>
+                                                    <span class='title'><?=$r_sch_curr["title"]?></span>
 <?php
                                                     if (strlen($r_sch_curr["description"]) > 0 && $r_sch_curr["description"] != $r_sch_curr["title"]){
-                                                        echo("<br/><p class='description'>$r_sch_curr[description]</p>\n");
-                                                        echo("<meta itemprop='description' content='$r_sch_curr[description]'/>\n");
+?>
+                                                        <br/>
+                                                        <p class='description'><?=$r_sch_curr["description"]?></p>
+                                                        <meta itemprop='description' content='<?=$r_sch_curr["description"]?>'/>
+<?php
                                                     }
 ?>
                                                     <table class='location'>
                                                         <tr>
                                                             <td>
-                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr[lat]?>,<?=$r_sch_curr[lon]?>+(My+Point)&z=14&ll=<?=$r_sch_curr[lat]?>,<?=$r_sch_curr[lon]?>'>
+                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>+(Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_curr["lat"]?>,<?=$r_sch_curr["lon"]?>'>
                                                                     <img alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
                                                                 </a>
                                                             </td>
                                                             <td>
 <?php
                                                                 //If name and address are the same, show only name
-                                                                if ($r_sch_curr['place'] == $r_sch_curr['address']){
-                                                                    echo("$r_sch_curr[place]\n");
+                                                                if ($r_sch_curr["place"] == $r_sch_curr["address"]){
+?>
+                                                                    <?=$r_sch_curr["place"]?>
+<?php
                                                                 }
                                                                 else{
-                                                                    echo("$r_sch_curr[place] <br/><span class='address'> $r_sch_curr[address]</span>\n");
+?>
+                                                                    <?=$r_sch_curr["place"]?>
+                                                                    <br/>
+                                                                    <span class='address'> <?=$r_sch_curr["address"]?></span>
+<?php
                                                                 }
 ?>
                                                             </td>
@@ -336,41 +353,52 @@
                                             $r_sch_next = mysqli_fetch_array($q_sch_next);
 ?>
                                             <div class='festival_event' itemprop='subEvent' itemscope itemtype='http://schema.org/Event'>
-                                                <h4><?=$lng['index_festivals_schedule_next']?></h4>
+                                                <h4><?=$lng["index_festivals_schedule_next"]?></h4>
                                                 <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                                                <meta itemprop='name' content='<?=$r_sch_next['title']?>'/>
-                                                <meta itemprop='startDate' content='<?=$r_sch_next['isostart']?>'/>
+                                                <meta itemprop='name' content='<?=$r_sch_next["title"]?>'/>
+                                                <meta itemprop='startDate' content='<?=$r_sch_next["isostart"]?>'/>
                                                 <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
                                                     <meta itemprop='address' itemprop='name'>Vitoria-Gasteiz</meta>
                                                 </span>
 <?php
-                                                if (strlen($r_sch_curr['isoend']) > 0){
-                                                    echo "<meta itemprop='endDate' content='$r_sch_next[isoend]'/>\n";
+                                                if (strlen($r_sch_curr["isoend"]) > 0){
+?>
+                                                    <meta itemprop='endDate' content='<?=$r_sch_next["isoend"]?>'/>
+<?php
                                                 }
 ?>
                                                 <div class='schedule_content'>
-                                                    <span class='title'><?=$r_sch_next['title']?> - <?=$r_sch_next['st']?></span>
+                                                    <span class='title'><?=$r_sch_next["title"]?> - <?=$r_sch_next["st"]?></span>
 <?php
                                                     if (strlen($r_sch_next["description"]) > 0 && $r_sch_next["description"] != $r_sch_next["title"]){
-                                                        echo "<br/><p class='description'>$r_sch_next[description]</p>\n";
-                                                        echo "<meta itemprop='description' content='$r_sch_next[description]'/>\n";
+?>
+                                                        <br/>
+                                                        <p class='description'><?=$r_sch_next["description"]?></p>
+                                                        <meta itemprop='description' content='<?=$r_sch_next["description"]?>'/>
+<?php
                                                     }
 ?>
                                                     <table class='location'>
                                                         <tr>
                                                             <td>
-                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_next[lat]?>,<?=$r_sch_next[lon]?>+(My+Point)&z=14&ll=<?=$r_sch_next[lat]?>,<?=$r_sch_next[lon]?>'>
+                                                                <a target='_blank' href='http://maps.google.com/maps?q=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>+(Gasteizko+Margolariak)&z=14&ll=<?=$r_sch_next["lat"]?>,<?=$r_sch_next["lon"]?>'>
                                                                     <img alt=' ' src='<?=$server?>/img/misc/pinpoint.png'/>
                                                                 </a>
                                                             </td>
                                                             <td>
 <?php
                                                                 //If name and address are the same, show only name
-                                                                if ($r_sch_next['place'] == $r_sch_next['address']){
-                                                                    echo("$r_sch_next[place]\n");
+                                                                if ($r_sch_next["place"] == $r_sch_next["address"]){
+?>                                                                
+                                                                    <?=$r_sch_next["place"]?>
+<?php
                                                                 }
                                                                 else{
-                                                                    echo("$r_sch_next[place] <br/><span class='address'> $r_sch_next[address]</span>\n");
+?>
+                                                                    <?=$r_sch_next["place"]?>
+                                                                    <br/>
+                                                                    <span class='address'> <?=$r_sch_next["address"]?></span>
+<?php
                                                                 }
 ?>
                                                             </td>
@@ -400,19 +428,19 @@
                     $upcoming_activity_shown = true;
 ?>
                     <div class='section'>
-                        <h3 class='section_title'><?=$lng['index_upcoming_activity']?></h3>
+                        <h3 class='section_title'><?=$lng["index_upcoming_activity"]?></h3>
 <?php
                         while($r_activity = mysqli_fetch_array($q_activity)){
 ?>
                             <div class='entry' itemscope itemtype='http://schema.org/Event'>
                                 <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                                <meta itemprop='name' content='<?=$r_activity['title']?>'/>
-                                <meta itemprop='description' content='<?=$r_activity['text']?>'/>
-                                <meta itemprop='startDate endDate' content='<?=$r_activity['isodate']?>'/>
+                                <meta itemprop='name' content='<?=$r_activity["title"]?>'/>
+                                <meta itemprop='description' content='<?=$r_activity["text"]?>'/>
+                                <meta itemprop='startDate endDate' content='<?=$r_activity["isodate"]?>'/>
                                 <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
-                                    <meta itemprop='address' itemprop='name' content='=<?=$r_activity[city]?>'/>
+                                    <meta itemprop='address' itemprop='name' content='=<?=$r_activity["city"]?>'/>
                                 </span>
-                                <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
+                                <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'/>
                                 <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
                                     <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
                                     <meta itemprop='name' content='Gasteizko Margolariak'/>
@@ -430,9 +458,9 @@
 ?>
                                             <div class='td'>
                                                 <div id='upcoming_image'>
-                                                    <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'>
-                                                        <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image['image']?>'/>
-                                                        <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image['image']?>' alt='<?=$r_activity['title']?>'/>
+                                                    <a href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'>
+                                                        <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image["image"]?>'/>
+                                                        <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image["image"]?>' alt='<?=$r_activity["title"]?>'/>
                                                     </a>
                                                 </div> <!-- #upcoming_image -->
                                             </div> <!-- .td-->
@@ -442,72 +470,72 @@
                                         <div class='td'>
                                             <div id='upcoming_text'>
                                                 <h3 class='entry_title'>
-                                                    <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$r_activity['title']?></a>
+                                                    <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'><?=$r_activity["title"]?></a>
                                                 </h3>
-                                                <p class='mobile'><?=cutText($r_activity['text'], 250, $lng['index_read_more'], "$server/actividades/$r_activity[permalink]")?></p>
-                                                <p class='desktop'><?=cutText($r_activity['text'], 450, $lng['index_read_more'], "$server/actividades/$r_activity[permalink]")?></p>
+                                                <p class='mobile'><?=cutText($r_activity["text"], 250, $lng["index_read_more"], "$server/actividades/$r_activity[permalink]")?></p>
+                                                <p class='desktop'><?=cutText($r_activity["text"], 450, $lng["index_read_more"], "$server/actividades/$r_activity[permalink]")?></p>
                                             </div> <!-- #upcoming_text -->
                                         </div> <!-- .td -->
                                         <div class='td'>
                                             <div id='upcoming_details'>
                                                 <table>
                                                     <tr>
-                                                        <td><?=$lng['index_upcoming_activity_date']?></td>
-                                                        <td><?=formatDate($r_activity['date'], $lang, false)?></td>
+                                                        <td><?=$lng["index_upcoming_activity_date"]?></td>
+                                                        <td><?=formatDate($r_activity["date"], $lang, false)?></td>
                                                     </tr>
                                                     <tr>
-                                                        <td><?=$lng['index_upcoming_activity_price']?></td>
+                                                        <td><?=$lng["index_upcoming_activity_price"]?></td>
 <?php
-                                                        if ($r_activity['price'] == 0){
+                                                        if ($r_activity["price"] == 0){
 ?>
                                                             <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
-                                                                <?=$lng['index_upcoming_activity_free']?>
+                                                                <?=$lng["index_upcoming_activity_free"]?>
                                                                 <meta itemprop='priceCurrency' content='EUR'/>
                                                                 <meta itemprop='price' content='0'/>
                                                                 <meta itemprop='availability' content='Sold Out'/>
-                                                                <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
-                                                                <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
+                                                                <meta itemprop='validfrom' content='<?=$r_activity["isodate"]?>'/>
+                                                                <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'/>
                                                             </td>
                                                         </tr>
                                                         <tr>
-                                                            <td><?=$lng['index_upcoming_activity_inscription']?></td>
+                                                            <td><?=$lng["index_upcoming_activity_inscription"]?></td>
 <?php
-                                                            if ($r_activity['inscription'] == 1){
+                                                            if ($r_activity["inscription"] == 1){
 ?>
-                                                                <td><?=$lng['yes']?></td>
+                                                                <td><?=$lng["yes"]?></td>
 <?php
                                                             }
                                                             else{
 ?>
-                                                                <td><?=$lng['no']?></td>
+                                                                <td><?=$lng["no"]?></td>
 <?php
                                                             }
                                                         }
                                                         else{
 ?>
                                                             <td itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
-                                                                <?=$r_activity['price']?> €
+                                                                <?=$r_activity["price"]?> €
                                                                     <meta itemprop='priceCurrency' content='EUR'/>
                                                                     <meta itemprop='availability' content='Sold Out'/>
-                                                                    <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
-                                                                    <meta itemprop='price' content='<?=$r_activity['price']?>'/>
+                                                                    <meta itemprop='validfrom' content='<?=$r_activity["isodate"]?>'/>
+                                                                    <meta itemprop='price' content='<?=$r_activity["price"]?>'/>
                                                             </td>
 <?php
                                                         }
 ?>
                                                     </tr>
 <?php
-                                                    if ($r_activity['max_people'] > 0){
+                                                    if ($r_activity["max_people"] > 0){
 ?>
                                                         <tr>
-                                                            <td><?=$lng['index_upcoming_activity_max_people']?></td>
-                                                            <td><?=$r_activity['max_people']?></td>
+                                                            <td><?=$lng["index_upcoming_activity_max_people"]?></td>
+                                                            <td><?=$r_activity["max_people"]?></td>
                                                         </tr>
 <?php
                                                     }
 ?>
                                                 </table>
-                                                <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$lng['index_upcoming_activity_see']?></a>
+                                                <a href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'><?=$lng["index_upcoming_activity_see"]?></a>
                                                <br/><br/>
                                             </div> <!-- #upcoming_details -->
                                         </div> <!-- .td -->
@@ -517,7 +545,7 @@
 <?php
                         } // while($r_activity = mysqli_fetch_array($q_activity))
 ?>
-                        <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng['index_upcoming_activity_see_all']?></a>
+                        <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng["index_upcoming_activity_see_all"]?></a>
                         <br/>
                     </div> <!-- .section -->
 <?php
@@ -525,11 +553,11 @@
 ?>
                 <div class='section' itemscope itemtype='http://schema.org/Organization'>
                     <meta itemprop='url' content='<?=$server?>'/>
-                    <h3 class='section_title' itemprop='name'><?=$lng['index_us']?></h3>
+                    <h3 class='section_title' itemprop='name'><?=$lng["index_us"]?></h3>
                     <div class='entry' id='us'>
-                        <p itemprop='description'><?=$lng['index_us_content']?></p>
+                        <p itemprop='description'><?=$lng["index_us_content"]?></p>
                     </div> <!-- .entry -->
-                    <a class='go_to_section' href='<?=$server?>/nosotros/'><?=$lng['index_us_more']?></a>
+                    <a class='go_to_section' href='<?=$server?>/nosotros/'><?=$lng["index_us_more"]?></a>
                     </br>
                 </div> <!-- .section -->
 								<br/>
@@ -537,13 +565,13 @@
                 <div class='content_row'>
                     <div class='content_cell' id='cell_posts'>
                         <div class='section' id='latest_posts'>
-                            <h3 class='section_title'><?=$lng['index_latest_posts']?></h3>
+                            <h3 class='section_title'><?=$lng["index_latest_posts"]?></h3>
 <?php
                                 $q_post = mysqli_query($con, "SELECT id, permalink, title_$lang AS title, text_$lang AS text, dtime, DATE_FORMAT(dtime, '%Y-%m-%dT%T') AS isodate FROM post WHERE visible = 1 ORDER BY dtime DESC LIMIT 2;");
                                 if (mysqli_num_rows($q_post) == 0){
 ?>
                                     <div class='entry'>
-                                        <h3 class='entry_title'><?=$lng['index_no_post']?></h3>
+                                        <h3 class='entry_title'><?=$lng["index_no_post"]?></h3>
                                     </div>
 <?php
                                 }
@@ -569,24 +597,24 @@
                                             if (mysqli_num_rows($q_post_image) > 0){
                                                 $r_post_image = mysqli_fetch_array($q_post_image);
 ?>
-                                                <a href='<?=$server?>/blog/<?=$r_post['permalink']?>'>
-                                                    <img itemprop='image' src='<?=$server?>/img/blog/miniature/<?=$r_post_image['image']?>'/>
+                                                <a href='<?=$server?>/blog/<?=$r_post["permalink"]?>'>
+                                                    <img itemprop='image' src='<?=$server?>/img/blog/miniature/<?=$r_post_image["image"]?>'/>
                                                 </a>
 <?php
                                             } //if (mysqli_num_rows($q_post_image) > 0)
 ?>
                                             <h3 class='entry_title'>
-                                                <a itemprop='url' href='<?=$server?>/blog/<?=$r_post['permalink']?>'><?=$r_post['title']?></a>
+                                                <a itemprop='url' href='<?=$server?>/blog/<?=$r_post["permalink"]?>'><?=$r_post["title"]?></a>
                                             </h3>
-                                            <p class='mobile'><?=cutText($r_post['text'], 100, $lng['index_read_more'], "$server/blog/$r_post[permalink]")?></p>
-                                            <p class='desktop'><?=cutText($r_post['text'], 150, $lng['index_read_more'], "$server/blog/$r_post[permalink]")?></p>
-                                            <span><?=formatDate($r_post['dtime'], $lang, false)?></span>
+                                            <p class='mobile'><?=cutText($r_post["text"], 100, $lng["index_read_more"], "$server/blog/$r_post[permalink]")?></p>
+                                            <p class='desktop'><?=cutText($r_post["text"], 150, $lng["index_read_more"], "$server/blog/$r_post[permalink]")?></p>
+                                            <span><?=formatDate($r_post["dtime"], $lang, false)?></span>
                                         </div> <!-- .entry -->
 <?php
                                     } //while ($r_post = mysqli_fetch_array($q_post))
 ?>
 
-                                    <a class='go_to_section' href='<?=$server?>/blog/'><?$lng['index_see_all_posts']?></a>
+                                    <a class='go_to_section' href='<?=$server?>/blog/'><?$lng["index_see_all_posts"]?></a>
                                     <br/>
 <?php
                                 } //if (mysqli_num_rows($q_post) == 0) ELSE
@@ -595,12 +623,12 @@
                     </div> <!-- .cell_posts-->
                     <div class='content_cell' id='cell_photos'>
                         <div class='section' id='latest_photos'>
-                            <h3 class='section_title'><?=$lng['index_latest_photos']?></h3>
+                            <h3 class='section_title'><?=$lng["index_latest_photos"]?></h3>
 <?php
                                 $q_photos = mysqli_query($con, "SELECT id, file, title_$lang AS title, DATE_FORMAT(uploaded, '%Y-%m-%d') AS isodate FROM photo WHERE approved = 1 ORDER BY uploaded DESC LIMIT 6;");
                                 if (mysqli_num_rows($q_photos) == 0){
 ?>
-                                    <div class='entry'><?=$lng['index_no_photos']?></div>
+                                    <div class='entry'><?=$lng["index_no_photos"]?></div>
 <?php
                                 }
                                 else{
@@ -615,10 +643,10 @@
                                                     $r_album = mysqli_fetch_array($q_album);
 ?>
                                                     <td itemscope itemtype='http://schema.org/Photograph'>
-                                                        <meta itemprop='datePublished' content='<?=$r_photos['isodate']?>'/>
-                                                        <a href='$server/galeria/<?=$r_album['permalink']?>'>
+                                                        <meta itemprop='datePublished' content='<?=$r_photos["isodate"]?>'/>
+                                                        <a href='<?=$server?>/galeria/<?=$r_album["permalink"]?>'>
                                                             <meta itemprop='image' content='<?=$server?>/img/galeria/<?=$r_photos["file"]?>'/>
-                                                            <img src='<?=$server?>/img/galeria/miniature/<?=$r_photos['file']?>' alt='<?=$r_photos['title']?>' />
+                                                            <img src='<?=$server?>/img/galeria/miniature/<?=$r_photos["file"]?>' alt='<?=$r_photos["title"]?>' />
                                                         </a>
                                                     </td>
 <?php
@@ -634,7 +662,7 @@
                                             </tr>
                                         </table>
                                     </div> <!-- .entry -->
-                                    <a class='go_to_section' href='<?=$server?>/galeria/'><?=$lng['index_see_all_photos']?></a>
+                                    <a class='go_to_section' href='<?=$server?>/galeria/'><?=$lng["index_see_all_photos"]?></a>
                                     <br/>
 <?php
                                 } //if (mysqli_num_rows($q_photos) == 0) ELSE
@@ -649,18 +677,18 @@
                     if (mysqli_num_rows($q_activity) > 0){
 ?>
                         <div class='section' id='latest_activities'>
-                            <h3 class='section_title'><?=$lng['index_latest_activities']?></h3>
+                            <h3 class='section_title'><?=$lng["index_latest_activities"]?></h3>
 <?php
                             while ($r_activity = mysqli_fetch_array($q_activity)){
 ?>
                                 <div class='entry' itemscope itemtype='http://schema.org/Event'>
                                     <meta itemprop='inLanguage' content='<?=$lang?>'/>
-                                    <meta itemprop='name' content='<?=$r_activity['title']?>'/>
-                                    <meta itemprop='description' content='<?=$r_activity['text']?>'/>
-                                    <meta itemprop='startDate endDate' content='<?=$r_activity['isodate']?>'/>
+                                    <meta itemprop='name' content='<?=$r_activity["title"]?>'/>
+                                    <meta itemprop='description' content='<?=$r_activity["text"]?>'/>
+                                    <meta itemprop='startDate endDate' content='<?=$r_activity["isodate"]?>'/>
                                     <span class='hidden' itemprop='location' itemscope itemtype='http://schema.org/Place'>
-                                        <meta itemprop='address' itemprop='name' content='<?=$r_activity['city']?>'/>
-                                        <meta itemprop='name' content='<?=$r_activity['city']?>'/>
+                                        <meta itemprop='address' itemprop='name' content='<?=$r_activity["city"]?>'/>
+                                        <meta itemprop='name' content='<?=$r_activity["city"]?>'/>
                                     </span>
                                     <div class='hidden' itemprop='organizer performer' itemscope itemtype='http://schema.org/Organization'>
                                         <meta itemprop='legalName' content='Asociaci&oacute;n Cultural Recreativa Gasteizko Margolariak'/>
@@ -674,19 +702,19 @@
 
 
                                     <span class='hidden' itemprop='offers' itemscope itemtype='http://schema.org/Offer'>
-                                        <meta itemprop='name' content='<?=$r_activity['title']?>'/>
-                                        <meta itemprop='description' content='<?=$r_activity['text']?>'/>
-                                        <meta itemprop='price' content='<?=$r_activity['price']?>'/>
+                                        <meta itemprop='name' content='<?=$r_activity["title"]?>'/>
+                                        <meta itemprop='description' content='<?=$r_activity["text"]?>'/>
+                                        <meta itemprop='price' content='<?=$r_activity["price"]?>'/>
                                         <meta itemprop='priceCurrency' content='EUR'/>
-                                        <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity['permalink']?>'/>
+                                        <meta itemprop='url' content='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'/>
                                         <meta itemprop='availability' content='Sold Out'/>
-                                        <meta itemprop='validfrom' content='<?=$r_activity['isodate']?>'/>
+                                        <meta itemprop='validfrom' content='<?=$r_activity["isodate"]?>'/>
                                     </span>
 
 
 
                                     <h3 class='entry_title'>
-                                        <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'><?=$r_activity['title']?></a>
+                                        <a itemprop='url' href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'><?=$r_activity["title"]?></a>
                                     </h3>
                                     <table class='latest_activity'>
                                         <tr>
@@ -696,33 +724,33 @@
                                                 $r_activity_image = mysqli_fetch_array($q_activity_image);
 ?>
                                                 <td class='latest_activity_image'>
-                                                    <a href='<?=$server?>/actividades/<?=$r_activity['permalink']?>'>
-                                                        <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image['image']?>'/>
-                                                        <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image['image']?>' alt='<?=$r_activity['title']?>'/>
+                                                    <a href='<?=$server?>/actividades/<?=$r_activity["permalink"]?>'>
+                                                        <meta itemprop='image' content='<?=$server?>/img/actividades/<?=$r_activity_image["image"]?>'/>
+                                                        <img src='<?=$server?>/img/actividades/miniature/<?=$r_activity_image["image"]?>' alt='<?=$r_activity["title"]?>'/>
                                                     </a>
                                                 </td>
 <?php
                                             } // if (mysqli_num_rows($q_activity_image) > 0)
-                                            if ($r_activity['after'] == ''){
+                                            if ($r_activity["after"] == ''){
 ?>
                                                 <td class='mobile latest_activity_text'>
-                                                    <?=cutText($r_activity['text'], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
+                                                    <?=cutText($r_activity["text"], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
                                                 </td>
                                                 <td class='desktop latest_activity_text'>
-                                                    <?=cutText($r_activity['text'], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
+                                                    <?=cutText($r_activity["text"], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
                                                 </td>
 <?php
-                                            } // if ($r_activity['after'] == '')
+                                            } // if ($r_activity["after"] == '')
                                             else{
 ?>
                                                 <td class='mobile latest_activity_text'>
-                                                    <?=cutText($r_activity['after'], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
+                                                    <?=cutText($r_activity["after"], 260, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
                                                 </td>
                                                 <td class='desktop latest_activity_text'>
-                                                    <?=cutText($r_activity['after'], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
+                                                    <?=cutText($r_activity["after"], 400, "$lng[index_read_more]", "$server/actividades/$r_activity[permalink]")?>
                                                 </td>
 <?php
-                                            } // if ($r_activity['after'] == '') ELSE
+                                            } // if ($r_activity["after"] == '') ELSE
 ?>
                                         </tr>
                                     </table>
@@ -730,7 +758,7 @@
 <?php
                             }
 ?>
-                            <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng['index_upcoming_activity_see_all']?></a>
+                            <a class='go_to_section' href='<?=$server?>/actividades/'><?=$lng["index_upcoming_activity_see_all"]?></a>
                             <br/>
                         </div> <!-- .section -->
 <?php
@@ -741,13 +769,13 @@
                 if ($festivals == 0){
 ?>
                     <div class='section'>
-                        <h3 class='section_title'><?=$lng['index_festivals_header']?></h3>
+                        <h3 class='section_title'><?=$lng["index_festivals_header"]?></h3>
                         <div class='entry'>
                             <span class='desktop'>
-                                <?=cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 300, $lng['index_read_more'], "$server/lablanca/")?>
+                                <?=cutText($lng["lablanca_no_content"] . '<br/>' . $lng["lablanca_no_content_2"], 300, $lng["index_read_more"], "$server/lablanca/")?>
                             </span>
                             <span class='desktop'>
-                                <?=cutText($lng['lablanca_no_content'] . '<br/>' . $lng['lablanca_no_content_2'], 200, $lng['index_read_more'], "$server/lablanca/")?>
+                                <?=cutText($lng["lablanca_no_content"] . '<br/>' . $lng["lablanca_no_content_2"], 200, $lng["index_read_more"], "$server/lablanca/")?>
                             </span>
                         </div> <!-- .entry -->
                     </div> <!-- .section -->

+ 127 - 108
www/lablanca/index.php

@@ -3,14 +3,14 @@
     include("../functions.php");
     $con = startdb();
     $proto = getProtocol();
-    $http_host = $_SERVER['HTTP_HOST'];
-    $server = "$proto" . "$http_host";
+    $http_host = $_SERVER["HTTP_HOST"];
+    $server = "$proto$http_host";
     
     //Language
     $lang = selectLanguage();
-    include("../lang/lang_" . $lang . ".php");
+    include("../lang/lang_$lang.php");
     
-    $cur_section = $lng['section_lablanca'];
+    $cur_section = $lng["section_lablanca"];
     
     //Is festivals enabled in settings?
     $q = mysqli_query($con, "SELECT value FROM settings WHERE name = 'festivals';");
@@ -18,7 +18,7 @@
         $is_festivals = false;
     else{
         $r = mysqli_fetch_array($q);
-        if ($r['value'] == 1){
+        if ($r["value"] == 1){
             $is_festivals = true;
         }
         else{
@@ -28,134 +28,153 @@
     
     //Get year
     $year = date("Y");
-    //if (is_int($_GET['year']) == false){ 
-    if ($_GET['year'] != ''){ 
-        $q_year = mysqli_query($con, "SELECT id FROM festival WHERE year = " . mysqli_real_escape_string($con, $_GET['year']));
+    if ($_GET["year"] != ''){ 
+        $q_year = mysqli_query($con, "SELECT id FROM festival WHERE year = " . mysqli_real_escape_string($con, $_GET["year"]));
         if (mysqli_num_rows($q_year) > 0){
-            $year = $_GET['year'];
+            $year = $_GET["year"];
             $is_festivals = true;
         }
     }
     
-    //echo $_GET['year'];
 
 ?>
 <!DOCTYPE html>
 <html>
     <head>
-        <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">
+        <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>
-            <?php
-                if ($is_festivals){
-                    echo str_replace('#', $year, $lng['lablanca_title']);
-                }
-                else{
-                    echo $lng['lablanca_no_title'];
-                }
-            ?>
+<?php
+            if ($is_festivals){
+?>
+                <?=str_replace('#', $year, $lng["lablanca_title"])?>
+<?php
+            }
+            else{
+?>
+                <?=$lng["lablanca_no_title"]?>
+<?php
+             }
+?>
              - Gasteizko Margolariak
         </title>
-        <link rel="shortcut icon" href="<?php echo "$proto$http_host/img/logo/favicon.ico";?>">
+        <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'>
         <!-- CSS files -->
         <style>
-            <?php 
-                include("../css/ui.css"); 
-                include("../css/lablanca.css");
-            ?>
+<?php 
+            include("../css/ui.css"); 
+            include("../css/lablanca.css");
+?>
         </style>
         <!-- CSS for mobile version -->
         <style media="(max-width : 990px)">
-            <?php 
-                include("../css/m/ui.css"); 
-                include("../css/m/lablanca.css");
-            ?>
+<?php 
+            include("../css/m/ui.css"); 
+            include("../css/m/lablanca.css");
+?>
         </style>
         <!-- Script files -->
         <script type="text/javascript">
-            <?php
-                include("../script/ui.js");
-                include("../script/lablanca.js");
-            ?>
+<?php
+            include("../script/ui.js");
+            include("../script/lablanca.js");
+?>
         </script>
         <!-- Meta tags -->
-        <link rel="canonical" href="<?php echo "$proto$http_host/lablanca/"; ?>"/>
-        <link rel="author" href="<?php echo "$proto$http_host"; ?>"/>
-        <link rel="publisher" href="<?php echo "$proto$http_host"; ?>"/>
-        <meta name="description" content="<?php echo $lng['lablanca_description'];?>"/>
-        <meta property="og:title" 
-            content="<?php
-                if ($is_festivals){
-                    echo str_replace('#', $year, $lng['lablanca_title']);
-                }
-                else{
-                    echo $lng['lablanca_no_title'];
-                }
-            ?> - Gasteizko Margolariak"
-        />
-        <meta property="og:url" content="<?php echo "$proto$http_host"; ?>"/>
-        <meta property="og:description" content="<?php echo $lng['lablanca_description'];?>"/>
-        <meta property="og:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta property="og:site_name" content="<?php echo $lng['lablanca_title'];?>"/>
-        <meta property="og:type" content="website"/>
-        <meta property="og:locale" content="<?php echo $lang; ?>"/>
-        <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" 
-            content="<?php
-                if ($is_festivals){
-                    echo str_replace('#', $year, $lng['lablanca_title']);
-                }
-                else{
-                    echo $lng['lablanca_no_title'];
-                }
-            ?> - Gasteizko Margolariak"
-        />
-        <meta name="twitter:description" content="<?php echo $lng['lablanca_description'];?>"/>
-        <meta name="twitter:image" content="<?php echo "$proto$http_host/img/logo/logo.png";?>"/>
-        <meta name="twitter:url" content="<?php echo"$proto$http_host"; ?>"/>
+        <link rel="canonical" href="<?=$server?>/lablanca/"/>
+        <link rel="author" href="<?=$server?>"/>
+        <link rel="publisher" href="<?=$server?>"/>
+        <meta name='description' content='<?=$lng["lablanca_description"]?>'/>
+<?php
+        if ($is_festivals){
+?>
+            <meta property="og:title" content='<?=str_replace('#', $year, $lng["lablanca_title"])?> - Gasteizko Margolariak'/>
+<?php
+        }
+        else{
+?>
+            <meta property="og:title" content='<?=str_replace('#', $year, $lng["lablanca_no_title"])?> - Gasteizko Margolariak'/>
+<?php
+        }
+?>
+        <meta property='og:url' content='<?=$server?>'/>
+        <meta property='og:description' content='<?=$lng["lablanca_description"]?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta property='og:site_name' content='<?=$lng["lablanca_title"]?>'/>
+        <meta property='og:type' content='website'/>
+        <meta property='og:locale' content='<?=$lang?>'/>
+        <meta name='twitter:card' content='summary'/>
+<?php
+        if ($is_festivals){
+?>
+            <meta property="twitter:title" content='<?=str_replace('#', $year, $lng["lablanca_title"])?> - Gasteizko Margolariak'/>
+<?php
+        }
+        else{
+?>
+            <meta property="twitter:title" content='<?=str_replace('#', $year, $lng["lablanca_no_title"])?> - Gasteizko Margolariak'/>
+<?php
+        }
+?>
+        <meta name="twitter:description" content="<?=$lng["lablanca_description"]?>"/>
+        <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png";?>"/>
+        <meta name="twitter:url" content="<?=$server?>"/>
         <meta name="robots" content="index follow"/>
     </head>
     <body>
-        <?php include("../header.php"); ?>
-        <div id="content">
-            <?php                
-                //Include file
-                if ($is_festivals){
-                    include("fiestas.php");
-                }
-                else{
-                    include("nofiestas.php");
-                }
-            ?>
-            <?php
-                //If the program of previous years exist, show a drop list
-                $year = date("Y");
-                if (date("M") <= 8 || (date("M") == 8 && date("D") < 25)){
-                    $year --;
-                }
-                if (date("M") <= 8){
-                    $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year != " . date("Y") . " ORDER BY year DESC;");
-                }
-                else{
-                    $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year <= " . date("Y") . " ORDER BY year DESC;");
-                }
-                if (mysqli_num_rows($q_years) >= 0){
-                    echo("<br/><br/><div class='section' id='past_festivals'>\n");
-                    echo("<h3 class='section_title'>$lng[lablanca_past_title]</h3>\n");
-                    echo("<div class='entry'><ul>\n");
-                    while ($r_years = mysqli_fetch_array($q_years)){
-                        echo("<li><a href='$proto$http_host/lablanca/$r_years[year]'>$lng[lablanca_past_link] $r_years[year]</a></li>\n");
-                    }        
-                    echo("</ul></div>\n");
-                    echo("</div>\n");
-                }
-            ?>
-        </div>
-        <?php
-            include("../footer.php");
-            $ad = ad($con, $lang, $lng); 
-            stats($ad, $ad_static, "fiestas", "");
-        ?>
+<?php
+    include("../header.php");
+?>
+    <div id="content">
+<?php                
+        //Include file
+        if ($is_festivals){
+            include("fiestas.php");
+        }
+        else{
+            include("nofiestas.php");
+        }
+?>
+<?php
+        //If the program of previous years exist, show a drop list
+        $year = date("Y");
+        if (date("M") <= 8 || (date("M") == 8 && date("D") < 25)){
+            $year --;
+        }
+        if (date("M") <= 8){
+            $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year != " . date("Y") . " ORDER BY year DESC;");
+        }
+        else{
+            $q_years = mysqli_query($con, "SELECT year FROM festival WHERE year <= " . date("Y") . " ORDER BY year DESC;");
+        }
+        if (mysqli_num_rows($q_years) >= 0){
+?>
+            <br/><br/>
+            <div class='section' id='past_festivals'>
+                <h3 class='section_title'><?=$lng["lablanca_past_title"]?></h3>
+                <div class='entry'>
+                    <ul>
+<?php
+                        while ($r_years = mysqli_fetch_array($q_years)){
+?>
+                            <li>
+                                <a href='<?=$server?>/lablanca/<?=$r_years["year"]?>'><?=$lng["lablanca_past_link"]?> <?=$r_years["year"]?></a>
+                            </li>
+<?php
+                        }
+?>
+                    </ul>
+                </div> <!-- .entry -->
+            </div> <!-- .section -->
+<?php
+        }
+?>
+    </div> <!-- #content -->
+<?php
+    include("../footer.php");
+    $ad = ad($con, $lang, $lng); 
+    stats($ad, $ad_static, "fiestas", "");
+?>
     </body>
 </html>

+ 6 - 6
www/lablanca/nofiestas.php

@@ -1,15 +1,15 @@
-<?php //TODO: Revisit this file.?>
+<!-- TODO: Revisit this file. -->
 <div class="section">
-    <h3 class="section_title"><?php echo($lng['lablanca_no_intro']); ?></h3>
+    <h3 class="section_title"><?=$lng["lablanca_no_intro"])?></h3>
     <div class="entry">
         <div class="horiz">
-            <p><?php echo($lng['lablanca_no_content']); ?></p>
-<!--             <img src="TODO"/> -->
+            <p><?=$lng["lablanca_no_content"])?></p>
+            <!-- TODO <img/> -->
         </div>
         <br/>
         <div class="horiz">
-<!--             <img src="TODO"/> -->
-            <p><?php echo($lng['lablanca_no_content_2']); ?></p>
+            <!-- TODO <img/> -->
+            <p><?=$lng["lablanca_no_content_2"])?></p>
         </div>
     </div>
 </div>

File diff suppressed because it is too large
+ 0 - 0
www/lang/lang_en.php


File diff suppressed because it is too large
+ 0 - 0
www/lang/lang_es.php


File diff suppressed because it is too large
+ 0 - 0
www/lang/lang_eu.php


+ 0 - 15
www/langtranslate.php

@@ -1,15 +0,0 @@
-<?php
-    include include("lang/lang_es.php");
-    $lng_es = $lng;
-    include include("lang/lang_en.php");
-    $lng_en = $lng;
-    include include("lang/lang_eu.php");
-    $lng_eu = $lng;
-    $total = count($lng_es);
-    echo "<table style='border:0.1em solid #000000; border-collapse:collapse'>\n";
-    echo "<tr><th style='border:0.1em solid #000000; width:8em;'>Code</th><th style='border:0.1em solid #000000;'>es</th><th style='border:0.1em solid #000000;display:none;'>en</th><th style='border:0.1em solid #000000;'>eu</th><tr>\n";
-    for ($i = 0; $i < count($lng_es); $i++){
-        echo "<tr><td style='padding:0em; border:0.1em solid #000000; width:8em; font-size:60%; font-weight:bold; word-break: break-all;'>" . array_search(array_values($lng_es)[$i], $lng_es, true) . "</td><td style='padding:-0.3em 0.1em -0.3em 0.1em; border:0.1em solid #000000;line-height: 110%;font-size:90%;'>" . array_values($lng_es)[$i] . "</td><td style='adding:-0.3em 0.1em -0.3em 0.1em; border:0.1em solid #000000;display:none;'>" . array_values($lng_en)[$i] . "</td><td style='padding:adding:-0.3em 0.1em -0.3em 0.1em;; border:0.1em solid #000000;line-height: 110%;font-size:90%;'>" . array_values($lng_eu)[$i] . "</td></tr>";
-    }
-    echo "</table>";
-?>

+ 10 - 10
www/nosotros/index.php

@@ -4,12 +4,12 @@
     include("../functions.php");
     $con = startdb();
     $proto = getProtocol();
-	$server = "$proto$http_host";
-    
+    $server = "$proto$http_host";
+
     //Language
     $lang = selectLanguage();
     include("../lang/lang_$lang.php");
-    
+
     $cur_section = $lng['section_us'];
 ?>
 <!DOCTYPE html>
@@ -22,15 +22,15 @@
         <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
         <!-- CSS files -->
         <style>
-<?php 
-            include("../css/ui.css"); 
+<?php
+            include("../css/ui.css");
             include("../css/nosotros.css");
 ?>
         </style>
         <!-- CSS for mobile version -->
         <style media="(max-width : 990px)">
-<?php 
-            include("../css/m/ui.css"); 
+<?php
+            include("../css/m/ui.css");
             include("../css/m/nosotros.css");
 ?>
         </style>
@@ -60,8 +60,8 @@
         <meta name="robots" content="index follow"/>
     </head>
     <body>
-<?php 
-		include("../header.php");
+<?php
+        include("../header.php");
 ?>
         <div id="content">
             <div class="content_row">
@@ -101,7 +101,7 @@
                             <img src="<?=$server?>/img/nosotros/transparencia.png" alt=" "/>
                             <?=$lng["us_transparency_content"] ?>
                             <div>
-								<!-- <a class='button' href="/nosotros/transparencia/">Consulta nuestras cuentas</a> -->
+                                 <!-- <a class='button' href="/nosotros/transparencia/">Consulta nuestras cuentas</a> -->
                             </div>
                         </div>
                     </div>

+ 58 - 72
www/traducir/index.php

@@ -21,13 +21,13 @@
                     <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>Traducciones - Gasteizko Margolariak</title>
+                    <title><?=$lng["translation_title"]?> - Gasteizko Margolariak</title>
                     <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
                     <!-- CSS files -->
                     <style>
 <?php
-                            include("../css/ui.css"); 
-                            include("../css/traducir.css");
+                        include("../css/ui.css"); 
+                        include("../css/traducir.css");
 ?>
                     </style>
                     <!-- CSS for mobile version -->
@@ -44,32 +44,32 @@
 ?>
                     </script>
                     <!-- Meta tags -->
-                    <link rel="canonical" href="<?=$server?>/traducir/"/>
-                    <link rel="author" href="<?=server?>"/>
-                    <link rel="publisher" href="<?=server?>"/>
-                    <meta name="description" content="Traduccion de contenidos de la web de Gasteizko Margolariak"/>
-                    <meta property="og:title" content="Traducciones - Gasteizko Margolariak"/>
-                    <meta property="og:url" content="<?=$server?>/traducir/"/>
-                    <meta property="og:description" content="Traduccion de contenidos de la web de Gasteizko Margolariak"/>
-                    <meta property="og:image" content="<?=$server?>/img/logo/logo.png"/>
-                    <meta property="og:site_name" content="Gasteizko Margolariak"/>
-                    <meta property="og:type" content="website"/>
-                    <meta property="og:locale" content="es"/>
-                    <meta name="twitter:card" content="summary"/>
-                    <meta name="twitter:title" content="Traducciones - Gasteizko Margolariak"/>
-                    <meta name="twitter:description" content="Traduccion de contenidos de la web de Gasteizko Margolariak"/>
-                    <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
-                    <meta name="twitter:url" content="<?$server?>/traducir/"/>
-                    <meta name="robots" content="noindex nofollow"/>
+                    <link rel='canonical' href='<?=$server?>/traducir/'/>
+                    <link rel='author' href='<?=server?>'/>
+                    <link rel='publisher' href='<?=server?>'/>
+                    <meta name='description' content='Traduccion de contenidos de la web de Gasteizko Margolariak'/>
+                    <meta property='og:title' content='<?=$lng["translation_title"]?> - Gasteizko Margolariak'/>
+                    <meta property='og:url' content='<?=$server?>/traducir/'/>
+                    <meta property='og:description' content='<?=$lng["translation_description"]?>'/>
+                    <meta property='og:image' content='<?=$server?>/img/logo/logo.png'/>
+                    <meta property='og:site_name' content='Gasteizko Margolariak'/>
+                    <meta property='og:type' content='website'/>
+                    <meta property='og:locale' content='<?=$lang?>'/>
+                    <meta name='twitter:card' content='summary'/>
+                    <meta name='twitter:title' content='<?=$lng["translation_title"]?> - Gasteizko Margolariak'/>
+                    <meta name='twitter:description' content='<?=$lng["translation_description"]?>'/>
+                    <meta name='twitter:image' content='<?=$server?>/img/logo/logo.png'/>
+                    <meta name='twitter:url' content='<?$server?>/traducir/'/>
+                    <meta name='robots' content='noindex nofollow'/>
                 </head>
                 <body>
 <?php                include("../header.php"); ?>
                     <div id="content">
                         <div class='section' id='w_init'>
-                            <h3 class='section_title'>Traducciones</h3>
+                            <h3 class='section_title'><?=$lng["translation_title"]?></h3>
                             <div class='entry'>
-                                <a class='lang' href='<?=$server?>/traducir/eu/'>Traducir al euskera</a>
-                                <a class='lang' href='<?=$server?>/traducir/en/'>Traducir al ingl&eacute;s</a>
+                                <a class='lang' href='<?=$server?>/traducir/eu/'<?=$lng["translation_to_eu"]?></a>
+                                <a class='lang' href='<?=$server?>/traducir/en/'<?=$lng["translation_to_en"]?></a>
                             </div>
                         </div>
                     </div>
@@ -137,23 +137,23 @@
 <!DOCTYPE html>
 <html>
     <head>
-        <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>Traducciones - Gasteizko Margolariak</title>
-        <link rel="shortcut icon" href="<?=$server?>/img/logo/favicon.ico">
+        <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["translation_title"]?> - Gasteizko Margolariak</title>
+        <link rel='shortcut icon' href='<?=$server?>/img/logo/favicon.ico'>
         <!-- CSS files -->
         <style>
 <?php 
-                include("../css/ui.css"); 
-                include("../css/traducir.css");
+            include("../css/ui.css"); 
+            include("../css/traducir.css");
 ?>
         </style>
         <!-- CSS for mobile version -->
         <style media="(max-width : 990px)">
 <?php
-                include("../css/m/ui.css"); 
-                include("../css/m/traducir.css");
+            include("../css/m/ui.css"); 
+            include("../css/m/traducir.css");
 ?>
         </style>
         <!-- Script files -->
@@ -273,55 +273,41 @@
 
         </script>
         <!-- Meta tags -->
-        <link rel="canonical" href="<?=$server?>/traducir/"/>
-        <link rel="author" href="<?=$server?>"/>
-        <link rel="publisher" href="<?=$server?>"/>
-        <meta name="description" content="Traduccion de contenidos de la web de Gasteizko Margolariak"/>
-        <meta property="og:title" content="Traducciones - Gasteizko Margolariak"/>
-        <meta property="og:url" content="<?=$server?>/traducir/"/>
-        <meta property="og:description" content="Traduccion de contenidos de la web de Gasteizko Margolariak"/>
-        <meta property="og:image" content="<?=$server?>/img/logo/logo.png"/>
-        <meta property="og:site_name" content="Gasteizko Margolariak"/>
-        <meta property="og:type" content="website"/>
-        <meta property="og:locale" content="es"/>
-        <meta name="twitter:card" content="summary"/>
-        <meta name="twitter:title" content="Traducciones - Gasteizko Margolariak"/>
-        <meta name="twitter:description" content="Traduccion de contenidos de la web de Gasteizko Margolariak"/>
-        <meta name="twitter:image" content="<?=$server?>/img/logo/logo.png"/>
-        <meta name="twitter:url" content="<?=$server?>/traducir/"/>
-        <meta name="robots" content="noindex nofollow"/>
+        <link rel='canonical' href='<?=$server?>/traducir/'/>
+        <link rel='author' href='<?=$server?>'/>
+        <link rel='publisher' href='<?=$server?>'/>
+        <meta name='description' content='<?=$lng["translation_description"]?>'/>
+        <meta property='og:title' content='<?=$lng["translation_title"]?> - Gasteizko Margolariak'/>
+        <meta property='og:url' content='<?=$server?>/traducir/'/>
+        <meta property='og:description' content='<?=$lng["translation_description"]?>'/>
+        <meta property='og:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta property='og:site_name' content='Gasteizko Margolariak'/>
+        <meta property='og:type' content='website'/>
+        <meta property='og:locale' content='<?=$lang?>'/>
+        <meta name='twitter:card' content='summary'/>
+        <meta name='twitter:title' content='<?=$lng["translation_title"]?> - Gasteizko Margolariak'/>
+        <meta name='twitter:description' content='<?=$lng["translation_description"]?>'/>
+        <meta name='twitter:image' content='<?=$server?>/img/logo/logo.png'/>
+        <meta name='twitter:url' content='<?=$server?>/traducir/'/>
+        <meta name='robots' content='noindex nofollow'/>
     </head>
     <body onLoad='prepare();'>
-<?php     include("../header.php"); ?>
+<?php
+		include("../header.php");
+?>
         <div id="content">
             <div class='section'>
                 <h3 class='section_title'>Traducciones en 
-<?php
-                    if ($l == 'en'){
-                        echo("ingl&eacute;s");
-                    }
-                    else{
-                        echo("euskera");
-                    }
-?>
+					<?=$lng["translation_translating_$l"]?>
                 </h3>
                 <div class='entry' id='w_target'>
                     <div class='translation' id='original'>
-                        <h3 class='entry_title'>Original (Castellano)</h3>
+                        <h3 class='entry_title'><?=$lng["translation_original"]?></h3>
                         <span id='i_original'></span>
                         <p id='t_original'></p>
                     </div>
                     <div class='translation' id='translation'>
-                        <h3 class='entry_title'>Traducci&oacute;n (
-<?php
-                            if ($l == 'en'){
-                                echo("Ingl&eacute;s");
-                            }
-                            else{
-                                echo("Euskera");
-                            }
-?>
-                        )</h3>
+                        <h3 class='entry_title'><?=$lng["translation_translation_$l"]?></h3>
                         <input type='text' id='i_translation'/>
                         <textarea id='t_translation'></textarea>
                     </div>
@@ -332,13 +318,13 @@
                     <table id='buttons'>
                         <tr>
                             <td>
-                                <input type='text' id='name' placeholder='Tu nombre...'/>
+                                <input type='text' id='name' placeholder='<?=$lng["translation_name"]?>'/>
                             </td>
                             <td>
-                                <input type='button' id='next' value='Saltar esta' onClick='next();'/>
+                                <input type='button' id='next' value='<?=$lng["translation_skip"]?>' onClick='next();'/>
                             </td>
                             <td>
-                                <input type='button' id='save' value='Guardar' onClick='save();'/>
+                                <input type='button' id='save' value='<?=$lng["translation_save"]?>' onClick='save();'/>
                             </td>
                         </tr>
                     </table>

+ 8 - 20
www/traducir/load.php

@@ -1,19 +1,16 @@
 <?php
     session_start();
-    $http_host = $_SERVER['HTTP_HOST'];
+    $http_host = $_SERVER["HTTP_HOST"];
     include("../functions.php");
-    $proto = getProtocol();
-    $con = startdb('rw');
-    $server = "$proto$http_host";
+    $con = startdb("rw");
 
     // Get parameters
-
-    $t = mysqli_real_escape_string($con, urldecode($_GET['t'])); // table
-    $f = mysqli_real_escape_string($con, urldecode($_GET['f'])); // field (column)
-    $i = mysqli_real_escape_string($con, urldecode($_GET['i'])); // id
-    $c = mysqli_real_escape_string($con, urldecode($_GET['c'])); // content (translation)
-    $l = mysqli_real_escape_string($con, urldecode($_GET['l'])); // language
-    $n = mysqli_real_escape_string($con, urldecode($_GET['n'])); // translator name
+    $t = mysqli_real_escape_string($con, urldecode($_GET["t"])); // table
+    $f = mysqli_real_escape_string($con, urldecode($_GET["f"])); // field (column)
+    $i = mysqli_real_escape_string($con, urldecode($_GET["i"])); // id
+    $c = mysqli_real_escape_string($con, urldecode($_GET["c"])); // content (translation)
+    $l = mysqli_real_escape_string($con, urldecode($_GET["l"])); // language
+    $n = mysqli_real_escape_string($con, urldecode($_GET["n"])); // translator name
 
     if (strlen($t) == 0 || strlen($f) == 0 || 
       is_numeric($i) == false || strlen($c) == 0 || 
@@ -21,15 +18,6 @@
          http_response_code(400); // Bad request
     }
     else{
-
-        /*$t = urldecode($_GET['t']); // table
-        $f = urldecode($_GET['f']); // field (column)
-        $i = urldecode($_GET['i']); // id
-        $c = urldecode($_GET['c']); // content (translation)
-        $l = urldecode($_GET['l']); // language
-        $n = urldecode($_GET['n']); // translator name*/
-
-        // TODO: Validate parameters
         $q_string = "INSERT INTO translation (username, tab, field, eid, lang, text) VALUES ('$n', '$t', '$f', '$i', '$l', '$c');";
         mysqli_query($con, $q_string);
     }

Some files were not shown because too many files changed in this diff