Explorar el Código

Issue #25. server time offset.

vbracco hace 17 años
padre
commit
cc7f54dcb9
Se han modificado 3 ficheros con 12 adiciones y 3 borrados
  1. 1 1
      admin/index.php
  2. 10 1
      classes/functions.php
  3. 1 1
      index.php

+ 1 - 1
admin/index.php Ver fichero

@@ -236,7 +236,7 @@ if ($user->isAdmin()) {
236 236
 								
237 237
 							}
238 238
 							
239
-							$date = ($isEdition) ? strtotime($post["date"]) : time();
239
+							$date = ($isEdition) ? strtotime($post["date"]) : gmmktime();
240 240
 							$title = ($isEdition) ? htmlspecialchars(stripslashes($post["title"])) : "";
241 241
 							$body = ($isEdition) ? stripslashes($post["description"]) : "";
242 242
 							$url = ($isEdition) ? $post["url"] : "";

+ 10 - 1
classes/functions.php Ver fichero

@@ -279,7 +279,16 @@
279 279
 	}
280 280
 	
281 281
 	function transform_offset($offset){
282
-		
282
+		$sp = strpos($offset , ".")? explode("." , $offset) : false;
283
+		if(is_array($sp)){
284
+			$minutes = strval($sp[1]);
285
+			$off_h = $sp[0]*3600;
286
+			$off_m = (($minutes*60)/100)*60;
287
+			$off = $off_h+$off_m;
288
+		} else {
289
+			$off = ($offset*3600);
290
+		}
291
+		return $off;
283 292
 	}
284 293
 	
285 294
 	function getLangs() {

+ 1 - 1
index.php Ver fichero

@@ -97,7 +97,7 @@
97 97
                 if ($tumble->contarRegistros()>0) {
98 98
                         $fecha = null;          
99 99
                         while($register = mysql_fetch_array($rs)) {
100
-                                $formatedDate = date("M d", strtotime($register["date"]));
100
+								$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offset_time));
101 101
                                 if ( $fecha != null && $formatedDate == $fecha ) { $formatedDate = ""; } else { $fecha = $formatedDate; }
102 102
                                 $permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
103 103