Example #1
0
 * @author Will <*****@*****.**>
 * 
 * @package gmap
 * @subpackage functions
 */
if ($gBitSystem->isPackageActive('geo') && $gBitSystem->isPackageActive('gmap') && $gBitSystem->isFeatureActive('gmap_api_key')) {
    // list results will be assigned to contentList by liberty
    $contentList = array();
    // get users geo location if they have one
    /**
     * @TODO this really should be taken care of the initial load of gBitUser, however
     * because of the way each bit_setup_inc file is currently processed it doesn't happen.
     * bitweaver needs better initialization process, then this cruft can be removed.
     **/
    require_once GEO_PKG_PATH . 'LibertyGeo.php';
    $geo = new LibertyGeo($gBitUser->mContentId);
    $geo->load();
    array_push($gBitUser->mInfo, $geo->mInfo);
    // if we have at least one content type guid or we have a distance request then we want a list
    if (!empty($_REQUEST['content_type_guid']) || !empty($_REQUEST['distance'])) {
        // if we have distance we need a center to check from
        if (!empty($_REQUEST['distance'])) {
            if (!is_numeric($_REQUEST['distance'])) {
                $gBitSystem->fatalError('Invalid distance value, distance must be a number. Note, the default unit is kilometers.');
            }
            // start with defaults - we'll use these if we don't have a better reference point
            $dLat = $gBitSystem->getConfig('gmap_lat');
            $dLng = $gBitSystem->getConfig('gmap_lng');
            // if lat and lng are set and numeric use them otherwise fatal to report bad value
            if (!empty($_REQUEST['lat']) && !empty($_REQUEST['lng'])) {
                if (!is_numeric($_REQUEST['lat'])) {
Example #2
0
function geo_content_expunge(&$pObject)
{
    $geo = new LibertyGeo($pObject->mContentId);
    $geo->expunge();
}