コード例 #1
0
 function display($page, $addfooter = true)
 {
     ob_start();
     // we use a relitive path because otherwise we need
     // as many compile directories as template
     // and to make things easy for users we don't want them
     // to have to chmod 777 too many directories.
     parent::display($page);
     $o = ob_get_contents();
     ob_end_clean();
     /* this doesn't work properly yet as the page stays cached in the browser even when things change */
     /* so we'll make it always fresh until this is worked through.
             if(!defined('IN_BBLOG_ADMIN')) {
                $lmdate = gmdate('D, d M Y H:i:s \G\M\T',$this->lastmodified);
                header('Last-Modified: '.$lmdate);
                if ($_SERVER["HTTP_IF_MODIFIED_SINCE"] == $lmdate){
        		 	  header("HTTP/1.1 304 Not Modified");
                    exit;
     		   }
             } else { // we want the page always to be fresh :)
                   // borrowed from wordpress :
                    @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 				// Date in the past
                    @header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
                    @header("Cache-Control: no-store, no-cache, must-revalidate"); 	// HTTP/1.1
                    @header("Cache-Control: post-check=0, pre-check=0", false);
                    @header("Pragma: no-cache"); 									// HTTP/1.0
     
               } */
     echo $o;
     if ($addfooter) {
         echo buildfoot();
     }
 }
コード例 #2
0
 function display($page, $addfooter = true)
 {
     ob_start();
     parent::display($page);
     $o = ob_get_contents();
     ob_end_clean();
     echo $o;
     if ($addfooter) {
         echo buildfoot();
     }
 }
コード例 #3
0
 function display($page, $addfooter = true, $caching = true)
 {
     /** @todo uncomment following line */
     //ob_end_clean();
     ob_start();
     // we use a relitive path because otherwise we need
     // as many compile directories as template
     // and to make things easy for users we don't want them
     // to have to chmod 777 too many directories.
     if (defined('CACHING') && empty($_POST)) {
         if ($caching && $this->smartyObj->compile_id != 'admin') {
             $this->smartyObj->caching = $caching;
             // concatenate REQUEST_URI because of lack of support for IIS
             $request_uri = $_SERVER["SCRIPT_NAME"];
             if (!empty($_SERVER["QUERY_STRING"])) {
                 $request_uri .= "?" . $_SERVER["QUERY_STRING"];
             }
             $cache_id = md5($this->db->tablemd5(TBL_PREFIX . '%') . $request_uri . $this->gzip);
             $this->smartyObj->display($page, $cache_id);
             if ($this->gzip) {
                 header("Content-Encoding: gzip");
                 header("Vary: Accept-Encoding");
             }
         } else {
             $this->smartyObj->display($page);
         }
     } else {
         $this->smartyObj->display($page);
     }
     //$o = ob_get_contents();
     //ob_end_clean();
     /* this doesn't work properly yet as the page stays cached in the browser even when things change */
     /* so we'll make it always fresh until this is worked through.
             if(!defined('IN_BBLOG_ADMIN')) {
                $lmdate = gmdate('D, d M Y H:i:s \G\M\T',$this->lastmodified);
                header('Last-Modified: '.$lmdate);
                if ($_SERVER["HTTP_IF_MODIFIED_SINCE"] == $lmdate){
                       header("HTTP/1.1 304 Not Modified");
                    exit;
                }
             } else { // we want the page always to be fresh :)
                   // borrowed from wordpress :
                    @header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); 				// Date in the past
                    @header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); // always modified
                    @header("Cache-Control: no-store, no-cache, must-revalidate"); 	// HTTP/1.1
                    @header("Cache-Control: post-check=0, pre-check=0", false);
                    @header("Pragma: no-cache"); 									// HTTP/1.0
     
               }
             echo $o;
             */
     if ($addfooter) {
         echo buildfoot();
     }
 }