$va_text .= "unknown"; if (!empty($curSys["name"])) { $va_text = $curSys["name"]; } echo tts_override($va_text); exit; } /* * distance to X */ if (isset($_GET["dist"])) { $to = $_GET["dist"]; $distance = ""; //write_log($to); $to = str_replace("system", "", $to); if (system_exists($to)) { if (valid_coordinates($curSys["x"], $curSys["y"], $curSys["z"])) { $res = mysqli_query($GLOBALS["___mysqli_ston"], "\tSELECT\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsqrt(pow((IFNULL(edtb_systems.x, user_systems_own.x)-(" . $curSys["x"] . ")),2)+pow((IFNULL(edtb_systems.y, user_systems_own.y)-(" . $curSys["y"] . ")),2)+pow((IFNULL(edtb_systems.z, user_systems_own.z)-(" . $curSys["z"] . ")),2))\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAS distance\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM edtb_systems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLEFT JOIN user_systems_own ON edtb_systems.name = user_systems_own.name\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE edtb_systems.name = '" . mysqli_real_escape_string($GLOBALS["___mysqli_ston"], $to) . "'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1") or write_log(mysqli_error($GLOBALS["___mysqli_ston"]), __FILE__, __LINE__); $arr = mysqli_fetch_assoc($res); $distance = number_format($arr["distance"], 1); } } else { $distance = "I'm sorry, I didn't get that."; } echo $distance; is_null($___mysqli_res = mysqli_close($link)) ? false : $___mysqli_res; exit; } /* * curSys access */
function spgm_DisplayGalleryNavibar($strGalleryId, $strFilterFlags, $mixPictureId = '', $arrPictureFilenames) { global $spgm_cfg; spgm_Trace('<p>function spgm_DisplayGalleryNavibar</p>' . "\n" . 'strGalleryId: ' . $strGalleryId . '<br />' . "\n" . 'strFilterFlags: ' . $strFilterFlags . '<br />' . "\n" . 'mixPictureId: ' . $mixPictureId . '<br />' . "\n"); $arrExplodedPathToGallery = explode('/', $strGalleryId); print ' <div class="' . CLASS_DIV_GALHEADER . '">' . "\n"; // display main gallery link $filters = ''; if ($spgm_cfg['global']['propagateFilters']) { $filters = str_replace(PARAM_VALUE_FILTER_SLIDESHOW, '', $strFilterFlags); } if ($spgm_cfg['theme']['gallerySmallIcon'] != '') { print spgm_BuildLink($spgm_cfg['theme']['gallerySmallIcon'], CLASS_TD_GALITEM_TITLE, '', '', -1, -1, $filters); } else { print spgm_BuildLink($spgm_cfg['locale']['rootGallery'], CLASS_TD_GALITEM_TITLE, '', '', -1, -1, $filters); } // display each gallery of the hierarchy $strHtmlGalleryLink = $arrExplodedPathToGallery[0]; // to avoid the first '/' $_max = count($arrExplodedPathToGallery); $_strGalleryId = ''; for ($i = 0; $i < $_max; $i++) { $_strGalleryId .= $arrExplodedPathToGallery[$i] . '/'; $_strPathToGallery = DIR_GAL . $_strGalleryId; $_strPathToGalleryTitle = $_strPathToGallery . FILE_GAL_TITLE; $strHtmlGalleryName = ''; if (spgm_CheckPerms($_strPathToGalleryTitle)) { $arrTitle = file($_strPathToGalleryTitle); $strHtmlGalleryName = $arrTitle[0]; } else { $strHtmlGalleryName = str_replace('_', ' ', $arrExplodedPathToGallery[$i]); } print ' » '; // check if system is logged $loglink = is_logged($arrExplodedPathToGallery[$i]) ? '<a href="log.php?system=' . urlencode($arrExplodedPathToGallery[$i]) . '" style="color:inherit" title="System has log entries"><img src="/style/img/log.png" style="margin-left:5px" /></a>' : ""; // show link if system exists $sysinfo_link = system_exists($arrExplodedPathToGallery[$i]) ? '<a href="system.php?system_name=' . urlencode($arrExplodedPathToGallery[$i]) . '" style="color:inherit" title="System info"><img src="/style/img/info.png" style="margin-left:5px" /></a>' : ""; if ($i < $_max - 1) { print spgm_BuildLink($strHtmlGalleryName, CLASS_DIV_GALHEADER, '', $strHtmlGalleryLink, -1, -1, $filters); $strHtmlGalleryLink .= '/' . $arrExplodedPathToGallery[$i + 1]; } else { // Final gallery display $iCurrentPageIndex = 1; if (strstr($strFilterFlags, PARAM_VALUE_FILTER_NOTHUMBS) || strstr($strFilterFlags, PARAM_VALUE_FILTER_SLIDESHOW)) { if ($mixPictureId == '') { print $strHtmlGalleryName; } else { $iCurrentPageIndex = (int) ($mixPictureId / $spgm_cfg['conf']['thumbnailsPerPage']) + 1; print spgm_BuildLink($strHtmlGalleryName, CLASS_DIV_GALHEADER, '', $strHtmlGalleryLink, $iCurrentPageIndex, -1, str_replace(PARAM_VALUE_FILTER_SLIDESHOW, '', $strFilterFlags)); } } else { print $strHtmlGalleryName; } } print $sysinfo_link . $loglink; } // Notify if we are in "new picture mode" if (strstr($strFilterFlags, PARAM_VALUE_FILTER_NEW)) { print ' (' . $spgm_cfg['locale']['newPictures'] . ')'; } // Link to slideshow mode if ($spgm_cfg['conf']['enableSlideshow'] == true) { if (!strstr($strFilterFlags, PARAM_VALUE_FILTER_SLIDESHOW) && count($arrPictureFilenames) > 0) { print ' ['; print spgm_BuildLink($spgm_cfg['locale']['filterSlideshow'], CLASS_DIV_GALHEADER, '', $strHtmlGalleryLink, $iCurrentPageIndex, 0, str_replace(PARAM_VALUE_FILTER_SLIDESHOW, '', $strFilterFlags) . PARAM_VALUE_FILTER_SLIDESHOW); print ']'; } } print "\n" . ' </div>' . "\n"; }