use require_once and not include_once when including other php code (included files...
authorDaniel Hromada <hromi@Aphrodité.(none)>
Wed, 26 Jan 2011 21:47:26 +0000 (22:47 +0100)
committerDaniel Hromada <hromi@Aphrodité.(none)>
Wed, 26 Jan 2011 21:47:26 +0000 (22:47 +0100)
if ever some event returned false value, will call  display event in order to show the error message etc.

wwwroot/inc/eventz.inc

index 6464345536b65bdd71380acbcbfe2c9970c0be55..a5b1d9fbcdc12a0fd17c6125742f669a1f4ebd8b 100644 (file)
@@ -29,7 +29,7 @@ elseif (is_file(INCLUDE_DIR."eventz/$event.inc")) {
                || ($event_node['node_permission']=='master')
                || ($event=='display')
        ) {
-               include_once(INCLUDE_DIR."eventz/$event.inc");
+               require_once(INCLUDE_DIR."eventz/$event.inc");
                $status=$event();
                $_SESSION['eventz'][$event]=true;
 
@@ -46,14 +46,18 @@ else {
        $status=false;
 }
 
+if (!$status) {
+       require_once(INCLUDE_DIR."eventz/display.inc");
+       display();      
+}
 
-if ($status>1) {
+elseif ($status>1) {
        Header("Location: /id/".$status."/");
 }
 
 elseif ($status) {
        Header("Location: /id/".$node['node_id']."/");
-}
+} 
 
 
 ?>
This page took 0.096483 seconds and 4 git commands to generate.