phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: wcm/website/templates frame.tpl,1.7,1.8


From: Miles Lott <address@hidden>
Subject: [Phpgroupware-cvs] CVS: wcm/website/templates frame.tpl,1.7,1.8
Date: Sun, 24 Feb 2002 19:51:57 -0500

Update of /cvsroot/phpgroupware/wcm/website/templates
In directory subversions:/tmp/cvs-serv7859/website/templates

Modified Files:
        frame.tpl 
Log Message:
Add some expiration code into the display template; array data for 
site,page,element
now written to output file within php tags



Index: frame.tpl
===================================================================
RCS file: /cvsroot/phpgroupware/wcm/website/templates/frame.tpl,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** frame.tpl   24 Feb 2002 22:36:40 -0000      1.7
--- frame.tpl   25 Feb 2002 00:51:55 -0000      1.8
***************
*** 1,4 ****
  <!-- BEGIN framing_table_start -->
- <?php /* Hello, this is the template file... */ ?>
  {header}
  <!-- framing_table_start start -->
--- 1,3 ----
***************
*** 106,108 ****
--- 105,158 ----
  <!-- framing_table_end stop -->
  {footer}
+ <?php
+       function refresh_page($name='')
+       {
+               return;
+ 
+               $login  = 'anonymous';
+               $passwd = 'anonymous1';
+               $phpgw_info = array();
+ 
+               $GLOBALS['phpgw_info']['flags'] = array(
+                       'currentapp' => 'login',
+                       'login'      => True,
+                       'noheader'   => True,
+                       'nonavbar'   => True
+               );
+               include('/usr/local/apache/htdocs/phpgroupware/header.inc.php');
+ 
+               if(!$GLOBALS['sessionid'])
+               {
+                       $GLOBALS['sessionid'] = 
$GLOBALS['phpgw']->session->create($login,$passwd,'text');
+               }
+ 
+               $bo = CreateObject('wcm.bopage');
+               $page_id = $bo->name2id($name);
+               $bo->publish($page_id);
+       }
+ 
+       $time = time();
+       if(($page['date'] - $time) > $page['expire'])
+       {
+               /*
+               echo '<br>page is old...';
+               echo ' ' . ($time - $page['date']);
+               */
+               @refresh_page($page['name']);
+               exit;
+       }
+       while(list(,$element) = @each($ele))
+       {
+               if(($element['date'] - $time) > $element['expire'])
+               {
+                       /*
+                       echo '<br>element ' . $element['name'] . ' is old...';
+                       echo ' ' . ($time - $element['date']);
+                       */
+                       @refresh_page($page['name']);
+                       exit;
+               }
+       }
+ ?>
+ 
  <!-- END framing_table_end -->




reply via email to

[Prev in Thread] Current Thread [Next in Thread]