Browse Source

Fixing the offset problem

vbracco 18 years ago
parent
commit
40a7939210
5 changed files with 8 additions and 7 deletions
  1. 2 1
      admin/form.autosave.php
  2. 1 1
      admin/index.php
  3. 1 1
      api.php
  4. 3 3
      index.php
  5. 1 1
      rss.php

+ 2 - 1
admin/form.autosave.php View File

1
 <?php
1
 <?php
2
+if(!defined('entry'))define('entry', true);
2
 
3
 
3
 session_start();
4
 session_start();
4
 
5
 
11
 	$type = getMethod();
12
 	$type = getMethod();
12
 	$id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid'];
13
 	$id = ($type=='GET') ? $_GET['autosaveid'] : $_POST['autosaveid'];
13
 	$_SESSION[$id] = $_SERVER['QUERY_STRING'];
14
 	$_SESSION[$id] = $_SERVER['QUERY_STRING'];
14
-	echo date('H:i | d/m/y',time());
15
+	echo gmdate('H:i | d/m/y',time()+transform_offset($conf->offsetTime));
15
 }
16
 }
16
 
17
 
17
 function loadForm() {
18
 function loadForm() {

+ 1 - 1
admin/index.php View File

348
 					
348
 					
349
 					if ($tumble->contarRegistros()>0) {				
349
 					if ($tumble->contarRegistros()>0) {				
350
 						while($register = mysql_fetch_array($rs)) {			
350
 						while($register = mysql_fetch_array($rs)) {			
351
-							$formatedDate = date("M d", strtotime($register["date"]));
351
+							$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
352
 							$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";							
352
 							$permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";							
353
 							
353
 							
354
 							$textile = new Textile();				
354
 							$textile = new Textile();				

+ 1 - 1
api.php View File

104
 						break;
104
 						break;
105
 				}
105
 				}
106
 				$url = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
106
 				$url = $conf->urlGelato."/index.php/post/".$register["id_post"]."/";
107
-				$formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"]));
107
+				$formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"])+transform_offset($conf->offsetTime));
108
 ?>
108
 ?>
109
 
109
 
110
 				<item>
110
 				<item>

+ 3 - 3
index.php View File

84
                 if ($tumble->contarRegistros()>0) {
84
                 if ($tumble->contarRegistros()>0) {
85
                         $dateTmp = null;          
85
                         $dateTmp = null;          
86
                         while($register = mysql_fetch_array($rs)) {
86
                         while($register = mysql_fetch_array($rs)) {
87
-								$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
87
+								$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
88
                                 if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
88
                                 if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; }
89
 								$strEnd=($conf->urlFriendly) ? "/" : "";
89
 								$strEnd=($conf->urlFriendly) ? "/" : "";
90
 								$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
90
 								$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
183
         } else {
183
         } else {
184
                 $register = $tumble->getPost($id_post);
184
                 $register = $tumble->getPost($id_post);
185
                 
185
                 
186
-				$formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
186
+				$formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime));
187
 				$strEnd=($conf->urlFriendly) ? "/" : "";
187
 				$strEnd=($conf->urlFriendly) ? "/" : "";
188
 				$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
188
 				$permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
189
                 
189
                 
272
 						
272
 						
273
 						$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
273
 						$commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "<a href=\"".$rowComment["web"]."\" rel=\"external\">".$rowComment["username"]."</a>";
274
 						$input = array("{Id_Comment}", "{Comment_Author}", "{Date}", "{Comment}");				
274
 						$input = array("{Id_Comment}", "{Comment_Author}", "{Date}", "{Comment}");				
275
-						$output = array($rowComment["id_comment"], $commentAuthor, date("d.m.y", strtotime($rowComment["comment_date"])), $rowComment["content"]);
275
+						$output = array($rowComment["id_comment"], $commentAuthor, gmdate("d.m.y", strtotime($rowComment["comment_date"])+transform_offset($conf->offsetTime)), $rowComment["content"]);
276
 						$template->cargarPlantillaConBloque($input, $output, "template_comments", "comments");
276
 						$template->cargarPlantillaConBloque($input, $output, "template_comments", "comments");
277
 					}
277
 					}
278
 					$template->mostrarPlantillaConBloque();
278
 					$template->mostrarPlantillaConBloque();

+ 1 - 1
rss.php View File

84
 			$url = htmlspecialchars($url);
84
 			$url = htmlspecialchars($url);
85
 			$strEnd=($conf->urlFriendly) ? "/" : "";
85
 			$strEnd=($conf->urlFriendly) ? "/" : "";
86
 			$url = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
86
 			$url = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd;
87
-			$formatedDate = date("r", strtotime($register["date"])+transform_offset($conf->offsetTime));
87
+			$formatedDate = gmdate("r", strtotime($register["date"])+transform_offset($conf->offsetTime));
88
 ?>
88
 ?>
89
 
89
 
90
 			<item>
90
 			<item>