version("0.3.0") update("config/version", "0.8.0 G2") update("config/master/version", "2.0.0.43") update("config/news/version", "2.0.0.17") new("feeds/feedlib.php") new("docs/login.html") BitOwl Application Suit Manual

Adding a Members Section to Your Site

Another feature of BitOwl Application Suit is the ability to use the users system to create a members section for your site.   To use it you only need to have included init.php.  Next you need to add the HTML that follows...

<form method="post" action=">?php echo $_SERVER['PHP_SELF']; ?>">

Username: <input type="text" name="username" /><br />
Password: <input type="password" name="password" /><br />
<input type="checkbox" name="remember" /> Automatically login me in next visit.
</form>

You may also check to see if a user is logged in and/or their name with the variables $isloggedin and $isloggedinas.

<?php
//if user is loggged in display welcome message
//else display login form
if($isloggedin)
{
	echo "Welcome ".$inloggedinas."!";
}
else
{
	?>
	<form method="post" action=">?php echo $_SERVER['PHP_SELF']; ?>">
	Username: <input type="text" name="username" /><br />
	Password: <input type="password" name="password" /><br />

	<input type="checkbox" name="remember" /> Automatically login me in next visit.
	</form>
	<?php
}
?>

By default BitOwl Application Suit does not contain a way to allow visitors to register.

