Bladeren bron

Small improvements

seavenois 10 jaren geleden
bovenliggende
commit
39231efc90

+ 1 - 1
sql/setup.sql

@@ -135,7 +135,7 @@ CREATE TABLE stat_view (
 	dtime	TIMESTAMP		NOT NULL	DEFAULT now()
 );
 
-DROP TABLE IF EXIST stat_sync;
+DROP TABLE IF EXISTS stat_sync;
 CREATE TABLE stat_sync (
 	id		INT			NOT NULL	AUTO_INCREMENT	PRIMARY KEY,
 	dtime	TIMESTAMP	NOT NULL	DEFAULT now(),

+ 2 - 2
www-admin/actividades/translate/apply.php

@@ -1,7 +1,7 @@
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("../../../php_functions.php");
-	$con = startdb();
+	$con = startdb('rw');
 	if (!checkSession($con)){
 		header("Location: /index.php");
 		exit (-1);
@@ -77,4 +77,4 @@
 		}
 	}
 	header("Location: /actividades/translate/index.php");	
-?>
+?>

+ 1 - 1
www-admin/blog/translate/apply.php

@@ -1,7 +1,7 @@
 <?php
 	$http_host = $_SERVER['HTTP_HOST'];
 	include("../../functions.php");
-	$con = startdb();
+	$con = startdb('rw');
 	if (!checkSession($con)){
 		header("Location: /index.php");
 		exit (-1);

+ 0 - 38
www-admin/blog/translate/save.php

@@ -1,38 +0,0 @@
-<!-- DELETE ME -->
-<?php
-	$http_host = $_SERVER['HTTP_HOST'];
-	include("../../functions.php");
-	$con = startdb();
-	if (!checkSession($con)){
-		header("Location: /index.php");
-		exit (-1);
-	}
-	else{
-		
-		//Get POST data
-		$id = mysqli_real_escape_string($con, $_POST['id']);
-		$title_eu = mysqli_real_escape_string($con, $_POST['title_eu']);
-		$title_en = mysqli_real_escape_string($con, $_POST['title_en']);
-		$text_eu = mysqli_real_escape_string($con, $_POST['text_eu']);
-		$text_en = mysqli_real_escape_string($con, $_POST['text_en']);
-		
-		//Check if the post exists
-		$q = mysqli_query($con, "SELECT id, title_en, title_eu, text_en, text_eu FROM post");
-		if (mysqli_num_rows($q) == 0){
-			header("Location: /blog/translate/");
-			exit(-1);
-		}
-		else{
-			if ($title_en != "" && $title_en != $r['title_en'])
-				mysqli_query($con, "UPDATE post SET title_en = '$title_en' WHERE id = $id;");
-			if ($title_eu != "" && $title_eu != $r['title_eu'])
-				mysqli_query($con, "UPDATE post SET title_eu = '$title_eu' WHERE id = $id;");
-			if ($text_en != "" && $text_en != $r['text_en'])
-				mysqli_query($con, "UPDATE post SET text_en = '$text_en' WHERE id = $id;");
-			if ($text_eu != "" && $text_eu != $r['text_eu'])
-				mysqli_query($con, "UPDATE post SET text_eu = '$text_eu' WHERE id = $id;");
-			version();
-		}
-		
-	}
-?>

+ 2 - 2
www/footer.php

@@ -28,10 +28,10 @@
 								echo("<a target='_blank' href='$r[link]'><span class='desktop'>$r[name]</span><img src='/img/spo/miniature/$r[image]'/></a>");
 							}
 							elseif ($idx == 1){
-								echo("&nbsp;&nbsp;&nbsp;<a target='_blank' href='$r[link]'><img src='/img/spo/miniature/$r[image]'/><span class='desktop'>$r[name]</span></a></br class='desktop'>");
+								echo("&nbsp;&nbsp;&nbsp;<a target='_blank' href='$r[link]'><img src='/img/spo/thumb/$r[image]'/><span class='desktop'>$r[name]</span></a></br class='desktop'>");
 							}
 							else{
-								echo("<a target='_blank' href='$r[link]'><img src='/img/spo/miniature/$r[image]'/></a>");
+								echo("<a target='_blank' href='$r[link]'><img src='/img/spo/thumb/$r[image]'/></a>");
 							}
 							$idx ++;
 						}

+ 1 - 1
www/functions.php

@@ -396,7 +396,7 @@
 		
 		$i = 1;
 		while ($i < sizeof($bot_kw)) {
-			if (strpos(strtolower($browser), $bot_kw[$i]) !== false){
+			if (strpos(strtolower($uagent), $bot_kw[$i]) !== false){
 				mysqli_close($con);
 				return;
 			}

+ 1 - 1
www/galeria/index.php

@@ -70,7 +70,7 @@
 				<?php
 					echo "<h3>$lng[gallery_albums]</h3>\n";
 					//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.dtime) DESC;");
+					$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'>\n";
 							echo "<table class='album_thumbnails'>\n";

+ 1 - 1
www/lablanca/index.php

@@ -130,7 +130,7 @@
 				if (date("M") <= 8 || (date("M") == 8 && date("D") < 25)){
 					$year --;
 				}
-				$q_years = mysqli_query($con, "SELECT year FROM festival WHERE year != " . date("Y") . " ORDER BY year;");
+				$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>$lng[lablanca_past_title]</h3>\n");