Ejemplo n.º 1
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $loggedIn, $settings;
    $feed = new feed();
    $feed->db = $db;
    $feed->url = $CONF['url'];
    if (isset($_SESSION['username']) && isset($_SESSION['password']) || isset($_COOKIE['username']) && isset($_COOKIE['password'])) {
        $verify = $loggedIn->verify();
        if ($verify['username']) {
            $feed->user = $verify;
            $feed->username = $verify['username'];
            $feed->id = $verify['idu'];
        }
    }
    $feed->per_page = $settings['qperpage'];
    $feed->categories = $feed->getCategories();
    $feed->time = $settings['time'];
    $feed->l_per_post = $settings['lperpost'];
    $TMPL_old = $TMPL;
    $TMPL = array();
    $skin = new skin('shared/rows');
    $rows = '';
    // If the $_GET keyword is empty [user]
    if ($_GET['q'] == '') {
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    if ($_GET['filter'] == 'tracks') {
        list($tracks, $error) = $feed->searchTracks(0, $_GET['q']);
        $TMPL['messages'] = $tracks;
    } elseif ($_GET['filter'] == 'playlists') {
        $playlist = $feed->getPlaylists(0, 2, $_GET['q']);
        $error = $feed->showError('no_results', 1);
        $TMPL['messages'] = empty($playlist) ? $error[0] : $playlist;
    } else {
        $TMPL['messages'] = $feed->getSearch(0, $settings['qperpage'], $_GET['q'], $_GET['filter']);
    }
    $rows = $skin->make();
    $skin = new skin('search/sidebar');
    $sidebar = '';
    $TMPL['trending'] = $feed->sidebarTrending($_GET['tag'], 10);
    $TMPL['filters'] = $feed->sidebarFilters($_GET['filter'], $_GET['q']);
    $TMPL['ad'] = generateAd($settings['ad6']);
    $sidebar = $skin->make();
    $TMPL = $TMPL_old;
    unset($TMPL_old);
    $TMPL['top'] = $top;
    $TMPL['rows'] = $rows;
    $TMPL['sidebar'] = $sidebar;
    if (isset($_GET['logout']) == 1) {
        $loggedIn->logOut();
        header("Location: " . $CONF['url'] . "/index.php?a=welcome");
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['search'] . ' - ' . htmlspecialchars($_GET['q']) . ' - ' . $settings['title'];
    $TMPL['header'] = pageHeader($LNG['search'] . ' - ' . $_GET['q']);
    $skin = new skin('shared/content');
    return $skin->make();
}
Ejemplo n.º 2
0
  somewhere you can get to it - though in real
  operations you'd want to make sure it wasn't
  accessible from the webserver!
  The name is the email address value provided
  as part of the service account (not your
  address!)
  Make sure the Books API is enabled on this
  account as well, or the call will fail.
 ************************************************/
$client_id = '<YOUR_CLIENT_ID>';
//Client ID
$service_account_name = '';
//Email Address
$key_file_location = '';
//key.p12
echo pageHeader("Service Account Access");
if (strpos($client_id, "googleusercontent") == false || !strlen($service_account_name) || !strlen($key_file_location)) {
    echo missingServiceAccountDetailsWarning();
    exit;
}
$client = new Google_Client();
$client->setApplicationName("Client_Library_Examples");
$service = new Google_Service_Books($client);
/************************************************
  If we have an access token, we can carry on.
  Otherwise, we'll get one with the help of an
  assertion credential. In other examples the list
  of scopes was managed by the Client, but here
  we have to list them manually. We also supply
  the service account
 ************************************************/
Ejemplo n.º 3
0
        header('Location: index.php?mode=admin&task=awardsActions&gc=' . $gc . '#actions');
    }
}
// get the awards
$actions = false;
$query = $DB->query("SELECT awardId, code, name, verb\n\t\t\t\t\tFROM `" . DB_PREFIX . "_Awards`\n\t\t\t\t\tWHERE game='" . $DB->real_escape_string($gc) . "'\n\t\t\t\t\tAND awardType='O'\n\t\t\t\t\tORDER BY code ASC");
if (SHOW_DEBUG && $DB->error) {
    var_dump($DB->error);
}
if ($query->num_rows > 0) {
    while ($result = $query->fetch_assoc()) {
        $actions[] = $result;
    }
}
$rcol = "row-dark";
pageHeader(array(l("Admin"), l('Action Awards')), array(l("Admin") => "index.php?mode=admin", l('Action Awards') => ''));
?>

<div id="sidebar">
	<h1><?php 
echo l('Options');
?>
</h1>
	<div class="left-box">
		<ul class="sidemenu">
			<li>
				<a href="index.php?mode=admin&task=gameoverview&code=<?php 
