Got it! It's working now, here's what I did. In the mod_geommunity3js.php file, I made the following edits in bold to the original file at ~line 986:
if($show_events)
{
$groupId = JRequest::getInt('groupid', '');
$script .="function loadEventMarkersFromCurrentBounds(map) {
dropOutofBoundsMarkers(map);
var bounds = map.getBounds();
var swPoint = bounds.getSouthWest();
var nePoint = bounds.getNorthEast();
var swLat = swPoint.lat();
var swLng = swPoint.lng();
var neLat = nePoint.lat();
var neLng = nePoint.lng();
var groupId = ".$groupId.";
jQuery.ajax({
url: 'index.php?option=com_geommunity3js&view=eventmarkers&format=json' ,
data: {
mapid: ".$mapid.",
swLat: swLat,
swLng: swLng,
neLat: neLat,
neLng: neLng,
groupId: groupId
},
type: 'POST',
dataType: 'json',
success: function (data) {
populateEventMarkers(data, map);
}
});
}
...................then in the eventmarkers.php file in the component I made these edits:
public function getEventmarkers()
{
$db = JFactory::getDBO();
$jinput = JFactory::getApplication()->input;
$mapid = $jinput->get('mapid');
$a = $swLat = $jinput->get('swLat');
$b = $swLng = $jinput->get('swLng');
$c = $neLat = $jinput->get('neLat');
$d = $neLng = $jinput->get('neLng');
$condition1 = $a < $c ? "latitude BETWEEN $a AND $c":"latitude BETWEEN $c AND $a";
$condition2 = $b < $d ? "longitude BETWEEN $b AND $d":"longitude BETWEEN $d AND $b";
$groupId = $jinput->get('groupId');
$q ="SELECT id , title , latitude , longitude
FROM #__community_events
WHERE published='1' AND enddate>=NOW()
AND ( $condition1 ) AND ( $condition2 ) AND contentid=$groupId";
$db->setQuery($q);
$markers = $db->loadObjectList();
return $markers;
}
Works now. Thanks for the advice on helping me with this.
Tim