aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/init.inc.php5
-rw-r--r--include/page_header.php30
-rw-r--r--include/page_tail.php19
3 files changed, 54 insertions, 0 deletions
diff --git a/include/init.inc.php b/include/init.inc.php
index 19e308441..6b3af68bb 100644
--- a/include/init.inc.php
+++ b/include/init.inc.php
@@ -16,6 +16,11 @@
* the Free Software Foundation; *
* *
***************************************************************************/
+// determine the initial instant to indicate the generation time of this page
+$t1 = explode( ' ', microtime() );
+$t2 = explode( '.', $t1[0] );
+$t2 = $t1[1].'.'.$t2[1];
+
define( 'PREFIX_INCLUDE', '' );
include_once( './include/config.inc.php' );
diff --git a/include/page_header.php b/include/page_header.php
new file mode 100644
index 000000000..68bb17993
--- /dev/null
+++ b/include/page_header.php
@@ -0,0 +1,30 @@
+<?php
+
+//
+// Start output of page
+//
+$vtp = new VTemplate;
+$handle = $vtp->Open( './template/'.$user['template'].'/header.vtp' );
+$vtp->setGlobalVar( $handle, 'charset', $lang['charset'] );
+$vtp->setGlobalVar( $handle, 'style', './template/'.$user['template'].'/'.$user['template'].'.css');
+
+ // refresh
+ if ( isset( $refresh ) && $refresh >0 && isset($url_link))
+ {
+ $vtp->addSession( $handle, 'refresh' );
+ $vtp->setVar( $handle, 'refresh.time', $refresh );
+ $url = $url_link.'&amp;slideshow='.$refresh;
+ $vtp->setVar( $handle, 'refresh.url', add_session_id( $url ) );
+ $vtp->closeSession( $handle, 'refresh' );
+ }
+
+$vtp->setGlobalVar( $handle, 'title', $title );
+$vtp->setVarF( $handle, 'header', './template/'.$user['template'].'/header.htm' );
+
+//
+// Generate the page
+//
+
+$code = $vtp->Display( $handle, 0 );
+echo $code;
+?> \ No newline at end of file
diff --git a/include/page_tail.php b/include/page_tail.php
new file mode 100644
index 000000000..d4548f170
--- /dev/null
+++ b/include/page_tail.php
@@ -0,0 +1,19 @@
+<?php
+$handle = $vtp->Open( './template/'.$user['template'].'/footer.vtp' );
+
+//------------------------------------------------------------- generation time
+$time = get_elapsed_time( $t2, get_moment() );
+$vtp->setGlobalVar( $handle, 'time', $time );
+
+$vtp->setGlobalVar( $handle, 'generation_time', $lang['generation_time'] );
+$vtp->setGlobalVar( $handle, 'version', $conf['version'] );
+$vtp->setGlobalVar( $handle, 'site_url', $conf['site_url'] );
+$vtp->setVarF( $handle, 'footer', './template/'.$user['template'].'/footer.htm' );
+
+//
+// Generate the page
+//
+
+$code = $vtp->Display( $handle, 0 );
+echo $code;
+?> \ No newline at end of file