echo $gc;
?>
"><?php 
echo l('Back to game overview');
Ejemplo n.º 4
0
  If we're signed in and have a request to shorten
  a URL, then we create a new URL object, set the
  unshortened URL, and call the 'insert' method on
  the 'url' resource. Note that we re-store the
  access_token bundle, just in case anything
  changed during the request - the main thing that
  might happen here is the access token itself is
  refreshed if the application has offline access.
 ************************************************/
if ($client->getAccessToken() && isset($_GET['url'])) {
    $url = new Google_Service_Urlshortener_Url();
    $url->longUrl = $_GET['url'];
    $short = $service->url->insert($url);
    $_SESSION['access_token'] = $client->getAccessToken();
}
echo pageHeader("User Query - URL Shortener");
if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
    echo missingClientSecretsWarning();
}
?>
<div class="box">
  <div class="request">
    <?php 
if (isset($authUrl)) {
    ?>
      <a class='login' href='<?php 
    echo $authUrl;
    ?>
'>Connect Me!</a>
    <?php 
} else {
Ejemplo n.º 5
0
/**
 * page_admin.php
 *
 * Copyright 2008- Samuli Järvelä
 * Released under GPL License.
 *
 * License: http://www.mollify.org/license.php
 */
include "install/installation_page.php";
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
	<?php 
pageHeader("Mollify Installation", "init");
?>
	
	<body id="page-admin">
		<?php 
pageBody("Installation", "2/2 Administrator User");
?>

		<div class="content">
			<h2>
				Mollify requires an administrator user:
			</h2>
			<p>
				<form id="admin-user">
					<div class='user-data' id='admin-username'>
						<div class='title'>User name:</div>
Ejemplo n.º 6
0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
include_once __DIR__ . '/../vendor/autoload.php';
include_once "templates/base.php";
echo pageHeader("Retrieving An Id Token");
/*************************************************
 * Ensure you've downloaded your oauth credentials
 ************************************************/
if (!($oauth_credentials = getOAuthCredentialsFile())) {
    echo missingOAuth2CredentialsWarning();
    return;
}
/************************************************
 * NOTICE:
 * The redirect URI is to the current page, e.g:
 * http://localhost:8080/idtoken.php
 ************************************************/
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$client = new Google_Client();
$client->setAuthConfig($oauth_credentials);
Ejemplo n.º 7
0
    $message = $Message->getMessage();
    $type = $Message->getType();
    unset($_SESSION['message']);
}
function failWithMessage($msg, $ex)
{
    $_SESSION['message'] = new Message("ERROR", $msg);
    errorLog($msg . ' - ' . $ex->getMessage());
}
?>

<!DOCTYPE html>
<html>
<head lang="en">
    <?php 
pageHeader("Edit Worksheet");
?>
    <link rel="stylesheet" type="text/css" href="css/editworksheet.css" />
    <link rel="stylesheet" type="text/css" href="css/jquery-ui-date.css"/>
    <script src="js/jquery-ui.js"></script>
    <script src="js/tagsList.js"></script>
    <script>
        $(function() {
          $( "#datepicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
        });
    </script>
</head>
<body>
    <div id="main">
    	<div id="header">
            <div id="title">
Ejemplo n.º 8
0
<?php

pageHeader(lang('page_form'));
?>

<?php 
echo form_open('admin/pages/form/' . $id);
?>

<div class="row">
    <div class="col-md-3">
        <div class="form-group">
            <label for="title"><?php 
echo lang('title');
?>
</label>
            <?php 
echo form_input(['name' => 'title', 'value' => assign_value('title', $title), 'class' => 'form-control']);
?>
        </div>
    </div>
    <div class="col-md-3">
        <div class="form-group">
            <label for="menu_title"><?php 
echo lang('menu_title');
?>
</label>
            <?php 
echo form_input(['name' => 'menu_title', 'value' => assign_value('menu_title', $menu_title), 'class' => 'form-control']);
?>
        </div>
Ejemplo n.º 9
0
            $do = $adminObj->doLogin($username, $pass);
            if ($do === true) {
                $return['status'] = "3";
                $return['msg'] = l('Login successfull');
                header('Location: index.php?mode=admin');
            } else {
                $return['status'] = "2";
                $return['msg'] = l('Invalid auth data');
            }
        } else {
            $return['status'] = "1";
            $return['msg'] = l('Please provide authentication data');
        }
    }
}
pageHeader(array(l("Admin")), array(l("Admin") => ""));
?>

<div id="sidebar">
	<h1><?php 
echo l('Options');
?>
</h1>
	<div class="left-box">
		<ul class="sidemenu">
			<li>
				<a href="<?php 
