function jabRouteBlog($blog) { jabSetAuthContext("blog"); jabSetRouteHandlerPath(dirname(__FILE__)); jabRoute("get", $blog['routePrefix'] . "/index/{page}", "blog_controller.php", "index", $blog); jabRoute("get", $blog['routePrefix'] . "/fullindex", "blog_controller.php", "fullindex", $blog); jabRoute("get", $blog['routePrefix'] . "/drafts", "blog_controller.php", "drafts", $blog); jabRoute("get", $blog['routePrefix'] . "/edit/new", "blog_controller.php", "new_post", $blog); jabRoute("get", $blog['routePrefix'] . "/edit/{id}", "blog_controller.php", "edit_article_get", $blog); jabRoute("post", $blog['routePrefix'] . "/edit/{id}", "blog_controller.php", "edit_article_post", $blog); jabRoute("get;post", $blog['routePrefix'] . "/delete/{id}", "blog_controller.php", "delete_post_{httpmethod}", $blog); jabRoute("get;post", $blog['routePrefix'] . "/posts/{id}/*", "blog_controller.php", "view_post_{httpmethod}", $blog); jabRoute("get", $blog['routePrefix'] . "/comments/accept/{articleid}/{commentid}", "blog_controller.php", "accept_comment", $blog); jabRoute("get", $blog['routePrefix'] . "/comments/reject/{articleid}/{commentid}", "blog_controller.php", "reject_comment", $blog); jabRoute("get", $blog['routePrefix'] . "/comments/delete/{articleid}/{commentid}", "blog_controller.php", "delete_comment", $blog); jabRoute("get", $blog['routePrefix'] . "/feed.rss", "blog_controller.php", "get_rss_feed", $blog); jabRoute("get", $blog['routePrefix'] . "/index.rss", "blog_controller.php", "get_rss_feed", $blog); jabRoute("get", $blog['routePrefix'] . "/export", "blog_controller.php", "get_export", $blog); jabRoute("get;post", $blog['routePrefix'] . "/import", "blog_controller.php", "import_{httpmethod}", $blog); jabRoute("get", $blog['routePrefix'] . "/upgrade", "blog_controller.php", "upgrade", $blog); jabRouteStaticContent($blog['routePrefix'], $blog['uploadfolder']); jabSetRouteHandlerPath(null); jabSetAuthContext(null); }
function jabSetThemeFolder($themeFolder) { global $jab; $jab['themeFolder'] = realpath($themeFolder); jabRouteStaticContent("theme", $themeFolder); }
$blog['feedArticles'] = 10; $blog['indexArticles'] = 5; $blog['managingEditor'] = "Your Name"; $blog['enableComments'] = true; $blog['notifyOnComment'] = true; $blog['notifyEmailTo'] = "contact@" . $_SERVER['HTTP_HOST']; $blog['notifyEmailFrom'] = "contact@" . $_SERVER['HTTP_HOST']; jabRouteBlog($blog); // Authentication $auth['routePrefix'] = "account"; $auth['username'] = '******'; $auth['password'] = md5("jab"); $auth['rights'] = "*"; jabRouteAuth($auth); // Contact form $contact['routePrefix'] = "contact"; $contact['emailTo'] = "contact@" . $_SERVER['HTTP_HOST']; $contact['emailSubject'] = "Contact " . $jab['siteName'] . " (Web Posted)"; $contact['contactDetails'] = <<<DETAILS Your contact details go here DETAILS; jabRouteContact($contact); // Editor $editor['routePrefix'] = "editor"; $editor['maxuploadfiles'] = 2; $editor['maxuploadfilesize'] = 1000000; jabRouteEditor($editor); // Static content jabRouteStaticContent("", dirname(__FILE__) . "/content/"); // Handle the request jabProcessRoutes();