| 
      
      
      From: Benjamin C. <bc...@us...> - 2001-07-10 03:15:23
      
     | 
| Update of /cvsroot/phpbt/phpbt
In directory usw-pr-cvs1:/tmp/cvs-serv10698
Modified Files:
	include.php 
Log Message:
Get rid of the logout link entirely if not logged in
Index: include.php
===================================================================
RCS file: /cvsroot/phpbt/phpbt/include.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- include.php	2001/07/02 03:20:50	1.8
+++ include.php	2001/07/10 03:15:20	1.9
@@ -121,13 +121,22 @@
 }
 
 class templateclass extends Template {
-	function pparse($target, $handle, $append = false) {
-		global $auth;
-		
-		$this->set_var('loggedinas', $auth->auth['uid'] ? $auth->auth['email'] : '');
-		print $this->finish($this->parse($target, $handle, $append));
-		return false;
-	}
+  function pparse($target, $handle, $append = false) {
+    global $auth;
+    
+    $this->set_block('wrap', 'logoutblock', 'lblock');
+    if ($auth->auth['uid']) {
+      $this->set_var('loggedinas', $auth->auth['email']);
+      $this->parse('lblock', 'logoutblock', true);
+    } else {
+      $this->set_var(array(
+        'loggedinas' => '',
+        'lblock' => ''
+        ));
+    }
+    print $this->finish($this->parse($target, $handle, $append));
+    return false;
+  }
 }
 
 $t = new templateclass('templates','keep');
@@ -136,9 +145,9 @@
   'me' => $PHP_SELF,
   'error' => '',
   'cssfile' => $cssfile));
-	
+  
 // End classes -- Begin helper functions 
-	
+  
 ///
 /// Show text to the browser - escape hatch
 function show_text($text, $iserror = false) {
 |