echo "index.php";
?>
"><?php 
echo l('Back to game statistics');
Ejemplo n.º 10
0
                $result = $query->fetch_assoc();
                header('Location: index.php?mode=admin&task=toolsEditdetails&clanId=' . $result['clanId']);
            } else {
                $return['msg'] = l('Nothing found');
                $return['status'] = "1";
            }
        } else {
            $return['msg'] = l('Invalid Input');
            $return['status'] = "1";
        }
    } else {
        $return['msg'] = l('Invalid Input');
        $return['status'] = "1";
    }
}
pageHeader(array(l("Admin"), l('Edit Details')), array(l("Admin") => "index.php?mode=admin", l('Edit Details') => ''));
?>
<div id="sidebar">
	<h1><?php 
echo l('Options');
?>
</h1>
	<div class="left-box">
		<ul class="sidemenu">
			<li>
				<a href="<?php 
echo "index.php?mode=admin";
?>
"><?php 
echo l('Back to admin overview');
?>
Ejemplo n.º 11
0
    $authUrl = $client->createAuthUrl();
}
/************************************************
  If we're signed in then lets try to upload our
  file. For larger files, see fileupload.php.
 ************************************************/
if ($client->getAccessToken()) {
    // This is uploading a file directly, with no metadata associated.
    $file = new Google_Service_Drive_DriveFile();
    $result = $service->files->insert($file, array('data' => file_get_contents(TESTFILE), 'mimeType' => 'application/octet-stream', 'uploadType' => 'media'));
    // Now lets try and send the metadata as well using multipart!
    $file = new Google_Service_Drive_DriveFile();
    $file->setTitle("Hello World!");
    $result2 = $service->files->insert($file, array('data' => file_get_contents(TESTFILE), 'mimeType' => 'application/octet-stream', 'uploadType' => 'multipart'));
}
echo pageHeader("File Upload - Uploading a small file");
if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
    echo missingClientSecretsWarning();
}
?>
<div class="box">
  <div class="request">
<?php 
if (isset($authUrl)) {
    echo "<a class='login' href='" . $authUrl . ">Connect Me!</a>";
}
?>
  </div>

  <div class="shortened">
<?php 
Ejemplo n.º 12
0
if (!defined('IN_HLSTATS')) {
    die('Do not access this file directly.');
}
// Player Rankings
$db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Games.name\r\n\t\tFROM\r\n\t\t\thlstats_Games\r\n\t\tWHERE\r\n\t\t\thlstats_Games.code = '{$game}'\r\n\t");
if ($db->num_rows() < 1) {
    error("No such game '{$game}'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minkills'])) {
    $minkills = valid_request($_GET['minkills'], 1);
} else {
    $minkills = 1;
}
pageHeader(array($gamename, 'Player Rankings'), array($gamename => "%s?game={$game}", 'Player Rankings' => ''));
$rank_type = 0;
if (isset($_GET['rank_type'])) {
    $rank_type = valid_request(strval($_GET['rank_type']), 0);
}
// Autocomplete function below implemented by KingJ. Heavy modified to use HTML request instead of JSON.
?>

<div class="block">
	<?php 
printSectionTitle('Player Rankings');
?>
	<div class="subblock">
		<div style="float:left;">
			<script type="text/javascript" src="<?php 
echo INCLUDE_PATH;
Ejemplo n.º 13
0
 * Copyright 2013 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
include_once "templates/base.php";
echo pageHeader("Simple API Access");
/************************************************
  Make a simple API request using a key. In this
  example we're not making a request as a
  specific user, but simply indicating that the
  request comes from our application, and hence
  should use our quota, which is higher than the
  anonymous quota (which is limited per IP).
 ************************************************/
require_once realpath(dirname(__FILE__) . '/../src/Google/autoload.php');
/************************************************
  We create the client and set the simple API
  access key. If you comment out the call to
  setDeveloperKey, the request may still succeed
  using the anonymous quota.
 ************************************************/
Ejemplo n.º 14
0
    $client->setAccessToken($_SESSION['access_token']);
} else {
    $authUrl = $client->createAuthUrl();
}
/************************************************
  If we're signed in, retrieve channels from YouTube
  and a list of files from Drive.
 ************************************************/
if ($client->getAccessToken()) {
    $_SESSION['access_token'] = $client->getAccessToken();
    $dr_results = $dr_service->files->listFiles(array('maxResults' => 10));
    $yt_channels = $yt_service->channels->listChannels('contentDetails', array("mine" => true));
    $likePlaylist = $yt_channels[0]->contentDetails->relatedPlaylists->likes;
    $yt_results = $yt_service->playlistItems->listPlaylistItems("snippet", array("playlistId" => $likePlaylist));
}
echo pageHeader("User Query - Multiple APIs");
if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
    echo missingClientSecretsWarning();
}
?>
<div class="box">
  <div class="request">
