Bläddra i källkod

Fixed the ad window.

seavenois 9 år sedan
förälder
incheckning
e6d2a9fb82
2 ändrade filer med 17 tillägg och 10 borttagningar
  1. 8 8
      www/css/ui.css
  2. 9 2
      www/functions.php

+ 8 - 8
www/css/ui.css

@@ -501,23 +501,22 @@ div#comment_new input[type='submit']{
 ******************************************/
 div#ad{
 	border:						0.1em solid #000011;
-	width:						25%;
+	width:						45%;
 	max-width:					25em;
 	min-width:					12em;
-	max-height:					20em;
+	max-height:					25em;
 	position:					fixed;
 	bottom:						-25em;
 	left:						3em;
 	margin-bottom:				0;
 	box-shadow:					0 0 2em #111122;
-	border-top-left-radius:		1em;
-	border-top-right-radius:	1em;
+	border-bottom-left-radius:		0em;
+	border-bottom-right-radius:	0em;
 	transition:					bottom .5s ease-in-out;
 }
 
-
-div#ad h3{
-	margin-top:	0.3em;
+div#ad h3 a{
+	color:		#ffffff
 }
 
 div#ad div#ad_details{
@@ -543,7 +542,8 @@ div#ad div.entry div#ad_image_container{
 
 div#ad div.entry div#ad_image_container img{
 	max-height:	9em;
-	border:	0.1em solid #111111;
+	max-width:	100%;
+	border:		0.1em solid #111111;
 }
 
 div#ad div.entry a{

+ 9 - 2
www/functions.php

@@ -315,6 +315,13 @@
 		mysqli_query($con, 'UPDATE settings SET value = value + 1 WHERE name = "version";');
 	}
 	
+	/****************************************************
+        * Shows an ad at random. It does that one in three  *
+        * times, and only one per session (inserts a cookie *
+        * to know if the ad has been shown. A sponsor has   *
+        * more chances of having his ad popping the more it *
+	* contributes with Gasteizko Margolariak.           *
+        ****************************************************/
 	function ad($con, $lang, $lng){
 	$id = -1;
 		//If the user hasn't still see an add on this session
@@ -344,12 +351,12 @@
 				$q = mysqli_query($con, "SELECT name_$lang AS name, text_$lang AS text, image, address_$lang AS address, link, lat, lon FROM sponsor WHERE id = $id;");
 				$r = mysqli_fetch_array($q);
 				echo("<div id='ad' class='section'>\n");
+				echo("<h3 class='section_title'><a target='_blank' href='$r[link]'>$r[name]</a></h3>\n");
+				echo("<div class='entry'>\n");
 				echo("<div id='ad_details'>\n");
 				echo($lng['ad_title']);
 				echo("<img class='pointer' src='/img/misc/slid-close.png' onClick='closeAd();' />\n");
 				echo("</div>\n");
-				echo("<h3><a target='_blank' href='$r[link]'>$r[name]</a></h3>\n");
-				echo("<div class='entry'>\n");
 				if (strlen($r['image']) > 0){
 					echo("<div id='ad_image_container'>\n");
 					echo("<img src='/img/spo/miniature/$r[image]'/>\n");