示例#1
0
function getTopXiaocao()
{
    $url = "http://www.facejoking.com/api/top/18601/1/1";
    $topXiaocaoArr = getTop($url);
    $mmc = memcache_init();
    /**
     * 把结果存入缓存(参数2:key,参数3:value,参数5:失效时间)
     */
    memcache_set($mmc, "topxiaocao", $topXiaocaoArr, 0, 36000);
    return $topXiaocaoArr;
}
function addResult()
{
    $request = Slim::getInstance()->request();
    $result = json_decode($request->getBody());
    /*If the user already exist then only score is updated if not then user is saved to data base*/
    if (userExist($result->email)) {
        updateScore($result->email, $result->score);
    } else {
        createUser($result);
    }
    /* get the users list for calculating the your position */
    $scores = Model::factory('User')->distinct()->select('score')->order_by_desc('score')->find_many();
    /* Prepare the response */
    $arr = array("topScorer" => getTop(), "yourranking" => getYourRanking($scores, $result->score));
    echo json_encode($arr);
}
示例#3
0
            $pageTitle[] = $value;
        }
    }
    $pageTitle = implode(',', $pageTitle);
    $pageType = 'subdomain';
} else {
    $topPoints = array();
    $topIsk = Stats::getTopIsk(array('cacheTime' => 15 * 60, 'pastSeconds' => 7 * 86400, 'limit' => 5));
    $topPods = array();
    $top = array();
    $top[] = getTop("Top Characters", "characterID");
    $top[] = getTop("Top Corporations", "corporationID");
    $top[] = getTop("Top Alliances", "allianceID");
    $top[] = getTop("Top Ships", "shipTypeID");
    $top[] = getTop("Top Systems", "solarSystemID");
    $top[] = getTop("Top Locations", "locationID");
    // get latest kills
    $kills = Kills::getKills(array('cacheTime' => 60, 'limit' => 50));
    // Collect active PVP stats
    $types = ['characterID', 'corporationID', 'allianceID', 'shipTypeID', 'solarSystemID', 'regionID'];
    $activePvP = [];
    foreach ($types as $type) {
        $result = Stats::getDistinctCount($type, []);
        if ($result <= 1) {
            continue;
        }
        $type = str_replace('ID', '', $type);
        if ($type == 'shipType') {
            $type = 'Ship';
        } elseif ($type == 'solarSystem') {
            $type = 'System';
示例#4
0
function buildEmail($id, $data, $emailText)
{
    $top = getTop();
    $preamble = getPreamble($id, $emailText);
    $page = renderPage($id, $data);
    $disclaimer = getDisclaimer();
    $bottom = getBottom();
    $body = $top . $preamble . $page . $disclaimer . $bottom;
    return $body;
}
示例#5
0
<?php

include "functions.php";
checkLogin();
include_once 'modele/boutique/getTop.php';
include_once 'modele/boutique/getListCategories.php';
$top4Array = getTop('4');
$categoriesArray = getListCategories();
include_once 'vue/boutique/index.php';
<?php

header("Content-Type:application/json");
include_once "../base/bd_configuracion.php";
include_once "../base/funcionesBase.php";
$con = new bd_configuracion();
$con->conectar();
$playersCount = 10;
if (isset($_GET['count'])) {
    $playersCount = $_GET['count'];
}
$queryResult = getTop($playersCount);
$nameArray = createArrayNames($queryResult);
deliverResponse(200, $nameArray);
function deliverResponse($status, $data)
{
    header("HTTP/1.1 {$status}");
    $response['status'] = $status;
    $response['players'] = $data;
    $jsonResponse = json_encode($response);
    echo $jsonResponse;
}
function createArrayNames($queryResult)
{
    $dataString = "[";
    $i = 1;
    while ($row = mysql_fetch_array($queryResult, MYSQL_ASSOC)) {
        $dataString .= $row["win_tour_name"] . ",";
        $i++;
    }
    $dataString .= "]";
示例#7
0
<?php

include "functions.php";
checkLogin();
include_once 'modele/boutique/getTop.php';
$top = (int) $_GET['top'];
$produitsArray = getTop($top);
$titre = 'top ' . $top . ' des meilleurs ventes';
$top = 1;
$page = 0;
$nbPages = 0;
$url = 0;
//pagination
include_once 'vue/boutique/listeProduits.php';