From 40a7939210d1cecf0425e47cd417a9d43b44597d Mon Sep 17 00:00:00 2001 From: vbracco Date: Wed, 19 Sep 2007 21:54:14 +0000 Subject: [PATCH] Fixing the offset problem --- admin/form.autosave.php | 3 ++- admin/index.php | 2 +- api.php | 2 +- index.php | 6 +++--- rss.php | 2 +- 5 files changed, 8 insertions(+), 7 deletions(-) diff --git a/admin/form.autosave.php b/admin/form.autosave.php index e71cd2c..6e7b0a4 100644 --- a/admin/form.autosave.php +++ b/admin/form.autosave.php @@ -1,4 +1,5 @@ offsetTime)); } function loadForm() { diff --git a/admin/index.php b/admin/index.php index 88f6c09..5579446 100644 --- a/admin/index.php +++ b/admin/index.php @@ -348,7 +348,7 @@ if ($user->isAdmin()) { if ($tumble->contarRegistros()>0) { while($register = mysql_fetch_array($rs)) { - $formatedDate = date("M d", strtotime($register["date"])); + $formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime)); $permalink = $conf->urlGelato."/index.php/post/".$register["id_post"]."/"; $textile = new Textile(); diff --git a/api.php b/api.php index 35a3232..221941b 100644 --- a/api.php +++ b/api.php @@ -104,7 +104,7 @@ if(!defined('entry')) define('entry',true); break; } $url = $conf->urlGelato."/index.php/post/".$register["id_post"]."/"; - $formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"])); + $formatedDate = gmdate("D, d M Y H:i:s \G\M\T", strtotime($register["date"])+transform_offset($conf->offsetTime)); ?> diff --git a/index.php b/index.php index 7366149..786253a 100644 --- a/index.php +++ b/index.php @@ -84,7 +84,7 @@ $template = new plantillas($conf->template); if ($tumble->contarRegistros()>0) { $dateTmp = null; while($register = mysql_fetch_array($rs)) { - $formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime)); + $formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime)); if ( $dateTmp != null && $formatedDate == $dateTmp ) { $formatedDate = ""; } else { $dateTmp = $formatedDate; } $strEnd=($conf->urlFriendly) ? "/" : ""; $permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd; @@ -183,7 +183,7 @@ $template = new plantillas($conf->template); } else { $register = $tumble->getPost($id_post); - $formatedDate = date("M d", strtotime($register["date"])+transform_offset($conf->offsetTime)); + $formatedDate = gmdate("M d", strtotime($register["date"])+transform_offset($conf->offsetTime)); $strEnd=($conf->urlFriendly) ? "/" : ""; $permalink = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd; @@ -272,7 +272,7 @@ $template = new plantillas($conf->template); $commentAuthor = ($rowComment["web"]=="") ? $rowComment["username"] : "".$rowComment["username"].""; $input = array("{Id_Comment}", "{Comment_Author}", "{Date}", "{Comment}"); - $output = array($rowComment["id_comment"], $commentAuthor, date("d.m.y", strtotime($rowComment["comment_date"])), $rowComment["content"]); + $output = array($rowComment["id_comment"], $commentAuthor, gmdate("d.m.y", strtotime($rowComment["comment_date"])+transform_offset($conf->offsetTime)), $rowComment["content"]); $template->cargarPlantillaConBloque($input, $output, "template_comments", "comments"); } $template->mostrarPlantillaConBloque(); diff --git a/rss.php b/rss.php index b5918d3..01eaf1c 100644 --- a/rss.php +++ b/rss.php @@ -84,7 +84,7 @@ if(!defined('entry')) define('entry',true); $url = htmlspecialchars($url); $strEnd=($conf->urlFriendly) ? "/" : ""; $url = $conf->urlGelato.($conf->urlFriendly?"/post/":"/index.php?post=").$register["id_post"].$strEnd; - $formatedDate = date("r", strtotime($register["date"])+transform_offset($conf->offsetTime)); + $formatedDate = gmdate("r", strtotime($register["date"])+transform_offset($conf->offsetTime)); ?>