I have a problem with my JQUERY code. Here's the code:
$maxcounter = $( '.testimonio-popup[id^="popup-"]' ).length;
var i = 0;
while (i < $maxcounter) {
$('#open-'+i).on('click', function() {
$('#popup-'+i).fadeIn('slow');
$('.testimonio-overlay').fadeIn('slow');
$('.testimonio-overlay').height($(window).height());
return false;
});
$('#close-'+i).on('click', function(){
$('#popup-'+i).fadeOut('slow');
$('.testimonio-overlay').fadeOut('slow');
return false;
});
i++;
}
It takes correctly the total of times the .testimonio-popup div is appearing in the site, and the fadeIn action for .testimoniooverlay class works.
But the fadeIn action for #popup-[number] is not working. Any help why?
For further assistance, I attach the PHP code that makes the query:
function get_the_content_with_formatting ($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') {
$content = get_the_content($more_link_text, $stripteaser, $more_file);
$content = apply_filters('the_content', $content);
$content = str_replace(']]>', ']]>', $content);
return $content;
}
add_shortcode( 'testimonios', 'display_testimonios' );
function display_testimonios($atts){
$atributos = shortcode_atts([ 'grupo' => 'PORDEFECTO', ], $atts);
$buffer = '<div class="testimonio-overlay"></div> ';
$contadorid = 0;
$q = new WP_Query(array(
'post_type' => 'test',
'tax_query' => array(
array(
'taxonomy' => 'grupos_testimonios',
'field' => 'slug',
'terms' => $atributos['grupo']
//'terms' => 'grupo-1'
)
)
) );
while ($q->have_posts()) {
$q->the_post();
$buffer .= '<div class="testimonio">';
$buffer .= '<div class="testimonio-img">' . get_the_post_thumbnail($_post->ID).'</div>';
$buffer .= '<div class="testimonio-titulo"><p>' . get_the_title() .'</p></div>';
$buffer .= '<div class="testimonio-intro"><div class="testimonio-parrafo">' . get_the_excerpt() . '</div><button class="testimonio-boton" id="open-'.$contadorid.'">Leer más</button></div></div>';
$buffer .= '<div class="testimonio-popup" id="popup-'.$contadorid.'"><div class="testimonio-popup-contenido"><div class="testimonio-cerrar"><button class="testimonio-boton-cerrar" id="close-'.$contadorid.'">x</button></div>';
$buffer .= '<div class="testimonio-popup-titulo"><p>' . get_the_title() .'</p></div>';
$buffer .= '<div class="testimonio-popup-contenido">' . get_the_content_with_formatting() . '</div></div></div>';
$contadorid = $contadorid + 1;
}
wp_reset_postdata();
return $buffer;
}
Thank you!
Frede
#Rory McCrossan is right (see comment).
I'm not sure what goes wrong there, but I would suggest you change this logic:
$("#open-1").on(....);
$("#open-2").on(....);
$("#open-3").on(....);
$("#close-1").on(....);
$("#close-2").on(....);
$("#close-3").on(....);
$("#popup-1").fadeIn()
$("#popup-2").fadeIn()
to using classes and attributes:
$(".popup-handler").on(.. check if open/close -> then action..);
$(".popup").filter(.. check for specific reference..).fadeIn()
And if you want to interact elements with different classes, add data attributes to them so you can find them when needed. Here is a simple example:
<!-- popup nr 1 -->
<div class="popup-handler" data-rel="1" data-action="open"></div>
<div class="popup" data-rel="1">
<div class="popup-handler" data-rel="1" data-action="close"></div>
</div>
<!-- popup nr 2 -->
<div class="popup-handler" data-rel="2" data-action="open"></div>
<div class="popup" data-rel="2">
<div class="popup-handler" data-rel="2" data-action="close">x</div>
</div>
<!-- jQuery -->
$(".popup-handler").on("click", function() {
/* get popup reference & action */
var rel = $(this).data("rel"),
action = $(this).data("action");
/* find the target popup */
var $popup = $(".popup").filter("[data-rel=" + rel + "]");
if (action == "open") {
$popup.fadeIn("slow");
/* ... other code when opening a popup... */
}
if (action == "close") {
$popup.fadeOut("slow");
/* ... other code when closing a popup... */
}
});
Demo here - 4 popups, working: jsfiddle
(Defining the same functions inside a while loop is generally a bad idea.)
Related
I have created one shortcode to return a tab content and it is working fine
if I am using one time in a page.But if want one more on this same page it is not working. I have tried in several way but its not giving fruits.
Here is the code
if($tab_box == 'tab_box_1' && $tabs_lay == 'awavc-tabs-pos-left') {
$add_class = rand(99,9999);
$q = rand(99,99999);
$html .= '
<div class="awavc-tabs awavc-tabs-'.$add_class.' '.$tabs_lay.' '.$tab_style.' awavc-tabs-response-to-icons '.$el_class.' ">';
$i = 1;
foreach($tab_contents as $tab_content){
$tab_lable = 'Lable';
$tab_icon = '';
if(!empty($tab_content['tab_lbl'])){$tab_lable = $tab_content['tab_lbl'];}
if(!empty($tab_content['icon'])){$tab_icon = $tab_content['icon'];}
$html .= ' <input type="radio" name="awavc-tabs" checked id="awavc-tab-'.$i.'" class="awavc-tab-content-'.$i.'">
<label for="awavc-tab-'.$i.'"><span><span style="font-size:'.$lable_size.'px;color:'.$lable_clr.';"><i class="'.$tab_icon.'" style="font-size:'.$lable_size.'px;color:'.$icon_clr.';"></i>'.$tab_lable.'</span></span></label>';
$i++;
}
$html .= '
<ul>';
$i = 1;
foreach($tab_contents as $tab_content){
$tab_title = 'Title';
$content = '';
if(!empty($tab_content['title'])){$tab_title = $tab_content['title'];}
if(!empty($tab_content['content'])){$content = $tab_content['content'];}
$html .= '<li class="awavc-tab-content-'.$i.'">
<div class="typography">';
if(!empty($tab_title)){ $html .= '<h1 style="font-size:'.$ttl_size.'px;color:'.$ttl_clr.';">'.$tab_title.'</h1>';}
$html .= '
<p style="font-size:'.$content_size.'px;color:'.$content_clr.';font-style:'.$content_style.';">'.$content.'</p>
</div>
</li>';
$i++;
}
I have tried something like $i.$add_class but...
If you want to use the shortcode multiple times on the same page do it like so:
add_shortcode("fmg_shortcode", "fmg_callback");
function fmg_callback($args) {
ob_start();
$html = "";
//your code here
echo $html;
return ob_get_clean();
}
I am really stuck on an issue. I have some PHP code that outputs correctly to HTML and displays as it should in the browser (and firebug shows the source is correct), but because the information is sent by PHP to display a list of clients, my jQuery on click 'Options' menu will not work - it gets ignored. If the rows are written in flat HTML, the jQuery on click works for the 'Options' menu, so I know the jQuery is fine. On click of 'Options', the 'action-menu' ul list should toggle its display and go from none to block.
PHP:
<?php
include('dbConfig.php');
$term = $_POST['searchit'];
if($term == ''){
echo '<div class="row"><div class="col-2"></div>Enter a search term</div>';
} else {
if($client = $db->prepare("SELECT client_id, client_unique_id, client_first_name, client_last_name, client_organisation_name, client_telephone, client_list_all FROM clients WHERE client_unique_id LIKE ? OR client_first_name LIKE ? OR client_last_name LIKE ? OR client_organisation_name LIKE ? OR client_address_line_1 LIKE ? OR client_list_all LIKE ? ORDER BY client_id DESC")){
$client->bind_param('ssssss', $term, $term, $term, $term, $term, $term);
$client->execute();
$client->bind_result($client_id, $client_unique_id, $client_first_name, $client_last_name, $client_business, $client_telephone, $client_list_all);
$client->store_result();
$string = '';
if($client->num_rows > 0){
while($client->fetch()){
$properties = $db->prepare("SELECT property_id FROM properties WHERE property_client_id = ? LIMIT 1");
$properties->bind_param('i', $client_id);
$properties->execute();
$properties->store_result();
$properties->bind_result($property_id);
if($properties->num_rows > 0 ){
$active = '<span class="label label-success">ACTIVE</span>';
} else {
$active = '<span class="label label-warning">INACTIVE</span>';
}
if(!$client_business){
$client_business = 'N/A';
}
$properties->close();
$string .= '<div class="row">';
$string .= '<div class="col-2">'.$client_unique_id.'</div>';
$string .= '<div class="col-3">'.$client_first_name.' '.$client_last_name.'</div>';
$string .= '<div class="col-3">'.$client_business.'</div>';
$string .= '<div class="col-2">'.$client_telephone.'</div>';
$string .= '<div class="col-2 align-center">';
$string .= '<div class="action">Options<span class="action-arrow"><i class="fa fa-caret-down"></i></span>';
$string .= '<ul class="action-menu">';
$string .= '<li><i class="fa fa-folder-open-o"></i>View client</li>';
$string .= '<li><i class="fa fa-pencil-square-o"></i>Edit client</li>';
$string .= '<li><a onclick="deleteItem($(this))" style="cursor: pointer;" data-client-id="'.$client_id.'"><i class="fa fa-trash-o"></i>Delete client</a></li>';
$string .= '</ul>';
$string .= '</div>';
$string .= '</div>';
$string .= '</div>';
}
$client->close();
} else {
$string = '<div class="row"><div class="col-2"></div>No record found</div>';
}
echo $string;
} else {
echo '<div class="row"><div class="col-2"></div>ERROR: Could not prepare SELECT Client SQL statement.</div>';
}
}
?>
And the jQuery:
$(document).ready(function () {
$('.action').on('click', function () {
$('.action-menu').fadeToggle(200);
$(this).toggleClass('action-on');
});
});
Try changing your jQuery like this:
$(document).ready(function () {
$('div.row').on('click', '.action', function () {
$('.action-menu').fadeToggle(200);
$(this).toggleClass('action-on');
});
});
This will target the .action class elements no matter when they are loaded. Adding the selector parameter into the .on() method lets jQuery find elements that match no matter when they are created. If you have .action elements outside of the .row element, select for an element that contains them all. If all else fails, use body.
If you are adding the HTML dynamically, you can add the onclick event to any reliable parent that would exist on DOM load (eg:body).
Try to change the onclick like below,
$('body').on('click', '.action', function ()
{
$('.action-menu').fadeToggle(200);
$(e.target).toggleClass('action-on');
});
Thanks for all the support. The jQuery code that required this to work needed to be placed in the actual HTML file at the end of the PHP script - for reasons unknown, as it would not listen to the same code in the javascript.js file
I have simple jquery file which slide news, but now some problem has occurred and it's not selecting element. while debugging it shos null value in triggers.
Code for Php file
<?php
/**
* copyright (C) 2008 GWE Systems Ltd - All rights reserved
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
/**
* HTML View class for the module frontend
*
* #static
*/
include_once(JPATH_SITE."/modules/mod_jevents_latest/tmpl/default/latest.php");
class GeraintModLatestView extends DefaultModLatestView
{
function displayLatestEvents(){
$document = JFactory::getDocument();
$this->getLatestEventsData();
$content = "";
$var=count($this->eventsByRelDay);
$testVar=1;
if(isset($this->eventsByRelDay) && count($this->eventsByRelDay)){
$content .='<html>';
$content.='<body>';
$urls= "http://localhost/Mineral/modules/mod_jevents_latest/tmpl/myjs/jquery.min.js";
$content.='<script src="'.$urls.'"></script>';
$urls= "http://localhost/Mineral/modules/mod_jevents_latest/tmpl/myjs/slideshow.js";
$content.='<script src="'.$urls.'"></script>';
$content.='<script> jQuery.noConflict(true);</script>';
$content.='<div style="height:200px; width=300px; overflow: hidden; position:relative; top:0; border:5px double #206BA4; border-radius:7px; text-align:center; ">';
$content .= '<ul class="triggers" width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
// Now to display these events, we just start at the smallest index of the $this->eventsByRelDay array
// and work our way up.
$firstTime=true;
$lastElem=false;
// initialize name of com_jevents module and task defined to view
// event detail. Note that these could change in future com_event
// component revisions!! Note that the '$this->itemId' can be left out in
// the link parameters for event details below since the event.php
// component handler will fetch its own id from the db menu table
// anyways as far as I understand it.
$task_events = 'icalrepeat.detail';
$this->processFormatString();
foreach($this->eventsByRelDay as $relDay => $daysEvents){
reset($last);
reset($daysEvents);
// get all of the events for this day
foreach($daysEvents as $dayEvent){
if($testVar==$var)
$lastTime=true;
if(($dayEvent->bgcolor()=='#FF0000')&&($lastTime))
$dst = "text-decoration:blink;border-color:".$dayEvent->bgcolor();
else
$dst = "border-color:".$dayEvent->bgcolor();
if($firstTime) $content .= '<li style="'.$dst.'">';
else $content .= '<li style="'.$dst.'">';
// generate output according custom string
foreach($this->splitCustomFormat as $condtoken) {
if (isset($condtoken['cond'])) {
if ( $condtoken['cond'] == 'a' && !$dayEvent->alldayevent()) continue;
else if ( $condtoken['cond'] == '!a' && $dayEvent->alldayevent()) continue;
else if ( $condtoken['cond'] == 'e' && !($dayEvent->noendtime() || $dayEvent->alldayevent())) continue;
else if ( $condtoken['cond'] == '!e' && ($dayEvent->noendtime() || $dayEvent->alldayevent())) continue;
else if ( $condtoken['cond'] == '!m' && $dayEvent->getUnixStartDate()!=$dayEvent->getUnixEndDate() ) continue;
else if ( $condtoken['cond'] == 'm' && $dayEvent->getUnixStartDate()==$dayEvent->getUnixEndDate() ) continue;
}
foreach($condtoken['data'] as $token) {
unset($match);
unset($dateParm);
$dateParm="";
$match='';
if (is_array($token)) {
$match = $token['keyword'];
$dateParm = isset($token['dateParm']) ? trim($token['dateParm']) : "";
}
else if (strpos($token,'${')!==false){
$match = $token;
}
else {
$content .= $token;
continue;
}
$this->processMatch($content, $match, $dayEvent, $dateParm,$relDay);
} // end of foreach
} // end of foreach
$content .= "</li>\n";
$firstTime=false;
$testVar++;
} // end of foreach
} // end of foreach
//$content=var_dump($var);
$content .="</ul>";
$content .="</div>";
$content .="</body>";
$content .="</html>";
} else {
$content.='<div style="height:200px; width=300px; overflow: hidden; position:relative; top:0; border:5px double #206BA4; border-radius:7px; text-align:center; ">';
$content .= '<ul class="mod_events_latest_table" width="100%" border="0" cellspacing="0" cellpadding="0" align="center">';
$content .= '<li class="mod_events_latest_first" >'. JText::_('JEV_NO_EVENTS') . '</li>' . "\n";
$content .="</ul>\n";
$content.='</div>';
}
$callink_HTML = '<div class="mod_events_latest_callink">'
.$this->getCalendarLink()
. '</div>';
if ($this->linkToCal == 1) $content = $callink_HTML . $content;
if ($this->linkToCal == 2) $content .= $callink_HTML;
if ($this->displayRSS){
$rssimg = JURI::root() . "media/system/images/livemarks.png";
$callink_HTML = '<div class="mod_events_latest_rsslink">'
.'<a href="'.$this->rsslink.'" title="'.JText::_("RSS_FEED").'" target="_blank">'
.'<img src="'.$rssimg.'" alt="'.JText::_("RSS_FEED").'" />'
.JText::_("SUBSCRIBE_TO_RSS_FEED")
. '</a>'
. '</div>';
$content .= $callink_HTML;
}
return $content;
} // end of function
} // end of class
Jquery file
$(window).load(function ()
{
jQuery.noConflict();
var triggers = $('ul.triggers li');
var lastElem = triggers.length-1;
var target;
triggers.first().addClass('selected');
triggers.hide().first().show();
function sliderResponse(target)
{
triggers.removeClass('selected').
fadeOut(9000).eq(target).addClass('selected').fadeIn(9000);
}
function sliderTiming()
{
if(triggers.length==1)
{
triggers.first().show();
clearInterval(timingRun);
}
else
{
target = $('ul.triggers li.selected').index();
if ( target === lastElem )
{ target = 0; }
else
{ target = target+1; }
sliderResponse(target);
}
}
var timingRun = setInterval(function() { sliderTiming(); },9000);
function resetTiming()
{
clearInterval(timingRun);
timingRun = setInterval(function() { sliderTiming(); },9000);
}
});
The same file working correctly in other joomla template. and i think their must not be problem of any conflict as i have checked it by disabling other model.
I'm fairly new to both PHP and Javascript, so please forgive my ignorance and poor use of terminology, but I'll do my best to explain exactly what I'm struggling to achieve.
I have information stored in a PHP array that I call to my index page using the function below (the code below is in a separate PHP file called articles.php that's included in my index.php) :
<?php
function get_news_feed($article_id, $article) {
$output = "";
$output .= '<article class="img-wrapper">';
$output .= '<a href="article.php?id=' . $article_id . '">';
$output .= '<div class="news-heading">';
$output .= "<h1>";
$output .= $article["title"];
$output .= "</h1>";
$output .= "<p>";
$output .= "Read more...";
$output .= "</p>";
$output .= "</div>";
$output .= '<div id="news-img-1">';
$output .= "</div>";
$output .= "</a>";
$output .= "</article>";
return $output;
}
$articles = array();
$articles[] = array(
"title" => "Andy at NABA",
"description" => "Docendi, est quot probo erroribus id.",
"img" => "img/gym-01.jpg",
"date" => "05/04/2013"
);
$articles[] = array(
"title" => "Grand Opening",
"description" => "Docendi, est quot probo erroribus id.",
"img" => "img/gym-01.jpg",
"date" => "05/04/2013"
);
?>
My index.php looks like the following minus some HTML that plays no role in this process:
<?php
include("inc/articles.php");
?>
<?php
$pageTitle = "Home";
include("inc/header.php");
?>
<section class="col-4 news">
<?php
$total_articles = count($articles);
$position = 0;
$news_feed = "";
foreach($articles as $article_id => $article) {
$position = $position + 1;
if ($total_articles - $position < 2) {
$news_feed .= get_news_feed($article_id, $article);
}
}
echo $news_feed;
?>
</section>
I am aiming to dynamically change the CSS Background-Image property of the div element with ID news-img-1 using Javascript.
I have tried such things as:
document.getElementById('news-img-1').style.backgroundImage = 'url('<?php $article["img"]; ?>')';
document.getElementById('news-img-1').style.backgroundImage = 'url('http://www.universalphysique.co.uk/' + '<?php $article["img"]; ?>')';
document.getElementById('news-img-1').style.backgroundImage = 'url('window.location.protocol + "//" + window.location.host + "/" + '<?php $article["img"]; ?>')';
.....but I'm getting nowhere!! My code in practise works because the following Javascript inserts an image correctly:
document.getElementById('news-img-1').style.backgroundImage = 'url("img/gym-01.jpg")';
Here is my site up and running, the images should be placed in the empty circles you'll see! Any help would be great, this ones tough for me!!
comparing the hard coded javascript to ones that don't work, I notice that you are not including the double-quotes around the <?php $article["img"]; ?> snippet. The hard coded one shows
= 'url("img/gym-01.jpg")'
but the ones with the php snippet will produce
= 'url(img/gym-01.jpg)'
so perhaps if you modify it to
document.getElementById('news-img-1').style.backgroundImage = 'url("'<?php $article["img"]; ?>'")';
OR
edit the get_news_feed function as follows:
replace these lines
$output .= '<div id="news-img-1">';
$output .= "</div>";
with
$output .= '<div class="news-img"><img src="' . $article["img"] . '"></div>' ;
and change your css like so:
article.img-wrapper {
position: relative;
}
div.news-img {
position: absolute;
top: 0;
z-index: -1000;
}
OR
Modify your get_news_feed function, change the statement for the <div id="news-img-1"> output to include a data-url attribute like:
$output .= '<div class="news-img" data-url="' . $article["img"] . '">';
Then add a jquery statement like:
$(".news-img").each( function() {
$(this).css("background-image", "url(" + $(this).data("url") +")" );
});
The jquery statement goes in a static js file as opposed to generating the script in php.
You need to remove the quotes from your PHP tags and see if it works!
Do it like this:
document.getElementById('news-img-1').style.backgroundImage = 'url(' + <?php $article["img"]; ?> + ')';
Hope it helps.
I've some issues with a geolocation script I'm working on and maybe someone could help me here :).
For this script I have 4 files :
functions.js:
function geolocation(){
GMaps.geolocate({
success: function(position) {
var userLat = position.coords.latitude;
var userLng = position.coords.longitude;
var dataString = 'userLat='+userLat+'&userLng='+userLng;
$.ajax({
type : 'POST',
url : 'getEvents.php',
data : dataString,
dataType : 'text',
success : function(msg){
console.log(msg);
}
});
},
error: function(error) {
alert('Echec de la localisation...');
},
not_supported: function() {
alert('Votre navigateur ne supporte pas la géolocalisation...');
}
});
}
index.php:
<?php require 'php/getEvents.php'; ?>
<!DOCTYPE html>
<html lang="fr">
<?php include('inc/head.html'); ?>
<body>
<div class="mosaic">
<?php echo visitorMosaicBox($data); ?>
</div>
<script type="text/javascript">
$(document).ready(function(){
geolocation();
});
</script>
</body>
</html>
getEvents.php:
<?php
session_start();
require 'db-connect.php';
require 'lib.php';
$userLat = $_POST['userLat'];
$userLng = $_POST['userLng'];
$area = 10;
$i = 0;
$data = array();
if($userLat != '' && $userLng != ''){
if(isset($_SESSION['id'])){
echo 'Logged';
}else{
try{
$sql = "SELECT restaurants.cover, restaurants.name, restaurants.address, restaurants.location, restaurants.zip, events.title, events.trailer, events.id
FROM events
LEFT JOIN restaurants ON restaurants.id = events.fk_restaurants";
$req = $db->query($sql);
}catch(PDOException $e){
echo 'Erreur: '.$e->getMessage();
}
while($res = $req->fetch()){
$fetchAddress = $res['address'].', '.$res['zip'].' '.$res['location'];
$fixedAddress = str_replace(' ','+',$fetchAddress);
$geocode = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.$fixedAddress.'&sensor=false');
$output = json_decode($geocode);
$lat = $output->results[0]->geometry->location->lat;
$lng = $output->results[0]->geometry->location->lng;
$distance = distance($userLat, $userLng, $lat, $lng, false);
if($distance <= $area){
$data[$i] = array(
"id" => $res['id'],
"name" => $res['name'],
"cover" => $res['cover'],
"address" => $fetchAddress,
"title" => $res['title'] ,
"trailer" => $res['trailer'],
);
$i++;
}
}
}
}else{
$data = 'ERROR';
}
?>
lib.php :
<?php
function visitorMosaicBox($array){
for($i=0; $i<sizeOf($array);$i++){
$html = '<div class="box" id="box-'.$i.'">';
$html .= '<img src="'.$array[$i]['cover'].'" alt="'.$array[$i]['name'].'" />';
$html .= '<span class="ribbon"></span>';
$html .= '<div class="back"></div>';
$html .= '<div class="infos" id="event-'.$array[$i]['id'].'">';
$html .= '<p class="msg"></p>';
$html .= '<div class="txt-1">';
$html .= '<span class="sits"><span class="dinners">5</span></span>';
$html .= '<h3>'.$array[$i]['title'].'<span class="block">'.$array[$i]['name'].'</span></h3>';
$html .= '<ul class="actions">';
$html .= '<li>Partager</li>';
$html .= '<li>Participer</li>';
$html .= '<li class="last">Info</li>';
$html .= '</ul>';
$html .= '</div>'; // Fin de .txt-1
$html .= '<div class="txt-2">';
$html .= '<h3>'.$array[$i]['title'].'</h3>';
$html .= '<p>'.$array[$i]['trailer'].'</p>';
$html .= 'Fermer';
$html .= '</div>'; // Fin de .txt-2
$html .= '</div>'; // Fin de .infos
$html .= '</div>'; // Fin de .box
return $html;
}
}
?>
So now what's that's supposed to do...
1/ functions.js geolocates the visitor, gets his coordonates (lat,lng) and send them to my getEvents.php
2/ getEvents.php receives the coordonates from functions.js, and compare them with the results from the database.
3/ If the distance between the result and the user is lower than the area (10) then I store all the datas from the result in my array $data.
4/ The function visitorMosaicBox() creates as many divs as there are results in my array.
5/ In index.php, I simply call visitorMosaicBox() by passing my array $data.
My problem is that no divs are created even if there are results. I receive the visitor's coordonates in my getEvents.php file but in my index.php file the coordonates doesn't exists.
Does anyone know why my coordonates can't pass from my getEvents.php file to my index.php file please ? Any solution ?
If I split my script in these 4 files it's because I'll need to do other stuffs on my getEvents.php file depending on the visitor is connected or not, etc...
Thanks and sorry for this long question.
Antho