<?php 
if (isset($authUrl)) {
    echo "<a class='login' href='" . $authUrl . "'>Connect Me!</a>";
} else {
    echo "<h3>Results Of Drive List:</h3>";
    foreach ($dr_results as $item) {
        echo $item->title, "<br /> \n";
    }
    echo "<h3>Results Of YouTube Likes:</h3>";
Ejemplo n.º 15
0
<?php

pageHeader(array('Teamspeak viewer'), array('Teamspeak viewer' => ''));
include_once PAGE_PATH . '/voicecomm_serverlist.php';
include_once PAGE_PATH . '/teamspeak_query.php';
include_once PAGE_PATH . '/teamspeak3_query.php';
$tsId = valid_request($_GET['tsId'], 1);
function show($tpl, $array)
{
    $template = PAGE_PATH . "/templates/teamspeak/{$tpl}";
    if ($fp = @fopen($template . "." . html, "r")) {
        $tpl = @fread($fp, filesize($template . "." . html));
    }
    foreach ($array as $value => $code) {
        $tpl = str_replace("[" . $value . "]", $code, $tpl);
    }
    return $tpl;
}
if (function_exists(fopen)) {
    $db->query("SELECT addr, queryPort, UDPPort, serverType FROM hlstats_Servers_VoiceComm WHERE serverId={$tsId}");
    $s = $db->fetch_array();
    $uip = $s['addr'];
    $tPort = $s['queryPort'];
    $port = $s['UDPPort'];
    $fp = fsockopen($uip, $tPort, $errno, $errstr, 2);
    if (!$fp) {
        $index = error("No teamspeak", 1);
    } else {
        $out = "";
        $fp = fsockopen($uip, $tPort, $errno, $errstr, 2);
        if ($fp) {
Ejemplo n.º 16
0
    if (SHOW_DEBUG && $DB->error) {
        var_dump($DB->error);
    }
    if ($query->num_rows > 0) {
        while ($result = $query->fetch_assoc()) {
            $result['percent'] = $result['kills'] / $totalkills * 100;
            $weapons['data'][] = $result;
        }
    }
    // get the max count for pagination
    $query = $DB->query("SELECT FOUND_ROWS() AS 'rows'");
    $result = $query->fetch_assoc();
    $weapons['pages'] = (int) ceil($result['rows'] / 50);
    $query->free();
}
pageHeader(array($gamename, l("Weapon Statistics")), array($gamename => "index.php?game={$game}", l("Weapon Statistics") => ""));
?>
<div id="sidebar">
	<h1><?php 
echo l('Options');
?>
</h1>
	<div class="left-box">
		<ul class="sidemenu">
			<li>
				<a href="<?php 
echo "index.php?game={$game}";
?>
"><?php 
echo l('Back to game overview');
?>
Ejemplo n.º 17
0
$include_path = get_include_path();
include_once $include_path . '/includes/db_functions.php';
include_once $include_path . '/includes/session_functions.php';
include_once $include_path . '/public_html/classes/AllClasses.php';
include_once $include_path . '/public_html/requests/core.php';
include_once $include_path . '/public_html/includes/htmlCore.php';
$staffid = filter_input(INPUT_GET, 't', FILTER_SANITIZE_NUMBER_INT);
$studentid = filter_input(INPUT_GET, 'st', FILTER_SANITIZE_NUMBER_INT);
$setid = filter_input(INPUT_GET, 'set', FILTER_SANITIZE_NUMBER_INT);
?>

<!DOCTYPE html>
<html>
    <head lang="en">
        <?php 
pageHeader("Notes");
?>
        <link rel="stylesheet" type="text/css" href="css/reportNotes.css" />
        <script src="js/reportNotes.js"></script>
    </head>
    <body>
        <?php 
echo "<input type='hidden' id='staffid' value='{$staffid}' />";
echo "<input type='hidden' id='studentid' value='{$studentid}' />";
echo "<input type='hidden' id='setid' value='{$setid}' />";
?>
        <div id="main">
            <div id="header">
                <div id="title">
                    <a href="index.php"><img src="branding/mainlogo.png"/></a>
                </div>
Ejemplo n.º 18
0
}
function getArrayValueForKey($array, $key)
{
    return array_key_exists($key, $array) ? $array[$key] : null;
}
if (isset($_SESSION['message'])) {
    $message = $_SESSION['message'];
    unset($_SESSION['message']);
}
?>

<!DOCTYPE html>
<html>
<head lang="en">
    <?php 
pageHeader("Smarkbook");
?>
    
    <link rel="stylesheet" type="text/css" href="css/editSetResults.css" />
    <link href="css/autocomplete.css" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="pickadate/themes/default.css"/>
    <link rel="stylesheet" type="text/css" href="pickadate/themes/default.date.css"/>
    <script src="js/tagsList.js"></script>
    <script src="js/editSetResults.js"></script>
    <script src="pickadate/picker.js"></script>
    <script src="pickadate/picker.date.js"></script>
    <script src="pickadate/legacy.js"></script>
</head>
<body>
    <?php 
setUpRequestAuthorisation($userid, $userval);
Ejemplo n.º 19
0
} else {
    $authUrl = $client->createAuthUrl();
}
/************************************************
  If we're signed in we can go ahead and retrieve
  the ID token, which is part of the bundle of
  data that is exchange in the authenticate step
  - we only need to do a network call if we have
  to retrieve the Google certificate to verify it,
  and that can be cached.
 ************************************************/
if ($client->getAccessToken()) {
    $_SESSION['access_token'] = $client->getAccessToken();
    $token_data = $client->verifyIdToken()->getAttributes();
}
echo pageHeader("User Query - Retrieving An Id Token");
if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
    echo missingClientSecretsWarning();
}
?>
<div class="box">
  <div class="request">
    <?php 