Back to Index
open("news/mngnews.php") Find: include "./feeds/rss.php"; include "./feeds/feeds.php"; Replace: include "./feeds/feedlib.php"; Find: rss2_updateall(); Replace: feeds_updateall(); open("news/mngcat.php") Find: include "./feeds/rss.php"; include "./feeds/feeds.php"; Replace: include "./feeds/feedlib.php"; Find: rss2_updateall(); Replace: feeds_updateall(); open("news/feeds.php") Find: include "./feeds/rss.php"; include "./feeds/feeds.php"; Replace: include "./feeds/feedlib.php"; Find: rss2_updateall(); //update the rss feeds upon edit/add Replace: feeds_updateall(); //update the rss feeds upon edit/add open("news/addnews.php") Find: include "./feeds/rss.php"; include "./feeds/feeds.php"; Replace: include "./feeds/feedlib.php"; Find: rss2_updateall(); Replace: feeds_updateall(); open("news/addcat.php") Find: include "./feeds/rss.php"; include "./feeds/feeds.php"; Replace: include "./feeds/feedlib.php"; Find: rss2_updateall(); Replace: feeds_updateall(); open("init.php") Replace: array( "{template-directory}", "{author}", "{author-email}", "{author-avatar}", "{date}", "{title}", "{message}", "{category-list}", "{category-avatar}", "{item-link}", "{comments}", "{comments-text}", "{comment-form}", "{name-field}", "{email-field}", "{comment-field}", "{submit}", "{previous-page}", "{next-page}", "{linked-page-list}", "{truncated-page-list}" ), "out" => array( $template_url, $data["author"], $data["email"], $author_avatar, $data["date"], $data["title"], stripslashes($data["message"]), $data["categories"], $data["category_avatar"], $data["item_link"], $data["comments"], $data["comments"]." ".$commentstext, "method=\"post\" action=\"".$data["item_link"]."\"", "name=\"name\" type=\"text\"", "name=\"email\" type=\"text\"", "name=\"comment\"", "type=\"submit\" value=\"Add Comment\"", $data["previous_page"], $data["next_page"], $data["page_list"], $data["truncated_list"] ) ); $return = str_replace($return_string["in"], $return_string["out"], $template); break; case "poll": $return_string = array( "in" => array( "{template-directory}", "{poll-question}", "{poll-options}", "{poll-options-result}", "{poll-option}", "{poll-option-name}", "{poll-option-percent}", "{poll-submit}", "{poll-special}", "{results-link}" ), "out" => array( $template_url, $data["poll_question"], $data["poll_options"], $data["poll_options_result"], "type=\"radio\" name=\"vote\" value=\"".$data["poll_option_number"]."\"", $data["poll_option_name"], $data["poll_option_percent"], "type=\"submit\" value=\"Cast Vote\"", "type=\"text\" name=\"".$data["poll_option_special_name"]."\"", $data["results_url"] ) ); $return = str_replace($return_string["in"], $return_string["out"], $template); if(empty($data["poll_option_special_name"])) { $return = preg_replace("/{special (.*?) \/}/", "", $return); } else { $return = preg_replace("/{special (.*?) \/}/", "$1", $return); } break; case "gallery": $return_string = array( "in" => array( "{template-directory}", "{album-statistics}", "{album-name}", "{album-trace}", "{album-link}", "{album-description}", "{pages}", "{previous-link}", "{next-link}", "{image-description}", "{image-file}", "{image-height}", "{image-width}", "{image-link}", "{list-albums}", "{list-images}", "{gallery-name}", "{gallery-description}" ), "out" => array( $template_url, $data["album_stats"], $data["album_name"], $data["album_trace"], $data["album_link"], $data["album_description"], $data["pages"], $data["previous"], $data["next"], $data["image_description"], $data["image_file"], $data["image_height"], $data["image_width"], $data["image_link"], $data["album_list"], $data["image_list"], $data["gallery_name"], $data["gallery_description"] ) ); $return = str_replace($return_string["in"], $return_string["out"], $template); //image array (for image listing) if(is_array($data["image_file"])) { while(preg_match("/{image-file (.*?)}/", $return)) { preg_match("/{image-file (.*?)}/", $return, $imagefile); if(isset($data["image_file"][$imagefile[1]])) { $return = preg_replace("/{image-file (.*?)}/", $data["image_file"][$imagefile[1]], $return, 1); } else { $return = preg_replace("/{image-file (.*?)}/", " ", $return, 1); } } while(preg_match("/{image-height (.*?)}/", $return)) { preg_match("/{image-height (.*?)}/", $return, $imagefile); if(isset($data["image_height"][$imagefile[1]])) { $return = preg_replace("/{image-height (.*?)}/", $data["image_height"][$imagefile[1]], $return, 1); } else { $return = preg_replace("/{image-height (.*?)}/", " ", $return, 1); } } while(preg_match("/{image-width (.*?)}/", $return)) { preg_match("/{image-width (.*?)}/", $return, $imagefile); if(isset($data["image_width"][$imagefile[1]])) { $return = preg_replace("/{image-width (.*?)}/", $data["image_width"][$imagefile[1]], $return, 1); } else { $return = preg_replace("/{image-width (.*?)}/", " ", $return, 1); } } while(preg_match("/{image-link (.*?)}/", $return)) { preg_match("/{image-link (.*?)}/", $return, $imagefile); if(isset($data["image_link"][$imagefile[1]])) { $return = preg_replace("/{image-link (.*?)}/", $data["image_link"][$imagefile[1]], $return, 1); } else { $return = preg_replace("/{image-link (.*?)}/", " ", $return, 1); } } } if($data["previous"] == " ") { $return = preg_replace("/{previous-exists (.*?) \/}/s", " ", $return); } else { $return = preg_replace("/{previous-exists (.*?) \/}/s", "$1", $return); } if($data["next"] == " ") { $return = preg_replace("/{next-exists (.*?) \/}/s", " ", $return); } else { $return = preg_replace("/{next-exists (.*?) \/}/s", "$1", $return); } if($data["image_file"] == " ") { $return = preg_replace("/{image-exists (.*?) \/}/s", "No Image", $return); } else { $return = preg_replace("/{image-exists (.*?) \/}/s", "$1", $return); } if(isset($_GET["album"])) { $return = preg_replace("/{root (.*?) \/}/s", "", $return); $return = preg_replace("/{album (.*?) \/}/s", "$1", $return); } else { $return = preg_replace("/{root (.*?) \/}/s", "$1", $return); $return = preg_replace("/{album (.*?) \/}/s", "", $return); } break; } $return = preg_replace("/{if-exists  , (.*?) \/}/s", " ", $return); $return = preg_replace("/{if-exists-else  , (.*?), (.*?) \/}/s", "$2", $return); //if else statements $return = preg_replace("/{if-exists (.*?), (.*?) \/}/s", "$2", $return); $return = preg_replace("/{if-exists-else (.*?), (.*?), (.*?) \/}/s", "$2", $return); //if else statements while(preg_match("/{template (.*?)}/", $return)) { preg_match("/{template (.*?)}/", $return, $include); $include = parse_template($include[1].".html", $data, $template_type); $return = preg_replace("/{template (.*?)}/", $include, $return, 1); } return $return; } if(isset($_POST["vote"])) { if(!isset($_COOKIE["votes_userinfo"])) { setcookie("votes_userinfo", $_GET["display"], time()+(60*60*24*31*12)); } else { setcookie("votes_userinfo", $_COOKIE["votes_userinfo"]."|".$_GET["display"], time()+(60*60*24*31*12)); } } if(isset($_GET["logout"])) { setcookie("login_userinfo", "", time()-3600); unset($_COOKIE["login_password"]); unset($_COOKIE["login_username"]); } if(isset($_COOKIE["login_userinfo"])) { include "$path/db/users.php"; $userinfo = explode("|", $_COOKIE["login_userinfo"]); for($i = 0;$i < count($user);$i++) { if($user[$i][0] == $userinfo[0] && $user[$i][1] == $userinfo[1]) { $isloggedin = true; $isloggedinas = $user[$i][0]; $message = 1; } } unset($user); unset($userinfo); } else { if(isset($_POST["username"])) { include "$path/db/users.php"; for($i = 0;$i < count($user);$i++) { if(strtolower($user[$i][0]) == strtolower($_POST["username"]) && $user[$i][1] == md5($_POST["password"])) { if(!isset($_POST["remember"]) || $_POST["remember"] == false) { setcookie("login_userinfo", $user[$i][0]."|".md5($_POST["password"])); } else { setcookie("login_userinfo", $user[$i][0]."|".md5($_POST["password"]), time()+(3600*24*31)); } $isloggedin = true; $isloggedinas = $user[$i][0]; } } if($isloggedin == true) { $message = 1; } else { $message = 2; } unset($user); } } ?> open("extensions/exconfig.php") Find: for($i = 0;$i < count($extensions);$i++) { if($extension[$i]["config"] == 1) { if(file_exists($extension[$i]["name"]."/config.php")) { include $extension[$i]["name"]."/config.php"; } } } Replace: $path = isset($path) ? $path : "."; if(isset($extension)) { if($dir = opendir("$path/extensions/")) { while(($file = readdir($dir)) !== false) { if(is_file("$path/extensions/$file") == false && $file != "." && $file != ".." && $file != "lib") { if($extension[$file]["config"] == true) { if(file_exists("$path/extensions/".$file."/config.php")) { include $file."/config.php"; } } } } closedir($dir); } }