Maj
This commit is contained in:
108
single.php
108
single.php
@@ -1,5 +1,36 @@
|
||||
<?php
|
||||
//tideways_enable(TIDEWAYS_FLAGS_NO_SPANS);
|
||||
|
||||
get_header();
|
||||
|
||||
/**/
|
||||
//$xhprof_data = tideways_disable();
|
||||
|
||||
//var_dump($xhprof_data);
|
||||
/*
|
||||
//$tmpfile = sys_get_temp_dir() . uniqid() . ".myapp.xhprof";
|
||||
$tmpfile = "/tmp/" . uniqid() . ".myapp.xhprof";
|
||||
echo $tmpfile;
|
||||
file_put_contents( $tmpfile, serialize($xhprof_data) );
|
||||
*/
|
||||
|
||||
/*
|
||||
$XHPROF_ROOT = "/Users/bruno/Sites/xhprof";
|
||||
define('XHPROF_LIB_ROOT', $XHPROF_ROOT . '/xhprof_lib');
|
||||
|
||||
include_once $XHPROF_ROOT . "/xhprof_lib/config.php";
|
||||
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
|
||||
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
|
||||
|
||||
$xhprof_runs = new XHProfRuns_Default();
|
||||
$run_id = $xhprof_runs->save_run($xhprof_data, "myapp");
|
||||
echo "---------------\n".
|
||||
"Assuming you have set up the http based UI for \n".
|
||||
"XHProf at some address, you can view run at \n".
|
||||
"http://dev.macbook-pro.local/index.php?run=$run_id&source=myapp\n".
|
||||
"---------------\n";
|
||||
*/
|
||||
|
||||
?>
|
||||
<div class="content">
|
||||
<div class="container">
|
||||
@@ -15,12 +46,17 @@ get_header();
|
||||
|
||||
<?php
|
||||
$coord = array();
|
||||
$compt_marker = 0;
|
||||
|
||||
|
||||
the_content();
|
||||
|
||||
?>
|
||||
|
||||
<?php //echo '<div id="map" style="display: ' . ((count($coord) > 0) ? "block" : "none") . ';"></div>';
|
||||
|
||||
var_dump($coord);
|
||||
|
||||
if (count($coord) > 0) {
|
||||
|
||||
$b = array();
|
||||
@@ -28,10 +64,20 @@ get_header();
|
||||
// Avec tous les titres, on crée la requete pour Wikipédia
|
||||
|
||||
for ($a = 0; $a < count($coord); $a++){
|
||||
$short = $coord[$a][2]; // Titre
|
||||
$short = $coord[$a][6]; // Titre
|
||||
/*
|
||||
Flickr: 2016-01-07_Renard_2905
|
||||
WP:
|
||||
ZP:
|
||||
*/
|
||||
$b[] = $short;
|
||||
}
|
||||
|
||||
//var_dump($b);
|
||||
|
||||
//echo "coord avant requete Wikipedia";
|
||||
//var_dump($coord);
|
||||
|
||||
$wiki = fmulticurl($b);
|
||||
|
||||
//On rajoute à $coord les données récupérées sur Wikipédia
|
||||
@@ -40,13 +86,14 @@ get_header();
|
||||
for ($c = 0; $c < count($wiki); $c++){
|
||||
// [0] 1ere réponse, la plus pertinante
|
||||
//array_push($coord[$c], $lettrine, $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
// Requete - Texte Wikipedia - Url Wikipedia
|
||||
array_push($coord[$c], $wiki[$c][1][0], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
//array_push($coord[$c], $wiki[$c][2][0], $wiki[$c][3][0]);
|
||||
}
|
||||
}
|
||||
|
||||
echo "après requete Wikipedia";
|
||||
var_dump($coord);
|
||||
//echo "coord après requete Wikipedia";
|
||||
//var_dump($coord);
|
||||
?>
|
||||
|
||||
|
||||
@@ -99,26 +146,33 @@ get_header();
|
||||
<?php
|
||||
$j = (count($coord) - 1);
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//echo "['<h1>" . $coord[$i][2] . "</h1>','<p>" . $coord[$i][4] . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . $coord[$i][5] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
echo "['<h1>" . addslashes($coord[$i][2]) . "</h1>','<p>" . addslashes($coord[$i][4]) . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . addslashes($coord[$i][5]) . "','" . addslashes($coord[$i][7]) . "','" . $coord[$i][8] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
echo "['<h1>" . addslashes($coord[$i][2]) . "</h1>','<p>" . addslashes($coord[$i][4]) . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . addslashes($coord[$i][5]) . "','" . addslashes($coord[$i][8]) . "','" . $coord[$i][9] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
//echo "['<h1>" . addslashes($coord[$i][2]) . "</h1>','<p>" . addslashes($coord[$i][4]) . "</p>', " . $coord[$i][0] . ", " . $coord[$i][1] . ",'" . addslashes($coord[$i][5]) . "','" . (($coord[$i][8] != "") ? addslashes($coord[$i][8]) : addslashes($coord[$i][4])) . "','" . $coord[$i][9] . "']" . (($i<$j) ? "," : "")."\r\n";
|
||||
}
|
||||
//array_push($coord, array(number_format($lat, 6), number_format($long, 6), $caption, $attach, $description, $thumbnail));
|
||||
|
||||
(($coord[$i][8] != "") ? addslashes($coord[$i][8]) : addslashes($coord[$i][4]))
|
||||
//array_push($coord, array($meta['latitude'], $meta['longitude'], $caption, $pid, $description, $img_thumb_ZP_wiki, $requete_wiki));
|
||||
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[2] => $coord[0] => Latitude
|
||||
locations[3] => $coord[1] => Longitude
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[5] => $coord[7] => Texte Wikipedia
|
||||
locations[6] => $coord[8] => Liens vers Wikipedia
|
||||
locations[5] => $coord[8] => Texte Wikipedia
|
||||
locations[6] => $coord[9] => Liens vers Wikipedia
|
||||
$coord[3] => attachment
|
||||
$coord[6] => <- requete wiki
|
||||
$coord[6] => requete wiki ->
|
||||
$coord[7] => <- requete wiki
|
||||
*/
|
||||
|
||||
?>
|
||||
];
|
||||
|
||||
var wikiLink = '';
|
||||
var contenuInfoBulle = [];
|
||||
|
||||
|
||||
function MapApiLoaded() {
|
||||
|
||||
// Setup the different icons and shadows
|
||||
@@ -162,6 +216,19 @@ get_header();
|
||||
});
|
||||
|
||||
markers.push(marker);
|
||||
|
||||
|
||||
if (locations[i][6] != '') {
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>';
|
||||
}
|
||||
contenuInfoBulle[i] = locations[i][0] + locations[i][4] + locations[i][1] + locations[i][5] + '<br />' + wikiLink;
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[5] => $coord[8] => Texte Wikipedia
|
||||
locations[6] => $coord[9] => Liens vers Wikipedia
|
||||
*/
|
||||
|
||||
var zoom = 1;
|
||||
a = map.getZoom();
|
||||
@@ -204,25 +271,17 @@ get_header();
|
||||
|
||||
google.maps.event.addListener(marker, 'mousemove', (function (marker, i) {
|
||||
return function () {
|
||||
|
||||
//var contenuInfoBulle = locations[i][0] + locations[i][4] + locations[i][1];
|
||||
//var contenuInfoBulle = locations[i][0] + '<a href=\"' + locations[i][6] + '\">' + locations[i][4] + locations[i][5] + '</a>';
|
||||
|
||||
/*
|
||||
var wikiLink = ''
|
||||
if (locations[i][6] != '') {
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>'
|
||||
wikiLink = '<a href=\"' + locations[i][6] + '\" title=\"Plus sur Wikipedia...\">' + wikiUrl + '</a>';
|
||||
}
|
||||
|
||||
var contenuInfoBulle = locations[i][0] + locations[i][4] + locations[i][1] + locations[i][5] + '<br />' + wikiLink;
|
||||
|
||||
/*
|
||||
locations[0] => $coord[2] => Titre (court)
|
||||
locations[4] => $coord[5] => <img "letrine">
|
||||
locations[1] => $coord[4] => Description (long)
|
||||
locations[5] => $coord[7] => Texte Wikipedia
|
||||
locations[6] => $coord[8] => Liens vers Wikipedia
|
||||
*/
|
||||
*/
|
||||
|
||||
infowindow.setContent(contenuInfoBulle);
|
||||
infowindow.setContent(contenuInfoBulle[i]);
|
||||
infowindow.open(map, marker);
|
||||
}
|
||||
})(marker, i));
|
||||
@@ -245,8 +304,7 @@ get_header();
|
||||
}
|
||||
|
||||
setTimeout(function() {
|
||||
/*infowindow.setContent(locations[cnt][0]);*/
|
||||
infowindow.setContent(contenuInfoBulle);
|
||||
infowindow.setContent(contenuInfoBulle[cnt]);
|
||||
infowindow.open(map, markers[cnt]);
|
||||
}, 300);
|
||||
} //jumpToMarker
|
||||
@@ -261,7 +319,7 @@ get_header();
|
||||
echo "<div id='center_marker'><ul class='list_marker'>";
|
||||
for ($i = 0; $i <= $j; $i++) {
|
||||
//<a href="javascript:void(0);" onclick="jumpToMarker(4)" class="button3">PontDArc</a>
|
||||
echo "<li><i class='ion-ios-location'></i><a href='javascript:void(0);' onclick='jumpToMarker(" . $i . ")'>" . $coord[$i][2] . "</a></li>";
|
||||
echo "<li><i class='ion-ios-location'></i><a href='#gmap' onclick='jumpToMarker(" . $i . ")'>" . $coord[$i][2] . "</a></li>";
|
||||
}
|
||||
echo "</ul></div>";
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user