if (isset($authUrl)) {
    ?>
      <a class='login' href='<?php 
    echo $authUrl;
    ?>
'>Connect Me!</a>
    <?php 
} else {
Ejemplo n.º 20
0
$showserver = 0;
if (isset($_GET['server_id'])) {
    $showserver = valid_request(strval($_GET['server_id']), true);
}
if ($showserver == 0) {
    $whereclause = "hlstats_Servers.game='{$game}'";
} else {
    $whereclause = "hlstats_Servers.game='{$game}' AND hlstats_Events_Chat.serverId={$showserver}";
}
$db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Games.name\r\n\t\tFROM\r\n\t\t\thlstats_Games\r\n\t\tWHERE\r\n\t\t\thlstats_Games.code = '{$game}'\r\n\t");
if ($db->num_rows() < 1) {
    error("No such game '{$game}'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader(array($gamename, 'Server Chat Statistics'), array($gamename => "%s?game={$game}", 'Server Chat Statistics' => ''));
flush();
$servername = "(All Servers)";
if ($showserver != 0) {
    $result = $db->fetch_array($db->query("\r\n\t\t\t\tSELECT\r\n\t\t\t\t\thlstats_Servers.name\r\n\t\t\t\tFROM\r\n\t\t\t\t\thlstats_Servers\r\n\t\t\t\tWHERE\r\n\t\t\t\t\thlstats_Servers.serverId = " . $db->escape($showserver) . "\r\n\t\t\t"));
    $servername = "(" . $result['name'] . ")";
}
?>

<div class="block">
	<?php 
printSectionTitle("{$gamename} {$servername} Server Chat Log (Last " . $g_options['DeleteDays'] . ' Days)');
?>
	<div class="subblock">
		<div style="float:left;">
			<span>
Ejemplo n.º 21
0
<?php

/**
 * page_install_error.php
 *
 * Copyright 2008- Samuli Järvelä
 * Released under GPL License.
 *
 * License: http://www.mollify.org/license.php
 */
include "install/installation_page.php";
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
	<?php 
pageHeader("Mollify Installation");
?>
	<?php 
pageBody("Error");
?>
	<?php 
pageFooter();
?>
</html>
Ejemplo n.º 22
0
    exit;
}
// get different parts of the date
$birthMonth = substr($_REQUEST['birthdate'], 0, 2);
$birthDay = substr($_REQUEST['birthdate'], 3, 2);
$birthYear = substr($_REQUEST['birthdate'], 6, 4);
// check date for validity, display error message if invalid
if (!@checkDate($birthMonth, $birthDay, $birthYear)) {
    pageHeader();
    //print("The date '$birthMonth/$birthDay/$birthYear' is invalid.");
    echo "<h2>" . $TEXT['bio-error1'] . " '{$birthMonth}/{$birthDay}/{$birthYear}' " . $TEXT['bio-error2'] . ".</h2>";
    pageFooter();
    exit;
}
if (isset($_POST['showpng']) && $_POST['showpng'] == 1) {
    pageHeader();
    echo "<img src='" . basename($_SERVER['PHP_SELF']) . "?" . htmlentities("birthdate=" . urlencode($_REQUEST['birthdate'])) . "' alt=''>";
    pageFooter();
    exit;
}
// specify diagram parameters (these are global)
$diagramWidth = 710;
$diagramHeight = 400;
$daysToShow = 30;
// calculate the number of days this person is alive
// this works because Julian dates specify an absolute number
// of days -> the difference between Julian birthday and
// "Julian today" gives the number of days alive
$daysGone = abs(gregorianToJD($birthMonth, $birthDay, $birthYear) - gregorianToJD(date("m"), date("d"), date("Y")));
// create image
$image = imageCreate($diagramWidth, $diagramHeight);
<?php

/**
 * page_current_installed.php
 *
 * Copyright 2015- Samuli Järvelä
 * Released under GPL License.
 *
 * License: http://www.kloudspeaker.com/license.php
 */
include "install/installation_page.php";
function version($ver)
{
    return str_replace("_", ".", $ver);
}
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
	<?php 
pageHeader("Kloudspeaker Update");
?>
	<?php 
pageBody("Update");
?>
	<h4>No update is required.</h4>
	<?php 
pageFooter();
?>
</html>
Ejemplo n.º 24
0
    // complete.
    $status = false;
    $handle = fopen(TESTFILE, "rb");
    while (!$status && !feof($handle)) {
        $chunk = fread($handle, $chunkSizeBytes);
        $status = $media->nextChunk($chunk);
    }
    // The final value of $status will be the data from the API for the object
    // that has been uploaded.
    $result = false;
    if ($status != false) {
        $result = $status;
    }
    fclose($handle);
}
echo pageHeader("File Upload - Uploading a large file");
if ($client_id == '<YOUR_CLIENT_ID>' || $client_secret == '<YOUR_CLIENT_SECRET>' || $redirect_uri == '<YOUR_REDIRECT_URI>') {
    echo missingClientSecretsWarning();
}
?>
<div class="box">
  <div class="request">
<?php 
if (isset($authUrl)) {
    echo "<a class='login' href='" . $authUrl . "'>Connect Me!</a>";
}
?>
  </div>

    <div class="shortened">
<?php 
Ejemplo n.º 25
0
    die('Do not access this file directly.');
}
// Player Rankings
$db->query("\n\t\tSELECT\n\t\t\thlstats_Games.name\n\t\tFROM\n\t\t\thlstats_Games\n\t\tWHERE\n\t\t\thlstats_Games.code = '{$game}'\n\t");
if ($db->num_rows() < 1) {
    error("No such game '{$game}'.");
}
$time = time() - 24 * 60 * 60;
list($gamename) = $db->fetch_row();
$db->free_result();
if (isset($_GET['minkills'])) {
    $minkills = valid_request(intval($_GET['minkills']), 1);
} else {
    $minkills = 1;
}
pageHeader(array($gamename, 'Last 24h Connected'), array($gamename => "%s?game={$game}", 'Last 24h Connected' => ''));
$table = new Table(array(new TableColumn('lastName', 'Player', 'width=26&flag=1&link=' . urlencode('mode=playerinfo&amp;player=%k')), new TableColumn('con_date', 'Last Connect', 'width=15&align=right'), new TableColumn('skill', 'Points', 'width=6&align=right'), new TableColumn('activity', 'Activity', 'width=10&sort=no&type=bargraph'), new TableColumn('kills', 'Kills', 'width=5&align=right'), new TableColumn('deaths', 'Deaths', 'width=5&align=right'), new TableColumn('headshots', 'Headshots', 'width=7&align=right'), new TableColumn('kpd', 'K:D', 'width=10&align=right'), new TableColumn('hpk', 'HS:K', 'width=5&align=right'), new TableColumn('acc', 'Accuracy', 'width=6&align=right&append=' . urlencode('%'))), 'playerId', 'last_event', 'skill', true);
$day_interval = 28;
#adjusted query to exclude bots that may not have hideRanking = 1
$resultCount = $db->query("\n\t\tSELECT\n\t\t\tCOUNT(*)\n\t\tFROM\n\t\t\thlstats_Players\n\t\tWHERE\n\t\t\thlstats_Players.game = '{$game}'\n\t\t\tAND hlstats_Players.hideranking = 0\n\t\t\tAND hlstats_Players.lastName NOT REGEXP '^BOT|^[(*)]'\n\t\t\tAND hlstats_Players.kills >= {$minkills}\n\t\t\tAND hlstats_Players.last_event >= {$time}\n\t");
list($numitems) = $db->fetch_row($resultCount);
#adjusted query to exclude bots that may not have hideRanking = 1
$result = $db->query("\n\t\tSELECT\n\t\t\thlstats_Players.playerId,\n\t\t\tFROM_UNIXTIME(last_event,'%Y.%m.%d %T') as con_date,\n\t\t\thlstats_Players.flag,\n                        unhex(replace(hex(hlstats_Players.lastName), 'E280AE', '')) as lastName,\n\t\t\thlstats_Players.skill,\n\t\t\thlstats_Players.kills,\n\t\t\thlstats_Players.deaths,\n\t\t\tIFNULL(ROUND(hlstats_Players.kills / IF(hlstats_Players.deaths = 0, 1, hlstats_Players.deaths), 2), '-') AS kpd,\n\t\t\thlstats_Players.headshots,\n\t\t\tIFNULL(ROUND(hlstats_Players.headshots / hlstats_Players.kills, 2), '-') AS hpk,\n\t\t\tIFNULL(ROUND((hlstats_Players.hits / hlstats_Players.shots * 100), 0), 0) AS acc,\n\t\t\tactivity\n\t\tFROM\n\t\t\thlstats_Players\n\t\tWHERE\n\t\t\thlstats_Players.game = '{$game}'\n\t\t\tAND hlstats_Players.hideranking = 0\n\t\t\tAND hlstats_Players.lastName NOT REGEXP '^BOT|^[(*)]'\n\t\t\tAND hlstats_Players.kills >= {$minkills}\n\t\t\tAND hlstats_Players.last_event >= {$time}\n\t\tORDER BY\n\t\t\t{$table->sort} {$table->sortorder},\n\t\t\t{$table->sort2} {$table->sortorder},\n\t\t\thlstats_Players.lastName ASC\n\t\tLIMIT\n\t\t\t{$table->startitem},\n\t\t\t{$table->numperpage}\n\t");
?>

