moved the old git poc code off and away from the main directory
[gwvp.git] / gwvplib / gwvpweb.php
index c88e302..f01e537 100644 (file)
@@ -3,6 +3,9 @@
 // this function is the initial insertion point for the web calls, here we need to determine where we go
 global $CALL_ME_FUNCTIONS;
 
+// the home_page_provders bit is an array 
+global $HOME_PAGE_PROVIDERS;
+
 $MENU_ITEMS["00home"]["text"] = "Home";
 $MENU_ITEMS["00home"]["link"] = "$BASE_URL";
 
@@ -155,13 +158,23 @@ function gwvp_MenuBuilder()
        foreach($MENU_ITEMS as $key => $val) {
                $link = $val["link"];
                $text = $val["text"];
-               $q = "";
-               if(isset($_REQUEST["q"])) $q = $BASE_URL."/".$_REQUEST["q"];
-               else $q = $BASE_URL;
-               if($q == $link) $menucolor = " bgcolor=\"#ffdddd\"";
-               else $menucolor = "";
                
-               error_log("checking $q against $link now $menucolor");
+               // TODO: redo this bit with stristr to find urls - special case for home
+               $menucolor = "";
+               if(isset($_REQUEST["q"])) {
+                       $extlink = str_replace("$BASE_URL/", "", $link);
+                       error_log("trying to do replace of $BASE_URL in $link, got $extlink for ".$_REQUEST["q"]);
+                       if(stristr($_REQUEST["q"], $extlink)!==false) {
+                               $menucolor = " bgcolor=\"#ffdddd\"";
+                               
+                       }
+               } else {
+                       // special case for home
+                       if($link == $BASE_URL) $menucolor = " bgcolor=\"#ffdddd\"";
+               }
+               
+               
+               
                
                if(isset($val["userlevel"])) {
                        if(gwvp_CheckAuthLevel($val["userlevel"])) {
@@ -191,7 +204,16 @@ function gwvp_LoginBuilder()
 // builds the body structure
 function gwvp_BodyBuilder()
 {
-       echo "I AM THE MAIN BODY, FEAR ME!!!!";
+       global $HOME_PAGE_PROVIDERS;
+       
+       echo "I AM THE MAIN BODY, FEAR ME!!!! - have no idea whats going to go here";
+       if(isset($HOME_PAGE_PROVIDERS)) {
+               ksort($HOME_PAGE_PROVIDERS);
+               foreach($HOME_PAGE_PROVIDERS as $provider) {
+                       error_log("Loading home_page_provider, $provider");
+                       $provider();
+               }
+       }
 }
 
 // builds the tail structure
@@ -200,4 +222,18 @@ function gwvp_TailBuilder()
        echo "<font size=\"-1\"><i>Copyright 2011, PJR - licensed under GPL</i></font>";
 }
 
+function gwvp_fourZeroThree()
+{
+       error_log("403 called");
+       header("HTTP/1.0 403 Permission Denied");
+}
+
+function gwvp_fourZeroFour()
+{
+       error_log("404 called");
+       header("HTTP/1.0 404 No Such Thing");
+}
+
+
+
 ?>
\ No newline at end of file