It is knooown…

This commit is contained in:
Boris 2022-11-14 15:45:55 +01:00
parent d7a6f9b49b
commit f2886bcc8d
5 changed files with 48 additions and 13 deletions

View File

@ -1,11 +1,28 @@
<?php
require_once('config.php');
require_once('lib/Gchange.class.php');
$bodyIds = 'home';
include_once('header.php');
$gchange = new Gchange();
try {
$player = $gchange->getUser($_SESSION['player_pubkey']);
} catch (Exception $errMsg) {
ErrorsHandler::kaput($errMsg);
}
echo '
<header>
Bienvenue '. $player->getUserName() . ' !
<!-- ('. substr($player->getUserGchangeId(), 0, 8) . ') -->
</header>
<nav>
<ul>
<li id="dashboard-map">

View File

@ -100,8 +100,9 @@ class Fred {
);
$context = stream_context_create($opts);
$page1 = file_get_contents($url, false, $context)
or die('<p>On a fait du sale.</p>');
$page1 = file_get_contents($url, false, $context);
// die('<pre>' . htmlspecialchars($page1) . '</pre>');
@ -134,7 +135,7 @@ class Fred {
sleep($this->gatewayDelay);
$page2 = file_get_contents($url, false, $context2) or die('<pre>'. var_dump($page2, true) . '</pre>');
$page2 = file_get_contents($url, false, $context2);
}
preg_match("`url='.*/user/([^']+)/'`isU", $page2, $matches);

View File

@ -267,7 +267,7 @@ class Gchange {
$queryParams = [
'size' => $n,
'fields' => ['_id'],
// 'fields' => ['_id'],
'query' => [
'bool' => [
'filter' => [
@ -417,7 +417,7 @@ class Gchange {
$queryParams = [
'size' => $n
,'fields' => ['_id']
// ,'fields' => ['_id']
,'query' => [
'nested' => [
'path' => 'socials',

View File

@ -3,25 +3,42 @@ require_once('config.php');
require_once('lib/Gchange.class.php');
require_once('lib/Fred.class.php');
require_once('lib/Keygen.class.php');
require_once('lib/ErrorsHandler.class.php');
$toto = 'QP1VkfaFUMdHZmHgPMi7q5wJJHaQhZcEqs5A86NigKr';
$boris = '25zB1gSC7Qhwnx463cuDLDCKLRVieLAgFiPbYq6jVHG9';
$playerG1Id = null;
if (isset($_POST['salt'], $_POST['pepper'])) {
$fred = new Fred();
$keygen = new Keygen();
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
$toto = 'QP1VkfaFUMdHZmHgPMi7q5wJJHaQhZcEqs5A86NigKr';
$boris = '25zB1gSC7Qhwnx463cuDLDCKLRVieLAgFiPbYq6jVHG9';
// $playerG1Id = $toto;
try {
$playerG1Id = $fred->donneMoiSaPutaindeG1Pub($_POST['salt'], $_POST['pepper']);
} catch (Exception $errMsg) {
ErrorsHandler::kaput($errMsg);
}
$_SESSION['player_pubkey'] = $playerG1Id;
$gchange = new Gchange();
$user = $gchange->getUser($_SESSION['player_pubkey']);
$_SESSION['player_lat'] = $user->_source->geoPoint->lat;
$_SESSION['player_lon'] = $user->_source->geoPoint->lon;
try {
$player = $gchange->getUser($_SESSION['player_pubkey']);
} catch (Exception $errMsg) {
ErrorsHandler::kaput($errMsg);
}
$_SESSION['player_lat'] = $player->_source->geoPoint->lat;
$_SESSION['player_lon'] = $player->_source->geoPoint->lon;
$_SESSION['radius'] = DEFAULT_RADIUS;
$_SESSION['salt'] = $_POST['salt'];

View File

@ -102,7 +102,7 @@ echo '
*/
$places = $gchange->getPlacesNearUser($player, $_SESSION['radius']);
$selectedPlace = NULL;
foreach ($places as $place) {