/** * content of the middle column - this is the most important part */ protected function body() { // get the translation module $words = $this->getWords(); $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request); $request = PRequest::get()->request; $callbacktag = $this->layoutkit->formkit->setPostCallback('GeoController', 'SelectorCallback'); if (!($mem_redirect = $this->layoutkit->formkit->getMemFromRedirect())) { $locations_print = ''; } elseif ($mem_redirect->location) { $Geo = new GeoController(); $locations_print = $Geo->GeoSearch($mem_redirect->location, 40, false, $callbacktag); } else { $Geo = new GeoController(); $locations_print = $Geo->GeoSearch(' ', 40, false, $callbacktag); } // Just for testing: // if (isset($_SESSION['GeoVars'])) var_dump($_SESSION['GeoVars']); // if (isset($_SESSION['GeoVars']['geonamename'])) var_dump($_SESSION['GeoVars']['geonamename']); // if (isset($request[2]) && $request[2] == 'save' && $mem_redirect->geolocation) { // $geolocation = $mem_redirect->geolocation; // list($geonameid, $geonamename) = preg_split('/[//]/', $geolocation); // $_SESSION['SignupBWVars']['geonameid'] = $geonameid; // $_SESSION['SignupBWVars']['geonamename'] = $geonamename; // print 'GEO SET'; // } else { // print 'GEO NOT SET'; // } require 'templates/popup.php'; }
?> </span> <?php } ?> </a></li> </ol> <?php } ?> </div> </fieldset> <?php $Geo = new GeoController(); $Geo->layoutkit = $this->layoutkit; $Geo->SelectorInclude(); if (isset($vars['geonameid']) && !isset($_SESSION['GeoVars']['geonameid'])) { } isset($mem_redirect->location); ?> <?php echo $callback_tag; ?> <input type="hidden" name="javascriptactive" value="false" /> <?php if (in_array('inserror', $vars['errors'])) { echo '<p class="error">' . $errors['inserror'] . '</p>';
<?php /* geolocation.php Author: Logan Rasmussen Date: 3/8/2016 */ require_once "Controllers/GeoController.php"; $ip = null; if (isset($_REQUEST['ip'])) { $ip = $_REQUEST['ip']; } $controller = new GeoController($ip); $controller->start();
<?php } ?> </a> </li> </ol> <?php } ?> </div> </fieldset> </form> <?php $Geo = new GeoController(); $Geo->layoutkit = $this->layoutkit; $Geo->SelectorInclude(array('id' => $vars['id'])); ?> <form method="post" action="setlocation" name="signup" id="user-register-form"> <?php echo $callback_tag; ?> <input type="hidden" name="javascriptactive" value="false" /> <?php if (in_array('inserror', $vars['errors'])) { echo '<p class="error">' . $errors['inserror'] . '</p>'; }
public function SelectorInclude($formvars = false) { // get the translation module $words = $this->layoutkit->getWords(); $page_url = PVars::getObj('env')->baseuri . implode('/', PRequest::get()->request); $callbacktag = $this->layoutkit->formkit->setPostCallback('GeoController', 'SelectorCallback'); if ($formvars) { foreach ($formvars as $key => $value) { $callbacktag .= '<input type="hidden" name="' . $key . '" value="' . $value . '" >'; } } if (!($mem_redirect = $this->layoutkit->formkit->getMemFromRedirect())) { $locations_print = ''; } elseif ($mem_redirect->location) { $Geo = new GeoController(); $locations_print = $Geo->GeoSearch($mem_redirect->location, 40, true, $callbacktag); } else { $Geo = new GeoController(); $locations_print = $Geo->GeoSearch(' ', 40, true, $callbacktag); } // Just for testing: // if (isset($_SESSION['GeoVars'])) var_dump($_SESSION['GeoVars']); // if (isset($_SESSION['GeoVars']['geonamename'])) var_dump($_SESSION['GeoVars']['geonamename']); // if (isset($request[2]) && $request[2] == 'save' && $mem_redirect->geolocation) { // $geolocation = $mem_redirect->geolocation; // list($geonameid, $geonamename) = preg_split('/[\/\/]/', $geolocation); // $_SESSION['SignupBWVars']['geonameid'] = $geonameid; // $_SESSION['SignupBWVars']['geonamename'] = $geonamename; // print 'GEO SET'; // } else { // print 'GEO NOT SET'; // } require 'templates/popup.php'; }