<div class="block">
	<?php 
printSectionTitle('Last 24h Connected');
?>
		<div class="subblock">
			<div style="float:left;">
Ejemplo n.º 26
0
<?php

echo pageHeader(lang('product_form'));
?>

<?php 
$GLOBALS['optionValueCount'] = 0;
?>
<style type="text/css">
    .sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
    .sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; height: 18px; }
    .sortable li>col-md- { position: absolute; margin-left: -1.3em; margin-top:.4em; }
	.efficiency{margin-right:10px; width:23%;float:left !important}
	.document{width:30%;}
	.display-name{margin-top:10px}
	.remove-document{font-weight:bold; margin-left:10px; font-size:16px; cursor:pointer; color:red}
</style>

<?php 
echo form_open_multipart('admin/products/form/' . $id);
?>
    <div class="row">
        <div class="col-md-9">
            <div class="tabbable">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#product_info" data-toggle="tab"><?php 
echo lang('details');
?>
</a></li>
                    <?php 
//if there aren't any files uploaded don't offer the client the tab
Ejemplo n.º 27
0
 * Copyright 2013 Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
include_once "templates/base.php";
echo pageHeader("Batching Queries");
/************************************************
  We're going to use the simple access to the
  books API again as an example, but this time we
  will batch up two queries into a single call.
 ************************************************/
