function getCrsDefsAsArray($s) { $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_crs` WHERE Code = " . returnDefault($s, 'text'); $data = getDataFromSQL($sql, __FILE__, "details", __FUNCTION__); if ($data['Count'] != 1) { exit; } else { return $data; } }
function addphpBBuser($login, $pwd, $mail, $lang) { $cryptpass = phpbb_hash($pwd); $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`forum_users` WHERE `username` = '" . $login . "'"; $dataset_exists = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); if ($dataset_exists['Count'] == 0) { $new_user_array = array('username' => stripslashes($login), 'user_password' => $cryptpass, 'user_email' => $mail, 'group_id' => 7, 'user_type' => 0, 'user_lang' => strtolower($lang)); $phpBBid = user_add($new_user_array); } }
function getAvgApproach($id_entry) { if ($id_entry != "") { $sql = "SELECT AVG(Approach) AS Avg FROM `" . $_SESSION['Application_host'] . "`.`T_comment` "; $sql .= "WHERE Id_entry=" . $id_entry . " AND Approach IS NOT NULL "; $array = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); return $array[0]["Avg"]; } else { return false; } }
/** * This file is part of GrottoCenter. * * GrottoCenter is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GrottoCenter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with GrottoCenter. If not, see <http://www.gnu.org/licenses/>. * * @copyright Copyright (c) 2009-2012 Clément Ronzon * @license http://www.gnu.org/licenses/agpl.txt */ function getNews($is_admin) { $sql = "SELECT n.*, "; $sql .= "CONCAT(if(caa.Surname is null,'',CONCAT(caa.Surname, ' ')), if(caa.Name is null,'',CONCAT(caa.Name , ' alias ')), caa.Nickname) AS Author, "; $sql .= "CONCAT(if(cab.Surname is null,'',CONCAT(cab.Surname, ' ')), if(cab.Name is null,'',CONCAT(cab.Name , ' alias ')), cab.Nickname) AS Reviewer "; $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_news` n "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` caa ON n.Id_author = caa.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` cab ON n.Id_reviewer = cab.Id "; if (!$is_admin) { $sql .= "WHERE n.Is_public = 'YES' "; } $sql .= "ORDER BY n.Id_answered, n.Date_inscription "; $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); return sortByThread($data); }
function getOverviewLayers($enabled) { $sql = "SELECT "; $sql .= "g.Code AS Group_code,g.Name AS Group_name,lbl." . $_SESSION['language'] . " AS Label,l.Code AS Layer_code,l.Url,l.Name AS Layer_name,l.Short_name,l.Layer,l.Style,l.Format,l.Version,l.Background_color "; $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_layer` l "; $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`J_group_layer` gl ON gl.Id_layer = l.Id "; $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_group_layer` g ON g.Id = gl.Id_group "; $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_label` lbl ON lbl.Id = g.Id_label "; if ($enabled) { $sql .= "WHERE l.Enabled = 'YES' "; } $sql .= "ORDER BY 1,2,3,4,5,6,7,8,9,10,11,12 "; $data = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); $group_code = ""; $return = ""; for ($i = 0; $i < $data['Count']; $i++) { if ($group_code != $data[$i]['Group_code']) { $group_code = $data[$i]['Group_code']; if ($return != "") { $return = substr($return, 0, strlen($return) - 1); $return .= '}},' . "\n"; } $return .= '"' . $group_code . '":{"NAME":"' . $data[$i]['Group_name'] . '", "SHORTNAME":"' . $data[$i]['Label'] . '", "OPACITY":opacity, "SPECS":{'; } $return .= '"' . $data[$i]['Layer_code'] . '":{"URL":"' . $data[$i]['Url'] . '", "NAME":"' . $data[$i]['Layer_name'] . '", "SHORTNAME":"' . $data[$i]['Short_name'] . '", "LAYER":"' . $data[$i]['Layer'] . '", "STYLE":"' . $data[$i]['Style'] . '", "FORMAT":"' . $data[$i]['Format'] . '", "VERSION":"' . $data[$i]['Version'] . '", "BGCOLOR":"' . $data[$i]['Background_color'] . '"}'; if ($group_code == $data[$i + 1]['Group_code']) { $return .= ','; } $return .= "\n"; } return $return . "}}"; }
/html/legal_and_privacy_De.php?lang=De</loc> <changefreq>monthly</changefreq> <priority>0.1</priority> </url> <url> <loc><?php echo $root; ?> /phpBB3/</loc> <changefreq>monthly</changefreq> <priority>0.1</priority> </url> <?php if ($doListFiles) { $sql = "SELECT Id, Name FROM `" . $app_prop['Host'] . "`.`T_entry` WHERE Is_public = 'YES' ORDER BY Name "; $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); $languagesArray = getAvailableLanguages(); for ($i = 0; $i < $data['Count']; $i++) { $changefreq = "monthly"; $priority = 0.5; foreach ($languagesArray as $shortLang => $largeLang) { $entry = $data[$i]['Name']; $entry = preg_replace('/([^\\(\\)]*)(\\(.*\\))/', '$2 $1', $entry); $entry = cleanString($entry); $loc = $root . "/?lang=" . $shortLang . "&entryId=" . $data[$i]['Id'] . "&entry=" . urlencode($entry); ?> <url> <loc><?php echo $loc; ?> </loc>
/** * This file is part of GrottoCenter. * * GrottoCenter is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * GrottoCenter is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with GrottoCenter. If not, see <http://www.gnu.org/licenses/>. * * @copyright Copyright (c) 2009-2012 Cl�ment Ronzon * @license http://www.gnu.org/licenses/agpl.txt */ function getProperties($category, $id, $isConnected, $labelsBlank, $labelsSinceDate, $addTitle, $systemArray = array(), $for_printer = false, $opener) { switch ($category) { case "entry": $AvgAe = getAvgAestheticism($id); $sqlAe = "SELECT round(Aestheticism) AS Aestheticism FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id_entry=" . $id; $AvgCa = getAvgCaving($id); $sqlCa = "SELECT round(Caving) AS Caving FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id_entry=" . $id; $AvgAp = getAvgApproach($id); $sqlAp = "SELECT round(Approach) AS Approach FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id_entry=" . $id; if (!$addTitle) { $histoAe = "<div onclick=\"JavaScript:infoHistoAe();\" class=\"histo\"><img src=\"" . getHistoSrc($sqlAe, 'Aestheticism') . "\" alt=\"image\" /></div>\n"; $histoCa = "<div onclick=\"JavaScript:infoHistoCa();\" class=\"histo\"><img src=\"" . getHistoSrc($sqlCa, 'Caving') . "\" alt=\"image\" /></div>\n"; $histoAp = "<div onclick=\"JavaScript:infoHistoAp();\" class=\"histo\"><img src=\"" . getHistoSrc($sqlAp, 'Approach') . "\" alt=\"image\" /></div>\n"; } else { $histoAe = ""; $histoCa = ""; $histoAp = ""; } $sql = "SELECT cat.*, ty." . $_SESSION['language'] . "_type AS typeName, ca.Name as NetwName, ca.Id as NetwId, ma.Name AS MasName, ma.Id AS MasId, "; //$sql .= "IF(ISNULL(ca.Id)=1,eybis.Min_depth,ca.Min_depth) AS Min_depth, "; //$sql .= "IF(ISNULL(ca.Id)=1,eybis.Max_depth,ca.Max_depth) AS Max_depth, "; $sql .= "IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth) AS Depth, "; $sql .= "IF(ISNULL(ca.Id)=1,eybis.Is_diving,ca.Is_diving) AS Is_diving, "; $sql .= "IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length) AS Length, "; $sql .= "IF(ISNULL(ca.Id)=1,eybis.Temperature,ca.Temperature) AS Temperature, "; $sql .= "IF(ISNULL(ca.Id)=1,NULL,(SELECT COUNT(*) FROM `" . $_SESSION['Application_host'] . "`.`J_cave_entry` WHERE ca.Id = Id_cave)) AS NumberOfEntries, "; $sql .= "GROUP_CONCAT(DISTINCT u.Url ORDER BY u.Url SEPARATOR '<br />\n') AS Partners "; $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_entry` cat "; $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_single_entry` eybis ON cat.Id = eybis.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_type` ty ON cat.Id_type = ty.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_cave_entry` ce ON cat.Id = ce.Id_entry "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_cave` ca ON ce.Id_cave = ca.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_massif_cave` mc ON (mc.Id_cave = ca.Id OR mc.Id_entry = cat.Id) "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_massif` ma ON ma.Id = mc.Id_massif "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_entry_url` eu ON eu.Id_entry = cat.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_url` u ON u.Id = eu.Id_url "; break; case "cave": $listSQL = "SELECT DISTINCT e.Id, e.Name "; $listSQL .= "FROM `" . $_SESSION['Application_host'] . "`.`T_entry` e "; $listSQL .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`J_cave_entry` ce ON ce.Id_entry = e.Id "; $listSQL .= "WHERE ce.Id_cave = " . $id . " AND e.Is_public = 'YES' "; if (!$isConnected) { $listSQL .= "AND e.Is_public = 'YES' "; } $listSQL .= "ORDER BY e.Name "; $entryList = getDataFromSQL($listSQL, __FILE__, "function", __FUNCTION__); $entriesList = ""; for ($index = 0; $index < $entryList["Count"]; $index++) { $entriesList .= "<a href=\"JavaScript:openMe(" . $entryList[$index]['Id'] . ", 'entry', false);\">" . $entryList[$index]['Name'] . "</a>, "; } $entriesList = substr($entriesList, 0, strlen($entriesList) - 2); $sql = "SELECT cat.*, ma.Name AS MasName, ma.Id AS MasId "; $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_cave` cat "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_massif_cave` mc ON mc.Id_cave = cat.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_massif` ma ON ma.Id = mc.Id_massif "; break; case "massif": $listSQL = "SELECT COUNT(*) AS Nb, "; $listSQL .= "-MAX(ABS(IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth))) AS Max_Depth, "; $listSQL .= "MAX(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Max_Length, "; $listSQL .= "SUM(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Sum_Length, "; $listSQL .= "-AVG(ABS(IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth))) AS Avg_Depth, "; $listSQL .= "STD(ABS(IF(ISNULL(ca.Id)=1,eybis.Depth,ca.Depth))) AS Std_Depth, "; $listSQL .= "AVG(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Avg_Length, "; $listSQL .= "STD(ABS(IF(ISNULL(ca.Id)=1,eybis.Length,ca.Length))) AS Std_Length "; $listSQL .= "FROM `" . $_SESSION['Application_host'] . "`.`T_entry` e "; $listSQL .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_single_entry` eybis ON e.Id = eybis.Id "; $listSQL .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_cave_entry` ce ON e.Id = ce.Id_entry "; $listSQL .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_cave` ca ON ca.Id = ce.Id_cave "; $listSQL .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`J_massif_cave` mc ON (mc.Id_cave = ce.Id_cave OR mc.Id_entry = e.Id) "; $listSQL .= "WHERE mc.Id_massif = " . $id . " "; $entriesStats = getDataFromSQL($listSQL, __FILE__, "function", __FUNCTION__); default: $sql = "SELECT cat.* "; $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_" . $category . "` cat "; break; } $sql .= "WHERE cat.Id = " . $id . " "; if (!$isConnected && $category == "entry") { $sql .= "AND cat.Is_public = 'YES' "; } if ($category == "entry") { $sql .= "GROUP BY cat.Id "; $sql .= "ORDER BY MasName DESC "; } $data = getDataFromSQL($sql, __FILE__, $opener, __FUNCTION__); if ($data['Count'] > 0) { $is_public = $data[0]['Contact_is_public']; $is_shown = $category == "caver" && ($is_public == Contact_for_registered && $isConnected || $is_public == Contact_for_everybody) || $category != "caver"; if ($addTitle) { if (isset($data[0]['Nickname'])) { $title_name = $data[0]['Nickname']; } else { $title_name = $data[0]['Name']; } $innerHTML .= getTopMenu(getCloseBtn("JavaScript:resetDetails();", "<convert>#label=371<convert>") . "<div class=\"frame_title\">" . setTitle("#", "details", "<convert>#label=440<convert> " . $title_name, 1) . "</div>"); //A propos de } if ($is_shown) { $innerHTML .= getInnerLine($data[0]['Name'], $data[0]['Name'], "<convert>#label=199<convert> :"); //Nom } $innerHTML .= getInnerLine($entriesList, $entriesList, "<convert>#label=384<convert> :"); //Entrées : $innerHTML .= getInnerLine($entriesStats[0]['Nb'], $entriesStats[0]['Nb'], "<convert>#label=384<convert> :"); //Entrées : $innerHTML .= getInnerLine($entriesStats[0]['Max_Depth'], round($entriesStats[0]['Max_Depth']), "<convert>#label=758<convert> :", "", "<convert>#label=268<convert>"); //Prof. Max. ://m $innerHTML .= getInnerLine($entriesStats[0]['Avg_Depth'], round($entriesStats[0]['Avg_Depth']), "<convert>#label=759<convert> :", "", "<convert>#label=268<convert>"); //Prof. Moy. ://m $innerHTML .= getInnerLine($entriesStats[0]['Std_Depth'], round($entriesStats[0]['Std_Depth']), "<convert>#label=760<convert> :", "", "<convert>#label=268<convert>"); //E.Type Prof. ://m $innerHTML .= getInnerLine($entriesStats[0]['Max_Length'], round($entriesStats[0]['Max_Length']), "<convert>#label=761<convert> :", "", "<convert>#label=268<convert>"); //Dev. Max. ://m $innerHTML .= getInnerLine($entriesStats[0]['Sum_Length'], round($entriesStats[0]['Sum_Length']), "<convert>#label=762<convert> :", "", "<convert>#label=268<convert>"); //Dev. Total ://m $innerHTML .= getInnerLine($entriesStats[0]['Avg_Length'], round($entriesStats[0]['Avg_Length']), "<convert>#label=763<convert> :", "", "<convert>#label=268<convert>"); //Dev. Moy. ://m $innerHTML .= getInnerLine($entriesStats[0]['Std_Length'], round($entriesStats[0]['Std_Length']), "<convert>#label=764<convert> :", "", "<convert>#label=268<convert>"); //E.Type Dev. ://m if ($isConnected) { $innerHTML .= getInnerLine($data[0]['Locked'], convertYN($data[0]['Locked'], "<convert>#label=441<convert>", "<convert>#label=442<convert>"), "<convert>#label=443<convert> :"); //Oui //Non //Est en cours de modification $innerHTML .= getInnerLine($data[0]['Is_public'], convertYN($data[0]['Is_public'], "<convert>#label=441<convert>", "<convert>#label=442<convert>"), "<convert>#label=444<convert> :"); //Est publique } $innerHTML .= getInnerLine($data[0]['typeName'], $data[0]['typeName'], "<convert>#label=114<convert> :"); //Type de sous-sol if ($is_shown) { $innerHTML .= getInnerLine($data[0]['Surname'], $data[0]['Surname'], "<convert>#label=200<convert> :"); //Prénom } $innerHTML .= getInnerLine($data[0]['Nickname'], $data[0]['Nickname'], "<convert>#label=34<convert> :"); //Alias if ($is_shown) { $innerHTML .= getInnerLine($data[0]['Date_birth'], timeToStr($data[0]['Date_birth']), "<convert>#label=445<convert> ", "", "<convert>#label=446<convert>", getSinceDateFromD(cDate($data[0]['Date_birth'], false), $labelsBlank), "", "<convert>#label=447<convert>"); //Né(e) le //(mm/jj/aaaa) //ans } $innerHTML .= getInnerLine($data[0]['Year_discovery'], $data[0]['Year_discovery'], "<convert>#label=109<convert> :", "", "", getSinceDateFromD("01/01/" . $data[0]['Year_discovery'], $labelsSinceDate)); //Année de découverte $innerHTML .= getInnerLine($data[0]['Year_birth'], $data[0]['Year_birth'], "<convert>#label=147<convert> :", "", "", getSinceDateFromD("01/01/" . $data[0]['Year_birth'], $labelsSinceDate)); //Année de fondation if ($is_shown) { //$innerHTML .= getInnerLine($data[0]['Date_inscription'],"<br />".timeToStr($data[0]['Date_inscription']),"<convert>#label=448<convert> ".$_SESSION['Application_name']." :","","<convert>#label=446<convert><br />",getSinceDateFromD(cDate($data[0]['Date_inscription'],false),$labelsSinceDate));//Date d'inscription à //(mm/jj/aaaa) $innerHTML .= getInnerLine($data[0]['Connection_counter'], $data[0]['Connection_counter'], "<convert>#label=449<convert> ", "", "<convert>#label=450<convert> " . $_SESSION['Application_name']); //S'est connecté //fois sur //$innerHTML .= getInnerLine($data[0]['Date_last_connection'],"<br />".timeToStr($data[0]['Date_last_connection']),"<convert>#label=24<convert> :","","<convert>#label=446<convert><br />",getSinceDateFromDT(cDate($data[0]['Date_last_connection'],false),$labelsSinceDate));//Dernière connection //(mm/jj/aaaa) } if ($isConnected) { //$innerHTML .= getInnerLine($data[0]['Date_reviewed'],"<br />".timeToStr($data[0]['Date_reviewed']),"<convert>#label=451<convert> :","","<convert>#label=446<convert><br />",getSinceDateFromDT(cDate($data[0]['Date_reviewed'],false),$labelsSinceDate));//Dernière modification //(mm/jj/aaaa) } if ($is_shown) { $innerHTML .= getInnerLine($data[0]['Year_initiation'], $data[0]['Year_initiation'], "<convert>#label=204<convert> :"); //Année d'initiation à la spéléo if ($category == "entry") { $innerHTML .= getInnerLine($data[0]['Contact'], $data[0]['Contact'], "<convert>#label=741<convert> :"); //Contact } else { $innerHTML .= getInnerLine($data[0]['Contact'], $data[0]['Contact'], "<convert>#label=146<convert> :", "mailto:" . $data[0]['Contact']); //Contact } if (isset($data[0]['City'])) { $innerHTML .= "<div class=\"detail_line\"><span class=\"details_label\"><convert>#label=102<convert> :</span><br />\n"; //Adresse if ($category != "entry") { $innerHTML .= getInnerLine($data[0]['Address'], $data[0]['Address']) . "<br />\n"; } $innerHTML .= getInnerLine($data[0]['City'], $data[0]['Postal_code'] . " " . $data[0]['City']) . "<br />\n"; $innerHTML .= getInnerLine($data[0]['Region'], $data[0]['Region'] . ", " . strtoupper(getCountry($_SESSION['language'], $data[0]['Country']))) . "<br />\n"; $innerHTML .= "</div>"; } else { $innerHTML .= getInnerLine($data[0]['Country'], getCountry($_SESSION['language'], $data[0]['Country']), "<convert>#label=98<convert> :"); //Pays } $innerHTML .= getInnerLine($data[0]['Language'], $data[0]['Language'], "<convert>#label=205<convert> :"); //Langue } if ($is_shown) { if ($data[0]['Latitude'] != "" && $data[0]['Longitude'] != "") { $innerHTML .= "<div class=\"detail_line\"><span class=\"details_label\"><convert>#label=660<convert></span>"; $innerHTML .= " <span class=\"details_data\"><convert>#label=286<convert></span></div>"; //Système géodésique //(GPS) - WGS84 Décimal $innerHTML .= getInnerLine($data[0]['Latitude'], round($data[0]['Latitude'], 5), "<convert>#label=103<convert> :", "", "<convert>#label=104<convert> <convert>#label=293<convert>."); //Latitude //degrés N. $innerHTML .= getInnerLine($data[0]['Longitude'], round($data[0]['Longitude'], 5), "<convert>#label=105<convert> :", "", "<convert>#label=104<convert> <convert>#label=294<convert>."); //Longitude //degrés S. $innerHTML .= "<div class=\"detail_line\"><input type=\"button\" name=\"convert\" class=\"button1\" value=\"<convert>#label=31<convert>...\" onclick=\"JavaScript:"; $innerHTML .= "openWindow('converter_" . $_SESSION['language'] . ".php?c=coords&lat=" . $data[0]['Latitude'] . "&lng=" . $data[0]['Longitude'] . "&i=" . $data[0]['Country'] . "&readonly=true', '', 434, 260);\" /></div>"; //<!--Convertisseur...--> } } $innerHTML .= getInnerLine($data[0]['Altitude'], $data[0]['Altitude'], "<convert>#label=106<convert> :", "", "<convert>#label=66<convert>"); //Altitude //mètres $innerHTML .= getInnerLine($data[0]['NetwId'], $data[0]['NetwName'], "<convert>#label=453<convert>", "JavaScript:detailMarker(undefined, 'cave', " . $data[0]['NetwId'] . ", '" . $_SESSION['language'] . "')", "", $data[0]['NumberOfEntries'], "<convert>#label=454<convert>", "<convert>#label=455<convert>"); //Fait partie du réseau //ayant //entrées $innerHTML .= getInnerLine($data[0]['MasId'], $data[0]['MasName'], "<convert>#label=560<convert> ", "JavaScript:detailMarker(undefined, 'massif', " . $data[0]['MasId'] . ", '" . $_SESSION['language'] . "')"); //Fait partie du massif //$innerHTML .= getInnerLine($data[0]['Min_depth'],$data[0]['Min_depth'],"<convert>#label=456<convert> :","","<convert>#label=66<convert>");//Profondeur Min. //mètres //$innerHTML .= getInnerLine($data[0]['Max_depth'],$data[0]['Max_depth'],"<convert>#label=457<convert> :","","<convert>#label=66<convert>");//Profondeur Max. //mètres $innerHTML .= getInnerLine($data[0]['Depth'], $data[0]['Depth'], "<convert>#label=64<convert> :", "", "<convert>#label=66<convert>"); //Profondeur Min. //mètres $innerHTML .= getInnerLine($data[0]['Length'], $data[0]['Length'], "<convert>#label=68<convert> :", "", "<convert>#label=66<convert>"); //Développement //mètres $innerHTML .= getInnerLine($data[0]['Temperature'], $data[0]['Temperature'], "<convert>#label=69<convert> :", "", "<convert>#label=70<convert>"); //Température //degrés celsius $innerHTML .= getInnerLine($data[0]['Is_diving'], convertYN($data[0]['Is_diving'], "<convert>#label=441<convert>", "<convert>#label=442<convert>"), "<convert>#label=71<convert> :"); //Oui //Non //Spéléo. plongée if ($category == "entry") { $innerHTML .= getInnerLine($data[0]['Partners'], replaceLinks($data[0]['Partners']), "<convert>#label=670<convert> :<br />\n"); //Sites partenaires } $innerHTML .= getInnerLine($AvgAe, round($AvgAe, 1), "<convert>#label=458<convert> :", "", "<convert>#label=459<convert>"); //Intérêt ///10 if (isset($AvgAe)) { $innerHTML .= $histoAe; } $innerHTML .= getInnerLine($AvgCa, round($AvgCa, 1), "<convert>#label=460<convert> :", "", "<convert>#label=459<convert>"); //Progression ///10 if (isset($AvgCa)) { $innerHTML .= $histoCa; } $innerHTML .= getInnerLine($AvgAp, round($AvgAp, 1), "<convert>#label=461<convert> :", "", "<convert>#label=459<convert>"); //Accès ///10 if (isset($AvgAp)) { $innerHTML .= $histoAp; } if ($category == "entry" && $addTitle) { $innerHTML .= "<a href=\"#\" onclick=\"JavaScript:detailMarker(event, 'entry', '" . $id . "', '" . $_SESSION['language'] . "',true, {'geodesic': '" . $systemArray["geodesic"] . "','length': '" . $systemArray["length"] . "','temperature': '" . $systemArray["temperature"] . "'});\" title=\"<convert>#label=184<convert>\" style=\"color:red;\"><!--Voir la fiche détaillée de cette entrée-->\n"; $innerHTML .= "<convert>#label=185<convert>\n"; //Fiche détaillée... $innerHTML .= "</a><br />\n"; } if ($isConnected && allowAccess(properties_view_all)) { $innerHTML .= "### Reserved for webmasters: ###<br />\n"; foreach ($data[0] as $key => $value) { if ($key != "Custom_message") { $innerHTML .= "<b>" . $key . "</b> : <i>" . replaceLinks(nl2br($value)) . "</i><br />\n"; } } } } if ($addTitle) { $innerHTML .= getBotMenu(); } $innerHTML = "<div class=\"menu\">" . $innerHTML . "</div>"; return $innerHTML; }
$sql .= $_SESSION['user_id'] . ", "; $sql .= "Now() "; $sql .= ") "; $req = execSQL($sql, $frame, __FILE__, __FUNCTION__); $nid = $req['mysql_insert_id']; //Tracker trackAction("insert_" . $ncat, $nid, "T_" . $ncat); //Update the entry contribution flag $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_entry` "; $sql .= "SET Has_contributions = 'YES' "; $sql .= "WHERE Id = " . $id; $req = execSQL($sql, $frame, __FILE__, __FUNCTION__); //Send an e-mail to the answered person if ($id_answered != "" && $ncat == "comment") { $get_answered_sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_comment` WHERE Id = " . $id_answered; $answered_array = getDataFromSQL($get_answered_sql, __FILE__, $frame, __FUNCTION__); if ($answered_array[0]["Alert"] == "YES") { alertForCommentReply($id_answered, $nid, $category, $id); } } if ($ncat == "rigging" || $ncat == "description") { $sql = "INSERT INTO `" . $_SESSION['Application_host'] . "`.`J_entry_" . $ncat . "` (Id_entry, Id_" . $ncat . ") VALUES ( "; $sql .= returnDefault($id, 'id') . ", "; $sql .= $nid . " "; $sql .= ") "; $req = execSQL($sql, $frame, __FILE__, __FUNCTION__); } $save_failed = false; } } $contributionSaved = !$save_failed && (isset($_POST['save']) || isset($_POST['new']));
include "../conf/config.php"; include "../func/function.php"; include "declaration.php"; $lang = isset($_GET['lang']) ? strtolower($_GET['lang']) : 'en'; $zoom = isset($_GET['z']) ? $_GET['z'] : 4; $id = isset($_GET['id']) ? $_GET['id'] : 0; $langArray = array('fr', 'en', 'es', 'de', 'it'); $lang = in_array($lang, $langArray) ? $lang : 'en'; if ($id == "") { exit; } $sql = "SELECT AVG(Latitude) AS Latitude, AVG(Longitude) AS Longitude FROM T_entry WHERE Id IN (" . $id . ") "; if (!USER_IS_CONNECTED) { $sql .= "AND Is_public = 'YES' "; } $data = getDataFromSQL($sql, __FILE__, "Geoportail", __FUNCTION__); $selection = array('fr' => "", 'en' => "", 'es' => "", 'de' => "", 'it' => ""); $selection[$lang] = ' selected="selected"'; echo getDoctype(false) . "\n"; ?> <html <?php echo getHTMLTagContent(); ?> > <head> <?php include "application_" . $_SESSION['language'] . ".php"; include "mailfunctions_" . $_SESSION['language'] . ".php"; ?> <?php echo getMetaTags();
LEFT OUTER JOIN T_entry ON V_contributions.Id_entry = T_entry.Id WHERE (V_contributions.Id IS NULL AND T_entry.Has_contributions = 'YES') OR (V_contributions.Id IS NOT NULL AND T_entry.Has_contributions = 'NO') */ include "application_" . $_SESSION['language'] . ".php"; include "mailfunctions_" . $_SESSION['language'] . ".php"; //CRO 2011-10-12 if (false) { $sql = "SELECT Nickname FROM `" . $_SESSION['Application_host'] . "`.`T_caver` WHERE Date_inscription >= STR_TO_DATE(CONCAT_WS('/', YEAR(NOW()), MONTH(NOW())-1, '01'), '%Y/%m/%d') ORDER BY Date_inscription DESC"; $newCaversArray = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); $new_cavers = array(); for ($i = 0; $i < $newCaversArray['Count']; $i++) { $new_cavers[] .= $newCaversArray[$i]['Nickname']; } $newCaversStr = implode(", ", array_unique($new_cavers)); $sql = "SELECT CONCAT(Nickname,' (',Relevance,' pts)') AS Result FROM `" . $_SESSION['Application_host'] . "`.`T_caver` ORDER BY Relevance DESC, Nickname ASC LIMIT 0,10"; $bestCaversArray = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); $best_cavers = array(); for ($i = 0; $i < $bestCaversArray['Count']; $i++) { $best_cavers[] .= $bestCaversArray[$i]['Result']; } $bestCaversStr = implode(", ", array_unique($best_cavers)); } $records_by_page = 20; $max_length = 40; $sql = "SELECT "; $sql .= "IFNULL(contrib.Id_entry,contrib.Id) AS `0`, "; $sql .= "CASE contrib.Category "; $sql .= "WHEN _latin1'T_description' THEN '<convert>#label=497<convert>' "; //Description $sql .= "WHEN _latin1'J_entry_description' THEN '<convert>#label=497<convert>' "; //Description
function sendRequestMail($request_id) { if ($request_id != "") { $request_sql = "SELECT T_label." . $_SESSION['language'] . " AS Status, T_status.Name AS Status_name, T_request.Name, "; $request_sql .= "T_caver_a.Contact AS Aut_contact, T_caver_a.Nickname AS Aut_nick, "; $request_sql .= "T_caver_b.Contact AS Rec_contact, T_caver_b.Nickname AS Rec_nick "; $request_sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_topography` "; $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_request` ON T_request.Id = T_topography.Id_request "; $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_status` ON T_status.Id = T_request.Id_status "; $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_label` ON T_label.Id = T_status.Id_label "; $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` T_caver_a ON T_caver_a.Id = T_request.Id_author "; $request_sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` T_caver_b ON T_caver_b.Id = T_request.Id_recipient "; $request_sql .= "WHERE T_request.Id = '" . $request_id . "' "; $request_data = getDataFromSQL($request_sql, __FILE__, "function", __FUNCTION__); $status_lbl = $request_data[0]['Status']; $request_name = $request_data[0]['Name']; $status_name = $request_data[0]['Status_name']; $rec_contact = $request_data[0]['Rec_contact']; $rec_name = $request_data[0]['Rec_nick']; $aut_contact = $request_data[0]['Aut_contact']; $aut_name = $request_data[0]['Aut_nick']; $copy = false; switch ($status_name) { case "submitted": $mail_dest = $rec_contact; $name_dest = $rec_name; $mail_from = $aut_contact; $name_from = $aut_name; $subject = "<convert>#label=847<convert> '" . $request_name . "' <convert>#label=849<convert>."; //La demande : //vous a été envoyée $temp_body = "<convert>#label=851<convert>"; //Veuillez vérifier les droits d'auteurs et appliquer les modifications nécessaires à la topographie. Ensuite vous pourez choisir de valider ou refuser la demande. break; case "rejected": $mail_dest = $aut_contact; $name_dest = $aut_name; $mail_from = $rec_contact; $name_from = $rec_name; $subject = "<convert>#label=846<convert> '" . $request_name . "' <convert>#label=848<convert> '" . $status_lbl . "'."; //Votre demande : //est passée à l'état : $temp_body = "<convert>#label=852<convert>"; //Votre demande a été rejetée, la cause du rejet peut être indiquée dans le champ commentaire de la demande. Veuillez modifier votre demande avant de la soumettre à nouveau. break; case "approved": trackAction("approve_request", $request_id, "T_request"); $mail_dest = $aut_contact; $name_dest = $aut_name; $mail_from = $rec_contact; $name_from = $rec_name; $subject = "<convert>#label=846<convert> '" . $request_name . "' <convert>#label=848<convert> '" . $status_lbl . "'."; //Votre demande : //est passée à l'état : $temp_body = "<convert>#label=853<convert>"; //Votre demande a été accepté et est dès à présent en ligne, vous pouvez consulter les topographies sur GrottoCenter.org. break; case "canceled": trackAction("cancel_request", $request_id, "T_request"); $mail_dest = $rec_contact; $name_dest = $rec_name; $mail_from = $aut_contact; $name_from = $aut_name; $subject = "<convert>#label=847<convert> '" . $request_name . "' <convert>#label=850<convert>."; //La demande : //a été signalée comme illicite $temp_body = "<convert>#label=851<convert>"; //Veuillez vérifier les droits d'auteurs et appliquer les modifications nécessaires à la topographie. Ensuite vous pourez choisir de valider ou refuser la demande. break; } $mail_body = "<p><convert>#label=470<convert> " . $name_dest . ",<br />"; //Bonjour $mail_body .= $subject . "<br/>"; $mail_body .= $temp_body . "</p>"; $mail_body .= "<ul><li><convert>#label=854<convert> " . $name_dest . " " . $mail_dest . "</li>"; //Vous : $mail_body .= "<li><convert>#label=855<convert> " . $name_from . " " . $mail_from . "</li>"; //Votre contact (Leader) : $mail_body .= "<li><convert>#label=861<convert>: " . $request_id . "</li></ul>"; //Numéro de la demande : $mail_body .= getSignature(); return sendMail($mail_dest, $subject, $mail_body, "", "", $copy); } else { return false; } }
function getHelpTopic($helpId, $helpTitle) { $help = ""; if ($helpId != '') { $sql = "SELECT Id_forum, Id_topic FROM J_help_topic WHERE Id_help = " . $helpId . " AND Language = '" . $_SESSION['language'] . "'"; $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); if ($data['Count'] != 0) { $url = "help_" . $_SESSION['language'] . ".php?f=" . $data[0]['Id_forum'] . "&t=" . $data[0]['Id_topic']; $windowName = ""; $widht = 500; $height = 400; $help = '<span class="help"><a class="nothing" href="JavaScript:openWindow(\'' . $url . '\', \'' . $windowName . '\', ' . $widht . ', ' . $height . ');"><img src="../images/icons/help.png" alt="' . $helpTitle . '" style="border:0px none;" title="' . $helpTitle . '" /></a></span>'; } } return $help; }
$sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` usr ON (usr.Id = cat.Id_author OR usr.Id = cat.Id_reviewer) "; $sql .= "WHERE usr.Id = " . $id . " AND NOT cat.Id_entry = 0 AND cat.Id_entry IS NOT NULL "; if (USER_IS_CONNECTED) { } else { $sql .= "AND cat.Is_public = 'YES' "; } $sql .= "ORDER BY NName "; $comparedCol = "value"; $idCol = "objectId"; $categoryCol = "category"; $textCol = "NName"; $selected = ""; $Obj_name_sql = "SELECT * "; $Obj_name_sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_" . $category . "` "; $Obj_name_sql .= "WHERE Id = " . $id; $object_source_name = getDataFromSQL($Obj_name_sql, __FILE__, $frame, __FUNCTION__); if ($category == "caver") { $object_source_name = $object_source_name[0]['Nickname']; } else { $object_source_name = $object_source_name[0]['Name']; } $rnd_div_id = "list_contribution_div_" . rand(); $innerHTML = "<div id=\"" . $rnd_div_id . "\" class=\"menu\">"; $innerHTML .= getTopMenu(getCloseBtn("JavaScript:resetListDiv('" . $rnd_div_id . "');", "<convert>#label=371<convert>") . "<div class=\"frame_title\">" . setTitle("JavaScript:openMe(" . $id . ", '" . $category . "', false);", "list", "<convert>#label=887<convert> <convert>#label=540<convert> " . $object_source_name, 1) . "</div>"); //Contributions en lien avec//Fermer $innerHTML .= "<select onclick=\"JavaScript:selectOnClick(this);\" size=\"5\" class=\"entry\">\n"; $innerHTML .= getOptions($sql, "", $selected, $comparedCol, $countryCol, $idCol, $categoryCol, $textCol) . "\n"; $innerHTML .= "</select>" . getBotMenu() . "</div>\n"; break; default: break;
function getComment($category, $id) { if ($id != "" && $category != "") { $sql = "SELECT c.*, e.Name as Exit_name, "; // $sql .= "CONCAT(if(caa.Surname is null,'',CONCAT(caa.Surname, ' ')), if(caa.Name is null,'',CONCAT(caa.Name , ' alias ')), caa.Nickname) AS Author, "; // $sql .= "CONCAT(if(cab.Surname is null,'',CONCAT(cab.Surname, ' ')), if(cab.Name is null,'',CONCAT(cab.Name , ' alias ')), cab.Nickname) AS Reviewer "; $sql .= "caa.Nickname AS Author, "; $sql .= "cab.Nickname AS Reviewer "; $sql .= "FROM `" . $_SESSION['Application_host'] . "`.`T_comment` c "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` caa ON c.Id_author = caa.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_caver` cab ON c.Id_reviewer = cab.Id "; $sql .= "LEFT OUTER JOIN `" . $_SESSION['Application_host'] . "`.`T_entry` e ON c.Id_exit = e.Id "; $sql .= "WHERE c.Id_entry=" . $id . " OR c.Id_exit=" . $id . " "; $sql .= "ORDER BY c.Id_answered, c.Date_inscription "; $data = getDataFromSQL($sql, __FILE__, "function", __FUNCTION__); return sortByThread($data); } else { return ""; } }
$sql = "SELECT `" . $_SESSION['language'] . "_admin_id` AS Admin_id FROM `" . $_SESSION['Application_host'] . "`.`T_message_subject` WHERE `Subject` = '" . $subject . "'"; $data = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); $admin_id = ""; if ($data['Count'] > 0) { $admin_id = $data[0]['Admin_id']; } if ($subject == "bad_content" || $subject == "restore_element") { $subject .= "; Category: " . $category; } if ($bad_name != "") { $subject .= "; Id: " . $bad_name; } sendMessageToWM($admin_id, $contact, $real_mail, $name, $subject, nl2br($body)); if ($category == 'topography' && $bad_name != '') { $sql = "SELECT Id FROM T_status WHERE Name = 'canceled'"; $status_id = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_topography` SET Enabled = 'NO' WHERE Id_request = " . $bad_name; $req = execSQL($sql, $frame, __FILE__, __FUNCTION__); $user_login = $_SESSION['user_login'] == '' ? "guest" : $_SESSION['user_login']; $date_stamp = '---- <convert>#label=230<convert>: ' . $user_login . ' ' . date("Y-m-d H:i:s") . ' ----'; $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_request` SET Id_status = " . returnDefault($status_id[0]['Id'], 'id') . ", Comments = " . returnDefault($date_stamp . "\n" . $body, 'text') . " WHERE Id = " . $bad_name; $req = execSQL($sql, $frame, __FILE__, __FUNCTION__); trackAction("edit_request", $bad_name, "T_request"); sendRequestMail($bad_name); } $send_failed = false; } } function formIsValid() { $string = isset($_POST['m_check']) ? $_POST['m_check'] : '';
if (USER_IS_CONNECTED) { //Is it in my list ? $sql = "SELECT COUNT(*) Count FROM `" . $_SESSION['Application_host'] . "`.`J_grotto_caver` "; $sql .= "WHERE Id_grotto = " . $id . " AND Id_caver = " . $_SESSION['user_id']; $inMyList = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); } if ($grotto[0]['Picture_file_name'] == "") { $logo_filename = "default_logo.png"; } else { $logo_filename = $grotto[0]['Picture_file_name']; } } } else { $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_grotto` "; $sql .= "WHERE Id IN (" . $id . ") "; $grottoes = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); } if (!$clustered) { ?> <div class="header grotto"> <convert>#label=186<convert><!--Club--> <?php if (USER_IS_CONNECTED) { ?> <form id="GC_IW_manage_my_list" name="manage_my_list" method="post" action="#" style="display:inline;"> <?php if ($inMyList[0]['Count'] > 0) { ?> <input class="button_remove" type="button" id="GC_IW_remove" name="remove" onclick="JavaScript:infowindowReload(this)" value="" title="<convert>#label=596<convert>" /><!--Retirer de ma liste--> <?php } else {
} } } else { $_SESSION['login_retry'] = 1; } //Send a new password to the user : if (isset($_POST['send_pwd'])) { $login = isset($_POST['f_caver_login']) ? $_POST['f_caver_login'] : ''; $contact = isset($_POST['f_caver_contact']) ? $_POST['f_caver_contact'] : ''; $password = generatePassword(10, 8); $string = isset($_POST['f_caver_check']) ? $_POST['f_caver_check'] : ''; $user_check = isset($_SESSION['userCheck']) ? $_SESSION['userCheck'] : ''; if (!$_SESSION['do_check'] || md5(getIp() . strtolower($string)) == $user_check) { $sql = "SELECT * FROM `" . $_SESSION['Application_host'] . "`.`T_caver`"; $sql .= " WHERE Login = '******' AND Contact ='" . $contact . "'"; $data = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); if ($data['Count'] > 0) { if ($data[0]['Activated'] == 'YES') { $sql = "UPDATE `" . $_SESSION['Application_host'] . "`.`T_caver`"; $sql .= " SET Password ='******'"; $sql .= " WHERE Id = " . $data[0]['Id']; $req = execSQL($sql, $frame, __FILE__, __FUNCTION__); if (!defined('NO_PHPBB_INSTALLED')) { chgPwdphpBBuser($login, $password); } sendNewPwdMail($data[0], $password); //echo $password; trackAction("pwd_user", $data[0]['Id'], "T_caver"); $_SESSION['user_pwd_sent'] = true; } else { $activated = false;
$sql = "SELECT u.* FROM `" . $_SESSION['Application_host'] . "`.`T_url` u "; $sql .= "INNER JOIN `" . $_SESSION['Application_host'] . "`.`J_entry_url` eu ON u.Id = eu.Id_url "; $sql .= "WHERE eu.Id_entry = " . $id; $url = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); //Check for my list of entries if (USER_IS_CONNECTED) { //Is it in my list ? $sql = "SELECT COUNT(*) Count FROM `" . $_SESSION['Application_host'] . "`.`J_entry_caver` "; $sql .= "WHERE Id_entry = " . $id . " AND Id_caver = " . $_SESSION['user_id']; $inMyList = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); } } } else { $sql = "SELECT Name, Id FROM `" . $_SESSION['Application_host'] . "`.`T_entry` "; $sql .= "WHERE Id IN (" . $id . ") "; $entries = getDataFromSQL($sql, __FILE__, $frame, __FUNCTION__); } if (!$clustered) { ?> <div class="header entry"> <convert>#label=182<convert><!--Cavité--> <?php if (USER_IS_CONNECTED) { ?> <form id="GC_IW_manage_my_list" name="manage_my_list" method="post" action="#" style="display:inline;"> <?php if ($inMyList[0]['Count'] > 0) { ?> <input class="button_remove" type="button" id="GC_IW_remove" name="remove" onclick="JavaScript:infowindowReload(this)" value="" title="<convert>#label=596<convert>" /><!--Retirer de ma liste--> <?php } else {