public static function getAttrbutesListArrayByCacheId($cacheId, $firstLetterUppercase = false) { return attribute::getAttrbutesListArrayInternal($cacheId, false, $firstLetterUppercase); }
} $loganz = sizeof($logs); $tpl->assign('logs', $logs); $tpl->assign('loganz', $loganz); /*end insertion Uwe 20091215*/ /* nature protection areas */ $rs = sql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`type_id` AS `npaType`, `npa_areas`.`name` AS `npaName`, `npa_types`.`name` AS `npaTypeName` \r\n\t FROM `cache_npa_areas` \r\n\t INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id` \r\n\t INNER JOIN `npa_types` ON `npa_areas`.`type_id`=`npa_types`.`id` \r\n\t WHERE `cache_npa_areas`.`cache_id`='&1' AND `npa_types`.`no_warning`=0\r\n\t GROUP BY `npa_areas`.`type_id`, `npa_areas`.`name`\r\n\t ORDER BY `npa_types`.`ordinal` ASC", $cacheid); $tpl->assign_rs('npaareasWarning', $rs); sql_free_result($rs); $rs = sql("SELECT `npa_areas`.`id` AS `npaId`, `npa_areas`.`type_id` AS `npaType`, `npa_areas`.`name` AS `npaName`, `npa_types`.`name` AS `npaTypeName` \r\n\t FROM `cache_npa_areas` \r\n\t INNER JOIN `npa_areas` ON `cache_npa_areas`.`npa_id`=`npa_areas`.`id` \r\n\t INNER JOIN `npa_types` ON `npa_areas`.`type_id`=`npa_types`.`id` \r\n\t WHERE `cache_npa_areas`.`cache_id`='&1' AND `npa_types`.`no_warning`=1\r\n\t GROUP BY `npa_areas`.`type_id`, `npa_areas`.`name`\r\n\t ORDER BY `npa_types`.`ordinal` ASC", $cacheid); $tpl->assign_rs('npaareasNoWarning', $rs); sql_free_result($rs); /* attributes */ $tpl->assign('attributes', attribute::getAttrbutesListArrayByCacheId($cacheid)); /* geokrets */ $rsGeoKret = sql("SELECT `gk_item`.`id`, `gk_item`.`name` AS `itemname`, `gk_user`.`name` AS `username` FROM `gk_item` INNER JOIN `gk_item_waypoint` ON `gk_item`.`id`=`gk_item_waypoint`.`id` INNER JOIN `gk_user` ON `gk_item`.`userid`=`gk_user`.`id` INNER JOIN `caches` ON `gk_item_waypoint`.`wp`=`caches`.`wp_oc` WHERE `caches`.`cache_id`='&1' AND `gk_item`.`typeid`!=2 AND `gk_item`.`stateid` IN (0, 3) AND `gk_item_waypoint`.`wp`!='' UNION \r\n\t SELECT `gk_item`.`id`, `gk_item`.`name` AS `itemname`, `gk_user`.`name` AS `username` FROM `gk_item` INNER JOIN `gk_item_waypoint` ON `gk_item`.`id`=`gk_item_waypoint`.`id` INNER JOIN `gk_user` ON `gk_item`.`userid`=`gk_user`.`id` INNER JOIN `caches` ON `gk_item_waypoint`.`wp`=`caches`.`wp_gc` WHERE `caches`.`cache_id`='&1' AND `gk_item`.`typeid`!=2 AND `gk_item`.`stateid` IN (0, 3) AND `gk_item_waypoint`.`wp`!='' UNION \r\n\t SELECT `gk_item`.`id`, `gk_item`.`name` AS `itemname`, `gk_user`.`name` AS `username` FROM `gk_item` INNER JOIN `gk_item_waypoint` ON `gk_item`.`id`=`gk_item_waypoint`.`id` INNER JOIN `gk_user` ON `gk_item`.`userid`=`gk_user`.`id` INNER JOIN `caches` ON `gk_item_waypoint`.`wp`=`caches`.`wp_nc` WHERE `caches`.`cache_id`='&1' AND `gk_item`.`typeid`!=2 AND `gk_item`.`stateid` IN (0, 3) AND `gk_item_waypoint`.`wp`!='' ORDER BY `itemname`", $cacheid); $tpl->assign_rs('geokret', $rsGeoKret); $tpl->assign('geokret_count', sql_num_rows($rsGeoKret)); sql_free_result($rsGeoKret); if (isset($_REQUEST['print']) && $_REQUEST['print'] == 'y') { $tpl->popup = 1; $tpl->assign('print', true); $tpl->name = 'viewcache_print'; $tpl->assign('log', $_REQUEST['log']); } if ($login->userid > 0) { $useropt = new useroptions($login->userid); $tpl->assign('userzoom', $useropt->getOptValue(USR_OPT_GMZOOM));
$tpl->assign('nUserLon', $nUserLon); $tpl->assign('nUserLat', $nUserLat); $tpl->assign('nGMInitLon', $nGMInitLon); $tpl->assign('nGMInitLat', $nGMInitLat); $tpl->assign('nGMInitZoom', $nGMInitZoom); $tpl->assign('bGMInitCookiePos', $bGMInitCookiePos ? 1 : 0); $tpl->assign('sGMInitWaypoint', $sGMInitWaypoint); $tpl->assign('bFullscreen', $fullscreen ? 1 : 0); $rsCacheType = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`short2`) AS `text` FROM `cache_type` LEFT JOIN `sys_trans_text` ON `cache_type`.`short2_trans_id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_type`.`ordinal` ASC", $opt['template']['locale']); $tpl->assign_rs('aCacheType', $rsCacheType); sql_free_result($rsCacheType); $rsCacheSize = sql("SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `text` FROM `cache_size` LEFT JOIN `sys_trans_text` ON `cache_size`.`trans_id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_size`.`ordinal` ASC", $opt['template']['locale']); $tpl->assign_rs('aCacheSize', $rsCacheSize); sql_free_result($rsCacheSize); /* assign attributes */ $tpl->assign('aAttributes', attribute::getSelectableAttrbutesListArray()); $aAttributesDisabled = array(); $maxaid = 0; $rs = sql("SELECT `id` FROM `cache_attrib`"); while ($r = sql_fetch_assoc($rs)) { $aAttributesDisabled[] = $r['id']; if ($r['id'] > $maxaid) { $maxaid = $r['id']; } } sql_free_result($rs); $tpl->assign('aAttributesDisabled', $aAttributesDisabled); $tpl->assign('maxAttributeId', $maxaid); // options $useroptions = new useroptions($login->userid); $tpl->assign('opt_menumap', $useroptions->getOptValue(USR_OPT_MAP_MENU));
/** * Adds writing an attribute to a grouped writing/deletion process. * * Set of values is filtered to exclude all empty strings. If resulting * set is empty whole attribute is deleted. * * @throws protocol_exception * @param attribute $attribute attribute to be adjusted * @param array $values set of values to be assigned to selected attribute * @return node current instance */ public function adjust(attribute $attribute, $values) { if (!is_array($this->adjustment)) { throw new protocol_exception('invalid use of grouped writing', $this->link, $this->getDN()); } $this->adjustment[$attribute->getName()] = array_filter(array_map(function ($a) { return trim($a); }, $values), function ($a) { return $a !== ''; }); return $this; }
} } closedir($hDir); } //article doesn't exists if ($language === false) { $tpl->redirect('index.php'); } } } } $tpl->name = 'articles'; $tpl->caching = true; $tpl->cache_id = 'articles|' . $language . '|' . $article; $tpl->cache_lifetime = 43200; $tpl->menuitem = sql_value("SELECT `id` FROM `sys_menu` WHERE `href`='&1' LIMIT 1", 0, 'articles.php?page=' . urlencode($article)); if ($tpl->menuitem == 0) { $tpl->redirect('index.php'); } if (!$tpl->is_cached()) { $tpl->assign('article', $article); $tpl->assign('language', $language); /* prepare smarty vars for special pages ... */ if ($article == 'cacheinfo') { require_once $opt['rootpath'] . 'lib2/logic/attribute.class.php'; $attributes = attribute::getSelectableAttrbutesListArray(true); $tpl->assign('attributes', $attributes); } } $tpl->display();
static function getAttrbutesListArrayByCacheId($cacheId) { return attribute::getAttrbutesListArrayInternal($cacheId, false); }
} } $tpl->assign('nGMInitLon', $nGMInitLon); $tpl->assign('nGMInitLat', $nGMInitLat); $tpl->assign('nGMInitZoom', $nGMInitZoom); $tpl->assign('bGMInitCookiePos', $bGMInitCookiePos ? 1 : 0); $tpl->assign('sGMInitWaypoint', $sGMInitWaypoint); $tpl->assign('bFullscreen', $sMode == 'fullscreen' ? 1 : 0); $rsCacheType = sql("SELECT `cache_type`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_type`.`name`) AS `text` FROM `cache_type` LEFT JOIN `sys_trans` ON `cache_type`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_type`.`ordinal` ASC", $opt['template']['locale']); $tpl->assign_rs('aCacheType', $rsCacheType); sql_free_result($rsCacheType); $rsCacheSize = sql("SELECT `cache_size`.`id`, IFNULL(`sys_trans_text`.`text`, `cache_size`.`name`) AS `text` FROM `cache_size` LEFT JOIN `sys_trans` ON `cache_size`.`trans_id`=`sys_trans`.`id` LEFT JOIN `sys_trans_text` ON `sys_trans`.`id`=`sys_trans_text`.`trans_id` AND `sys_trans_text`.`lang`='&1' ORDER BY `cache_size`.`ordinal` ASC", $opt['template']['locale']); $tpl->assign_rs('aCacheSize', $rsCacheSize); sql_free_result($rsCacheSize); /* assign attributes */ $tpl->assign('aAttributes', attribute::getAttrbutesListArray()); $aAttributesDisabled = array(); $rs = sql("SELECT `id` FROM `cache_attrib`"); while ($r = sql_fetch_assoc($rs)) { $aAttributesDisabled[] = $r['id']; } sql_free_result($rs); $tpl->assign('aAttributesDisabled', $aAttributesDisabled); $tpl->display(); function cache_locate($nLat, $nLon) { global $login; $nMaxDistance = 5; $rsCache = sql_slave("SELECT " . geomath::getSqlDistanceFormula($nLon, $nLat, $nMaxDistance) . " AS `distance`, \r\n\t `caches`.`wp_oc`\r\n\t FROM `caches` \r\n\t INNER JOIN `cache_status` ON `caches`.`status`=`cache_status`.`id`\r\n\t WHERE `caches`.`latitude`>'&1' AND \r\n \t\t\t\t\t\t\t\t\t\t `caches`.`latitude`<'&2' AND \r\n\t\t\t\t\t\t\t\t\t\t `caches`.`longitude`>'&3' AND \r\n\t\t\t\t\t\t\t\t\t\t `caches`.`longitude`<'&4' AND\r\n\t\t\t\t\t\t\t\t\t\t (`cache_status`.`allow_user_view`=1 OR `caches`.`user_id`='&1')\r\n\t\t\t\t\t ORDER BY `distance` ASC LIMIT 1", geomath::getMinLat($nLon, $nLat, $nMaxDistance), geomath::getMaxLat($nLon, $nLat, $nMaxDistance), geomath::getMinLon($nLon, $nLat, $nMaxDistance), geomath::getMaxLon($nLon, $nLat, $nMaxDistance), $login->userid); $rCache = sql_fetch_assoc($rsCache); sql_free_result($rsCache);