set_include_path("../src/" . PATH_SEPARATOR . get_include_path());
require_once 'Google/Client.php';
require_once 'Google/Service/Books.php';
require_once 'Google/Http/Batch.php';
/************************************************
  We create the client and set the simple API
  access key. If you comment out the call to
  setDeveloperKey, the request may still succeed
  using the anonymous quota.
 ************************************************/
Ejemplo n.º 28
0
/**
 * page_update.php
 *
 * Copyright 2015- Samuli Järvelä
 * Released under GPL License.
 *
 * License: http://www.kloudspeaker.com/license.php
 */
include "install/installation_page.php";
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>
	<?php 
pageHeader("Kloudspeaker Update", "init");
?>
	<?php 
pageBody("Database Update");
?>

	<p>
		<?php 
echo $installer->updateSummary();
?>
	</p>
	<p>
		Click "Update" to start update.
	</p>
	<p>
		<a id="button-update" href="#" class="btn btn-success">Update</a>
Ejemplo n.º 29
0
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

For support and installation notes visit http://www.hlxcommunity.com
*/
if (!defined('IN_HLSTATS')) {
    die('Do not access this file directly.');
}
// Role Statistics
$db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Games.name\r\n\t\tFROM\r\n\t\t\thlstats_Games\r\n\t\tWHERE\r\n\t\t\thlstats_Games.code = '{$game}'\r\n\t");
if ($db->num_rows() < 1) {
    error("No such game '{$game}'.");
}
list($gamename) = $db->fetch_row();
$db->free_result();
pageHeader(array($gamename, 'Role Statistics'), array($gamename => "%s?game={$game}", 'Role Statistics' => ''));
$result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Roles.code,\r\n\t\t\thlstats_Roles.name\r\n\t\tFROM\r\n\t\t\thlstats_Roles\r\n\t\tWHERE\r\n\t\t\thlstats_Roles.game='{$game}'\r\n\t");
while ($rowdata = $db->fetch_row($result)) {
    $code = $rowdata[0];
    $fname[$code] = htmlspecialchars($rowdata[1]);
}
$tblRoles = new Table(array(new TableColumn('code', 'Role', 'width=24&type=roleimg&align=left&link=' . urlencode("mode=rolesinfo&amp;role=%k&amp;game={$game}"), $fname), new TableColumn('picked', 'Picked', 'width=9&align=right&append=+times'), new TableColumn('ppercent', '%', 'width=6&align=right&append=' . urlencode('%')), new TableColumn('ppercent', 'Ratio', 'width=9&sort=no&type=bargraph'), new TableColumn('kills', 'Kills', 'width=6&align=right'), new TableColumn('kpercent', '%', 'width=6&align=right&append=' . urlencode('%')), new TableColumn('kpercent', 'Ratio', 'width=9&sort=no&type=bargraph'), new TableColumn('deaths', 'Deaths', 'width=6&align=right'), new TableColumn('dpercent', '%', 'width=6&sort=no&align=right&append=' . urlencode('%')), new TableColumn('dpercent', 'Ratio', 'width=9&sort=no&type=bargraph'), new TableColumn('kpd', 'K:D', 'width=5&align=right')), 'code', 'kills', 'name', true, 9999, 'role_page', 'role_sort', 'role_sortorder');
$db->query("\r\n\t\tSELECT\r\n\t\t\tIF(IFNULL(SUM(hlstats_Roles.kills), 0) = 0, 1, SUM(hlstats_Roles.kills)),\r\n\t\t\tIF(IFNULL(SUM(hlstats_Roles.deaths), 0) = 0, 1, SUM(hlstats_Roles.deaths)),\r\n\t\t\tIF(IFNULL(SUM(hlstats_Roles.picked), 0) = 0, 1, SUM(hlstats_Roles.picked))\r\n\t\tFROM\r\n\t\t\thlstats_Roles\r\n\t\tWHERE\r\n\t\t\thlstats_Roles.game = '{$game}'\r\n\t\t\tAND hlstats_Roles.hidden = '0'\r\n\t");
list($realkills, $realdeaths, $realpicked) = $db->fetch_row();
$result = $db->query("\r\n\t\tSELECT\r\n\t\t\thlstats_Roles.code,\r\n\t\t\thlstats_Roles.name,\r\n\t\t\thlstats_Roles.picked,\r\n\t\t\tROUND(hlstats_Roles.picked / {$realpicked} * 100, 2) AS ppercent,\r\n\t\t\thlstats_Roles.kills,\r\n\t\t\tROUND(hlstats_Roles.kills / {$realkills} * 100, 2) AS kpercent,\r\n\t\t\thlstats_Roles.deaths,\r\n\t\t\tROUND(hlstats_Roles.deaths / {$realdeaths} * 100, 2) AS dpercent,\r\n\t\t\tROUND(hlstats_Roles.kills / IF(hlstats_Roles.deaths = 0, 1, hlstats_Roles.deaths), 2) AS kpd\r\n\t\tFROM\r\n\t\t\thlstats_Roles\r\n\t\tWHERE\r\n\t\t\thlstats_Roles.game = '{$game}' \r\n\t\t\tAND hlstats_Roles.kills > 0 \r\n\t\t\tAND hlstats_Roles.hidden = '0'\r\n\t\tGROUP BY\r\n\t\t\thlstats_Roles.roleId\r\n\t\tORDER BY\r\n\t\t\t{$tblRoles->sort} {$tblRoles->sortorder},\r\n\t\t\t{$tblRoles->sort2} {$tblRoles->sortorder}\r\n\t");
?>

<div class="block">
	<?php 
printSectionTitle('Role Statistics');
?>
Ejemplo n.º 30
0
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
include_once __DIR__ . '/../vendor/autoload.php';
include_once "templates/base.php";
echo pageHeader("File Upload - Uploading a simple file");
/*************************************************
 * Ensure you've downloaded your oauth credentials
 ************************************************/
if (!($oauth_credentials = getOAuthCredentialsFile())) {
    return missingOAuth2CredentialsWarning();
}
/************************************************
 * The redirect URI is to the current page, e.g:
 * http://localhost:8080/simple-file-upload.php
 ************************************************/
$redirect_uri = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'];
$client = new Google_Client();
$client->setAuthConfig($oauth_credentials);
$client->setRedirectUri($redirect_uri);
$client->addScope("https://www.googleapis.com/auth/drive");