コード例 #1
0
ファイル: search.php プロジェクト: pawelzielak/opencaching-pl
         }
     }
     $sql_select[] = '`caches`.`cache_id` `cache_id`';
     $sql_from[] = '`caches`';
     $sql_where[] = '`caches`.`cache_id` IN (' . $cache_bylist . ')';
 } elseif ($options['searchtype'] == 'bypt') {
     //print '<pre>';
     //print_r($_SESSION['geoPathCacheList']);
     if (isset($_SESSION['geoPathCacheList']) && count($_SESSION['geoPathCacheList']) > 0) {
         $cache_bylist = implode(",", $_SESSION['geoPathCacheList']);
         $options['gpxPtFileName'] = $_SESSION['ptName'];
     } else {
         $options['ptId'] = (int) $_REQUEST['ptId'];
         $cache_bylist = implode(",", powerTrailBase::getPtCachesIds($options['ptId']));
         $ptDetails = powerTrailBase::getPtDbRow($options['ptId']);
         $options['gpxPtFileName'] = powerTrailBase::clearPtNames($ptDetails['name']);
     }
     $sql_select[] = '`caches`.`cache_id` `cache_id`';
     $sql_from[] = '`caches`';
     $sql_where[] = '`caches`.`cache_id` IN (' . $cache_bylist . ')';
     // unset ($_SESSION['geoPathCacheList']);
 } elseif ($options['searchtype'] == 'bywaypoint' && $options['waypoint'] != '') {
     $sql_select[] = '`caches`.`cache_id` `cache_id`';
     $sql_from[] = '`caches`';
     $sql_where[] = '`caches`.`wp_' . sql_escape($options['waypointtype']) . '`=\'' . sql_escape($options['waypoint']) . '\'';
 } elseif ($options['searchtype'] == 'byfulltext') {
     require_once $rootpath . 'lib/ftsearch.inc.php';
     $fulltext = $options['fulltext'];
     $hashes = ftsearch_hash($fulltext);
     if (count($hashes) == 0) {
         $options['error_nofulltext'] = true;
コード例 #2
0
ファイル: powerTrail.php プロジェクト: kojoty/opencaching-pl
     tpl_set_var('PowerTrails', $ptListData[0]);
     tpl_set_var('ptList4map', $ptListData[1]);
     tpl_set_var('displayPowerTrails', 'block');
     if ($pt->getPowerTrailOwn() === false) {
         tpl_set_var('statusOrPoints', tr('pt037'));
     } else {
         tpl_set_var('statusOrPoints', tr('pt040'));
     }
     tpl_set_var('mapOuterdiv', 'block');
     tpl_set_var('mapInit', 1);
     tpl_set_var('fullCountryMap', '1');
     break;
 case 'showSerie':
     $powerTrail = new lib\Objects\PowerTrail\PowerTrail(array('id' => (int) $_GET['ptrail']));
     $ptOwners = $pt->getPtOwners();
     $_SESSION['ptName'] = powerTrailBase::clearPtNames($powerTrail->getName());
     tpl_set_var('powerTrailId', $powerTrail->getId());
     if (!$usr && $hide_coords) {
         tpl_set_var('mapOuterdiv', 'none');
     } else {
         tpl_set_var('mapOuterdiv', 'block');
     }
     $userIsOwner = $powerTrail->isUserOwner($usr['userid']);
     if ($powerTrail->getStatus() == 1 || $userIsOwner || $appContainer->getLoggedUser() !== false && $appContainer->getLoggedUser()->getIsAdmin()) {
         $ptTypesArr = powerTrailBase::getPowerTrailTypes();
         $ptStatusArr = \lib\Controllers\PowerTrailController::getPowerTrailStatus();
         $foundCachsByUser = $powerTrail->getFoundCachsByUser($usr['userid']);
         $leadingUser = powerTrailBase::getLeadingUser($powerTrail->getId());
         if ($powerTrail->getConquestedCount() > 0) {
             $removeCacheButtonDisplay = 'none';
         } else {