示例#1
0
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         // fix up special html fields
         $post['intro'] = JRequest::getVar('intro', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $post['location'] = JRequest::getVar('location', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $post['date'] = JRequest::getVar('date', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $post['video_description'] = JRequest::getVar('video_description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         // Create the timestamp for the date
         if ($post['date'] == NULL) {
             $post['date'] = gmdate('Y-m-d H:i:s');
         }
         // Google Maps API key
         $key = "ABQIAAAA-uj5RW1kogN0YyP-wyKP2BQAuRVP6Z80a_tRDh8q5dbIEc8EOhR4SFpZ31-YUrSviFUWWajze6ymKA";
         // Set query
         $address = JRequest::getVar('address', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $address = str_replace(" ", "+", $address);
         $city = JRequest::getVar('city', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $zip = JRequest::getVar('zip', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $query = $address . '+' . $city . '+belgium';
         // Desired address
         $geocoding = "http://maps.googleapis.com/maps/api/geocode/json?address=" . $query . "&sensor=true";
         // Retrieve the URL contents
         $answer = file_get_contents($geocoding);
         $answer = json_decode($answer, true);
         $latitude = $answer['results']['0']['geometry']['location']['lat'];
         $longitude = $answer['results']['0']['geometry']['location']['lng'];
         $post['coordinates'] = $latitude . ',' . $longitude;
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }
示例#2
0
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         // fix up special html fields
         $text = JRequest::getVar('text', '', 'post', 'string', JREQUEST_ALLOWRAW);
         // Clean text for xhtml transitional compliance
         $text = str_replace('<br>', '<br />', $text);
         // Search for the {readmore} tag and split the text up accordingly.
         $pattern = '#<hr\\s+id=("|\')system-readmore("|\')\\s*\\/*>#i';
         $tagPos = preg_match($pattern, $text);
         if ($tagPos == 0) {
             $post['introtext'] = $text;
             $post['fulltext'] = "";
         } else {
             list($post['introtext'], $post['fulltext']) = preg_split($pattern, $text, 2);
         }
         if (empty($post['alias'])) {
             $post['alias'] = $post['name'];
         }
         $post['alias'] = JFilterOutput::stringURLSafe($post['alias']);
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }
示例#3
0
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         // fix up special html fields
         $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }
示例#4
0
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         if (empty($post['alias'])) {
             $post['alias'] = $post['name'];
         }
         $post['alias'] = JFilterOutput::stringURLSafe($post['alias']);
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }
示例#5
0
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         // fix up special html fields
         $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         if (empty($post['alias'])) {
             $post['alias'] = $post['name'];
         }
         $post['alias'] = JFilterOutput::stringURLSafe($post['alias']);
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         // fix up special html fields
         $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $post['date'] = JRequest::getVar('date', '', 'post', 'string', JREQUEST_ALLOWRAW);
         // Create the timestamp for the date
         if ($post['date'] == NULL) {
             $post['date'] = gmdate('Y-m-d H:i:s');
         }
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }
示例#7
0
 protected function _getRequest($hash = 'default', $mask = 0)
 {
     if ($hash == 'post') {
         $post = JRequest::get('post');
         // fix up special html fields
         $post['description'] = JRequest::getVar('description', '', 'post', 'string', JREQUEST_ALLOWRAW);
         $post['created'] = JRequest::getVar('created', '', 'post', 'string', JREQUEST_ALLOWRAW);
         // Create the timestamp for the date
         if ($post['created'] == NULL) {
             $post['created'] = gmdate('Y-m-d H:i:s');
         }
         if (empty($post['alias'])) {
             $post['alias'] = $post['name'];
         }
         $post['alias'] = JFilterOutput::stringURLSafe($post['alias']);
         return $post;
     }
     return parent::_getRequest($hash, $mask);
 }