Example #1
0
function main()
{
    global $current_page;
    ob_start();
    index_header();
    if (isset($_GET['message'])) {
        echo '<p class="notice">' . htmlspecialchars($_GET['message'], ENT_COMPAT, 'utf-8') . '</p>';
    }
    if (!isset($_SESSION['user_id'])) {
        if (!isset($_GET['openid_mode']) || $_GET['openid_mode'] == 'cancel') {
            return index_login();
        } else {
            return index_openid_callback();
        }
    } else {
        if (isset($_GET['logout'])) {
            return index_api_logout();
        }
        index_login_status();
        index_navigation();
        switch ($current_page) {
            case 'account':
                index_account();
                break;
            case 'events':
                index_events();
                break;
            case 'data':
                index_data();
                break;
            case 'keys':
            default:
                index_api_keys();
                break;
        }
    }
    index_footer();
}
Example #2
0
<?php

require_once "../includes/functions.php";
require_once "../includes/session.php";
include "../includes/header.php";
find_selected_page();
//find page user is in
?>
<!--<div id="main">
		</ul> </div> <!--end categories and navigation-->
		
		<div id="page"><br /> <!--page of textbooks, each occupies a square in space-->
		<br />
		<!--sorting selection should go here-->
		<?php 
echo index_header();
//create the buttons of categories and subjects
?>
		
		<h2>
		<?php 
if (!is_logged_in()) {
    echo cannot_buy_or_sell();
}
?>
		</h2>
		<!-- books-->
		<?php 
echo index_body();
?>