$source_file = $document_root . $requested_uri;
$resolution = FALSE;
/* Browser engine detect 
   NOTE: only required to work around a bug where some browsers can't set the cookie fast enough on the first visit to the
         website. Such browsers therefor act as though no cookie was set on the very first visit. This means we can't
         allow desktop browsers to have $mobile_first = TRUE (which we don't want anyway) */
function browser_detect()
{
    $userAgent = strtolower($_SERVER['HTTP_USER_AGENT']);
    // Identify the OS platform. Match only desktop OSs
    if (strpos($userAgent, 'macintosh') || strpos($userAgent, 'windows nt') || strpos($userAgent, 'x11')) {
        return TRUE;
    }
}
/* Do we need to switch mobile first off? */
if (browser_detect()) {
    $mobile_first = FALSE;
}
/* helper function: Send headers and returns an image. */
function sendImage($filename, $browser_cache)
{
    $extension = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
    if (in_array($extension, array('png', 'gif', 'jpeg'))) {
        header("Content-Type: image/" . $extension);
    } else {
        header("Content-Type: image/jpeg");
    }
    header("Cache-Control: private, max-age=" . $browser_cache);
    header('Expires: ' . gmdate('D, d M Y H:i:s', time() + $browser_cache) . ' GMT');
    header('Content-Length: ' . filesize($filename));
    readfile($filename);
Beispiel #2
0
<?php

include_once "../../config.php";
if (isset($_SESSION['apps']['ordering'])) {
    $id = optional_param('id', NULL, PARAM_INT);
    $appsfolder = browser_detect();
    $list = json_decode($_SESSION['apps']['ordering']);
    $idc = $list[$id];
    if (isset($list[$id + 1])) {
        $idnext = $id + 1;
    } else {
        $idnext = 0;
    }
    $data = get_record("apps_ordering", array("id" => $idc));
    $score = get_user_score($_SESSION['userid'], 9);
    $c = 0;
    $words = array();
    for ($i = 1; $i <= 10; $i++) {
        $var = "var" . $i;
        if (!empty($data->{$var})) {
            $words[$i] = $data->{$var};
        }
    }
    //$words = shuffle_assoc ($words);
    if (isset($_SESSION['currentcourse'])) {
        $course = get_record("course", array("id" => $_SESSION['currentcourse']));
    } else {
        $course = get_record("course", array("id" => $_COOKIE['mcm_course']));
    }
    add_log($_SESSION['userid'], 9, time());
    mobilehtmlheader('ordering activity');
Beispiel #3
0
<?php

$dabr_start = microtime(1);
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
header('Last-Modified: ' . date('r'));
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
require 'config.php';
require 'common/browser.php';
require 'common/menu.php';
require 'common/user.php';
require 'common/theme.php';
require 'common/twitter.php';
require 'common/lists.php';
require 'common/settings.php';
menu_register(array('about' => array('callback' => 'about_page'), 'logout' => array('security' => true, 'callback' => 'logout_page')));
function logout_page()
{
    user_logout();
    $content = theme('logged_out');
    theme('page', 'Logged out', $content);
}
function about_page()
{
    $content = file_get_contents('about.html');
    theme('page', 'About', $content);
}
browser_detect();
menu_execute_active_handler();