Thread: [Phphtmllib-devel] SF.net SVN: phphtmllib:[3340] trunk/open2300/lib/modules/wxdate/page/WxDate .inc
Status: Beta
Brought to you by:
hemna
From: <he...@us...> - 2010-02-21 22:21:41
|
Revision: 3340 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3340&view=rev Author: hemna Date: 2010-02-21 22:21:32 +0000 (Sun, 21 Feb 2010) Log Message: ----------- test for date Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-21 22:17:29 UTC (rev 3339) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-21 22:21:32 UTC (rev 3340) @@ -15,6 +15,10 @@ parent::__construct('Hemna WX Station'); $this->wxdate = Request::singleton()->get("date", date("Y-m-d")); + //make sure we have a valid date here + if (empty($this->date) || is_null($this->date)) { + $this->date = date("Y-m-d"); + } //Log::singleton()->debug("use date of ".$this->wxdate); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-02-21 22:23:28
|
Revision: 3341 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3341&view=rev Author: hemna Date: 2010-02-21 22:23:15 +0000 (Sun, 21 Feb 2010) Log Message: ----------- changed the cache key to include the date Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-21 22:21:32 UTC (rev 3340) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-21 22:23:15 UTC (rev 3341) @@ -87,5 +87,13 @@ // $table->add_row(new TDtag(array('style' => 'vertical-align:top;width:510px;'),$right_div)); // return $table; } + + public function get_cache_key() { + return get_class($this).$this->wxdate; + } + + public function get_cache_lifetime() { + return 60; + } } ?> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-02-22 04:33:56
|
Revision: 3348 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3348&view=rev Author: hemna Date: 2010-02-22 04:33:50 +0000 (Mon, 22 Feb 2010) Log Message: ----------- pulled header Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 04:29:36 UTC (rev 3347) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 04:33:50 UTC (rev 3348) @@ -48,7 +48,7 @@ // } protected function left_block() { - $div = new DIVtag(array("style" => "margin-top:20px"), new WxDateCalendar()); + $div = new DIVtag(array("style" => "margin-top:0px"), new WxDateCalendar()); return $div; } @@ -84,8 +84,9 @@ $c = new Container(); - $c->add( H3tag::factory("Weather on ".date("l M d, Y", strtotime($this->wxdate))), - Brtag::factory(1), $right_div ); + $c->add( //H3tag::factory("Weather on ".date("l M d, Y", strtotime($this->wxdate))), + //Brtag::factory(1), + $right_div ); return $c; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-02-22 06:50:48
|
Revision: 3353 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3353&view=rev Author: hemna Date: 2010-02-22 06:50:42 +0000 (Mon, 22 Feb 2010) Log Message: ----------- add it in Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 06:46:13 UTC (rev 3352) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 06:50:42 UTC (rev 3353) @@ -57,16 +57,14 @@ $filename = $config->get('videodir')."/".$curdate."/timelapse.flv"; //$cam_title_div->add($filename); if (file_exists($filename)) { - $url = '/video/player.swf?file=/video/'.$curdate.'/timelapse.flv&autostart=1'; + $url = '/video/player.swf?file=/video/'.$curdate.'/timelapse.flv&autostart=0'; $obj = new ObjectTag(array("data" => $url, "type" => "application/x-shockwave-flash", "quality" => "high", "wmode" => "transparent", "pluginspage" => "http://www.adobe.com/go/getflashplayer", "width" => "320", "height" => "240"), '<param name="movie" value="'.$url.'"><param name="allowFullScreen" value="true">'); - $cam_href = new Atag(array('href' => '/video/player.swf?file=/video/'.$curdate.'/timelapse.flv&autostart=1', 'class' => 'lightview', - 'rel' => 'flash', 'title' => 'TimeLapse :: '.$curdate.' :: width:640, height:480'), - "View Timelapse Video"); + $div->add($obj); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-02-22 06:56:02
|
Revision: 3354 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3354&view=rev Author: hemna Date: 2010-02-22 06:55:56 +0000 (Mon, 22 Feb 2010) Log Message: ----------- fixed date formatting Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 06:50:42 UTC (rev 3353) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 06:55:56 UTC (rev 3354) @@ -53,7 +53,7 @@ //only show the flash overlay if we //have today's video file on disk - $curdate = date("ymd", strtotime($this->date)); + $curdate = date("Ymd", strtotime($this->date)); $filename = $config->get('videodir')."/".$curdate."/timelapse.flv"; //$cam_title_div->add($filename); if (file_exists($filename)) { @@ -64,8 +64,7 @@ "width" => "320", "height" => "240"), '<param name="movie" value="'.$url.'"><param name="allowFullScreen" value="true">'); - $div->add($obj); - + $div->add(BRtag::factory(2),$obj); } return $div; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-02-22 07:05:29
|
Revision: 3355 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3355&view=rev Author: hemna Date: 2010-02-22 07:05:20 +0000 (Mon, 22 Feb 2010) Log Message: ----------- picker Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 06:55:56 UTC (rev 3354) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-02-22 07:05:20 UTC (rev 3355) @@ -16,10 +16,10 @@ $this->wxdate = Request::singleton()->get("date", date("Y-m-d")); //make sure we have a valid date here - if (empty($this->date) || is_null($this->date)) { - $this->date = date("Y-m-d"); + if (empty($this->wxdate) || is_null($this->wxdate)) { + $this->wxdate = date("Y-m-d"); } - //Log::singleton()->debug("use date of ".$this->wxdate); + Log::singleton()->debug("use date of ".$this->wxdate); } @@ -53,7 +53,7 @@ //only show the flash overlay if we //have today's video file on disk - $curdate = date("Ymd", strtotime($this->date)); + $curdate = date("Ymd", strtotime($this->wxdate)); $filename = $config->get('videodir')."/".$curdate."/timelapse.flv"; //$cam_title_div->add($filename); if (file_exists($filename)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-03-15 17:13:29
|
Revision: 3434 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3434&view=rev Author: hemna Date: 2010-03-15 17:13:01 +0000 (Mon, 15 Mar 2010) Log Message: ----------- added download link Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-03-08 00:20:27 UTC (rev 3433) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-03-15 17:13:01 UTC (rev 3434) @@ -38,14 +38,25 @@ $filename = $config->get('videodir')."/".$curdate."/timelapse.flv"; //$cam_title_div->add($filename); if (file_exists($filename)) { - $url = '/video/player.swf?file=/video/'.$curdate.'/timelapse.flv&autostart=0'; + $flv_file = "/video/".$curdate."/timelapse.flv"; + $url = '/video/player.swf?file='.$flv_file.'&autostart=0'; $obj = new ObjectTag(array("data" => $url, "type" => "application/x-shockwave-flash", "quality" => "high", "wmode" => "transparent", "pluginspage" => "http://www.adobe.com/go/getflashplayer", "width" => "320", "height" => "240"), '<param name="movie" value="'.$url.'"><param name="allowFullScreen" value="true">'); + $rp = realpath($GLOBALS["path_base"]."/htdocs".$flv_file); + $fp = fopen($rp,"r"); + $str = "Download Movie"; + if ($fp) { + $fstat = fstat($fp); + $str .= " (".$this->byte_size($fstat["size"]).")"; + fclose($fp); + } + $div->add(BRtag::factory(2),$obj); + $div->add(BRtag::factory(2),new Atag(array("href" => $flv_file, "class" => "download"), $str)); } return $div; @@ -93,6 +104,23 @@ // $table->add_row(new TDtag(array('style' => 'vertical-align:top;width:510px;'),$right_div)); // return $table; } + + function byte_size($bytes) { + $size = $bytes / 1024; + if ($size < 1024) { + $size = number_format($size, 2); + $size .= ' KB'; + } else { + if ($size / 1024 < 1024) { + $size = number_format($size / 1024, 2); + $size .= ' MB'; + } else if ($size / 1024 / 1024 < 1024) { + $size = number_format($size / 1024 / 1024, 2); + $size .= ' GB'; + } + } + return $size; + } public function get_cache_key() { return get_class($this).$this->wxdate; @@ -102,4 +130,4 @@ return 60; } } -?> \ No newline at end of file +?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <he...@us...> - 2010-07-12 21:35:09
|
Revision: 3530 http://phphtmllib.svn.sourceforge.net/phphtmllib/?rev=3530&view=rev Author: hemna Date: 2010-07-12 21:35:01 +0000 (Mon, 12 Jul 2010) Log Message: ----------- pulled log Modified Paths: -------------- trunk/open2300/lib/modules/wxdate/page/WxDate.inc Modified: trunk/open2300/lib/modules/wxdate/page/WxDate.inc =================================================================== --- trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-07-11 20:53:24 UTC (rev 3529) +++ trunk/open2300/lib/modules/wxdate/page/WxDate.inc 2010-07-12 21:35:01 UTC (rev 3530) @@ -21,7 +21,7 @@ if (empty($this->wxdate) || is_null($this->wxdate)) { $this->wxdate = date("Y-m-d"); } - Log::singleton()->debug("use date of ".$this->wxdate); + //Log::singleton()->debug("use date of ".$this->wxdate); } protected function left_block() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |