Skip to content
Permalink
Browse files

[15] Add function for get date().

Signed-off-by: Ivan <Dfyztimy@list.ru>
  • Loading branch information...
Hantet committed Jul 6, 2010
1 parent d1663e3 commit b14ad309f6dcd085eb4a02e1b8b5e37f145d4d01
Showing with 19 additions and 13 deletions.
  1. +2 −4 config.php
  2. +1 −0 lib/classes.php
  3. +11 −2 lib/create.php
  4. +4 −5 lib/html.php
  5. +1 −2 send.php
@@ -41,12 +41,10 @@ function get($id)
## CheckVersion: Check new version in git page of project (boolean).
## version: Current version of bug-tracker. Do not change!
## checkdiff: Different in days for recheck updates.
## defaultdate: Current php time-zone of server.
##################################################################################################*/
"CheckVersion" => false,
"version" => 14,
"checkdiff" => 2,
"defaultdate" => date_default_timezone_set('Europe/Moscow'));
"version" => 15,
"checkdiff" => 2
if(in_array($id,array_keys($arr)))
return $arr[$id];
@@ -18,6 +18,7 @@ public function GetSections();
public function GetPercent($id,$one=false);
public function GetPriority($id,$one=false);
public function GetStatus($id,$one=false);
public function GetDate($format);
public function SetStatus($statusid=-1,$id=-1);
@@ -76,7 +76,7 @@ public function GetPriority($all,$one=false)
$prior = $sql->fetch($sql->exe($cfg->get("realmd"),"SELECT `name`,`color` FROM `bt_priority` WHERE `id` = '".$id."' LIMIT 1"));
return '<font color="'.$prior['color'].'">'.$prior['name'].'</font>';
}
public function GetStatus($all,$one=false)
{
$cfg = new config;
@@ -86,7 +86,16 @@ public function GetStatus($all,$one=false)
return $status;
return $sql->res($cfg->get("realmd"),"SELECT `name` FROM `bt_status` WHERE `id` = '".$status."' LIMIT 1");
}
public function GetDate($format)
{
if(isset($format))
{
date_default_timezone_set('Europe/Moscow');
return date($format);
}
}
public function SetStatus($statusid=-1,$id=-1)
{
$cfg = new config;
@@ -499,11 +499,10 @@ public function admin()
}
public function CheckVersion()
{
$main = new main;
$cfg = new config;
if(!$cfg->get("CheckVersion"))
return;
$cfg->get("defaultdate");
$created = true;
$fp = @fopen("lib/lastupdate", 'r');
@@ -512,10 +511,10 @@ public function CheckVersion()
$str = @fgets($fp, 1024);
@fclose($fp);
if($str == date("d"))
if($str == $main->GetDate("d"))
return;
if(date("d") % $cfg->get("checkdiff") != 0 || !$created)
if($main->GetDate("d") % $cfg->get("checkdiff") != 0 || !$created)
{
$current = $cfg->get("version");
$fp = fopen("http://github.com/Hantet/BugTracker/", "r");
@@ -555,7 +554,7 @@ public function CheckVersion()
{
fclose($fp);
$fp = fopen("lib/lastupdate", 'w');
fwrite($fp,date("d"));
fwrite($fp,$main->GetDate("d"));
}
}
fclose($fp);
@@ -26,8 +26,7 @@
$t1 = true;
$t2 = true;
$query = "";
$cfg->get("defaultdate");
$date = date("Y-m-d H:i:s");
$date = $main->GetDate("Y-m-d H:i:s");
do
{

0 comments on commit b14ad30

Please sign in to comment.
You can’t perform that action at this time.