Skip to content

Commit

Permalink
add meta tags for twitter cards and update version
Browse files Browse the repository at this point in the history
  • Loading branch information
gsalin committed Jan 30, 2024
1 parent d9f7c9a commit 738bf1f
Show file tree
Hide file tree
Showing 10 changed files with 194 additions and 64 deletions.
88 changes: 44 additions & 44 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@
<div class="loading-indicator">
<img alt="VelObs" src="resources/images/velobs.jpg" width="99" height="64" style="margin-right:8px;float:left;vertical-align:top;"/><?php echo INCLUDE_CODE_HTML_LOADING ?><br /><span id="loading-msg">Loading styles and images ...</span>
</div>
<link rel="stylesheet" type="text/css" href="resources/css/icon.css?v1.7.2" />
<link rel="stylesheet" type="text/css" href="resources/css/icon.css?v1.7.4" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/ext-3.4.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/ext-3.4.0/resources/css/xtheme-gray.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/GeoExt/resources/css/geoext-all.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/GeoExt/resources/css/gxtheme-gray.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/GeoExt/resources/css/popup.css" />
<link rel="stylesheet" type="text/css" href="resources/css/admin.css?v1.7.2" />
<link rel="stylesheet" type="text/css" href="resources/css/iconmarker.css?v1.7.2" />
<link rel="stylesheet" type="text/css" href="resources/css/admin.css?v1.7.4" />
<link rel="stylesheet" type="text/css" href="resources/css/iconmarker.css?v1.7.4" />
<link rel="stylesheet" type="text/css" href="resources/css/fileuploadfield.css" />

<!--<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading Google Maps API...';</script>
Expand All @@ -51,9 +51,9 @@

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading language...';</script>
<script type="text/javascript" src="lib/js/framework/ext-3.4.0/src/locale/ext-lang-<?php echo $_SESSION['extension_language']; ?>.js"></script>
<script type="text/javascript" src="lib/js/translation_<?php echo $_SESSION['extension_language']; ?>.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/key.js.template?v1.7.2"></script>
<script type="text/javascript" src="lib/js/key.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/translation_<?php echo $_SESSION['extension_language']; ?>.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/key.js.template?v1.7.4"></script>
<script type="text/javascript" src="lib/js/key.js?v1.7.4"></script>

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading extensions...';</script>
<script type="text/javascript" src="lib/js/framework/ux/GeoNamesSearchCombo.js"></script>
Expand All @@ -67,63 +67,63 @@
<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading geometry...';</script>

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading application...';</script>
<script type="text/javascript" src="lib/js/common.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poiCommon.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/userUpdate.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/common.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poiCommon.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/userUpdate.js?v1.7.4"></script>
<?php
switch ($_SESSION['type']) {
case '1':
?>

<script type="text/javascript" src="lib/js/admin/modeemploi1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/icon1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/config1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/status1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/users1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/priorite1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/commune1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/pole1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/quartier1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/basket.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poi1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/subcategory1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/category1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/users_link_pole1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/main1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/modeemploi1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/icon1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/config1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/status1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/users1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/priorite1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/commune1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/pole1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/quartier1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/basket.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poi1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/subcategory1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/category1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/users_link_pole1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/main1.js?v1.7.4"></script>

<?php
break;
case '2':
?>
<script type="text/javascript" src="lib/js/admin/modeemploi2.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poi2.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/modeemploi2.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poi2.js?v1.7.4"></script>

<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/main2.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/main2.js?v1.7.4"></script>
<?php
break;
case '3':
?>
<script type="text/javascript" src="lib/js/admin/modeemploi3.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poi3.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/main3.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/modeemploi3.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poi3.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/main3.js?v1.7.4"></script>
<?php
break;
case '4':
?>
<script type="text/javascript" src="lib/js/admin/modeemploi4.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/commune1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/pole1.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/basket.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poi4.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/main4.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/admin/modeemploi4.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/commune1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/pole1.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/basket.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poi4.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/mapadmin.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/poiCommonBeforeRender.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/admin/main4.js?v1.7.4"></script>

<?php
break;
Expand Down
49 changes: 31 additions & 18 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,20 @@
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title><?php echo PAGE_TITLE ?> v1.7.2</title>
<?php
if (isset($_GET['id']) && $_GET['id'] != '') {
$arrayObs = getObservationDetailsForTwitterCard($_GET['id']);
echo '<meta name="twitter:card" content="summary" />'."\n";
echo '<meta name="twitter:title" content="'.$arrayObs['commune_poi'].' - '.$arrayObs['lib_category'].'" />'."\n";
echo '<meta name="twitter:description" content="'.nl2br($arrayObs['desc_poi']).'" />'."\n";
}else{
echo '<meta name="twitter:card" content="summary" />'."\n";
echo '<meta name="twitter:title" content="VelObs Agglomération toulousaine" />'."\n";
echo '<meta name="twitter:description" content="Outil cartographique de référencement des problèmes rencontrés par les cyclistes dans leurs déplacements" />'."\n";
}
echo '<meta name="twitter:image" content="'.URL.'/resources/images/2p2r_twitter.jpg" />'."\n";
?>
<title><?php echo PAGE_TITLE ?> v1.7.4</title>
<link rel="shortcut icon" type="image/png" href="resources/favicon/favicon.ico" />
</head>
<body onunload="setCookie()">
Expand All @@ -15,14 +28,14 @@
<div class="loading-indicator">
<img alt="VelObs" src="resources/images/velobs.jpg" width="99" height="64" style="margin-right:8px;float:left;vertical-align:top;"/><?php echo INCLUDE_CODE_HTML_LOADING ?><br /><span id="loading-msg">Loading styles and images ...</span>
</div>
<link rel="stylesheet" type="text/css" href="resources/css/icon.css?v1.7.2" />
<link rel="stylesheet" type="text/css" href="resources/css/icon.css?v1.7.4" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/ext-3.4.0/resources/css/ext-all.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/ext-3.4.0/resources/css/xtheme-gray.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/GeoExt/resources/css/geoext-all.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/GeoExt/resources/css/gxtheme-gray.css" />
<link rel="stylesheet" type="text/css" href="lib/js/framework/GeoExt/resources/css/popup.css" />
<link rel="stylesheet" type="text/css" href="resources/css/public.css?v1.7.2" />
<link rel="stylesheet" type="text/css" href="resources/css/iconmarker.css?v1.7.2" />
<link rel="stylesheet" type="text/css" href="resources/css/public.css?v1.7.4" />
<link rel="stylesheet" type="text/css" href="resources/css/iconmarker.css?v1.7.4" />
<link rel="stylesheet" type="text/css" href="resources/css/fileuploadfield.css" />

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading ExtJS...';</script>
Expand All @@ -35,27 +48,27 @@

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading language...';</script>
<script type="text/javascript" src="lib/js/framework/ext-3.4.0/src/locale/ext-lang-fr.js"></script>
<script type="text/javascript" src="lib/js/translation_fr.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/key.js.template?v1.7.2"></script>
<script type="text/javascript" src="lib/js/key.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/translation_fr.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/key.js.template?v1.7.4"></script>
<script type="text/javascript" src="lib/js/key.js?v1.7.4"></script>

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading extensions...';</script>
<script type="text/javascript" src="lib/js/framework/ux/GeoNamesSearchCombo.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/public/poidisplaystatus.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/public/baselayerlist.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/framework/ux/FileUploadField.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/framework/ux/IconCombo.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/framework/ux/GeoNamesSearchCombo.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/public/poidisplaystatus.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/public/baselayerlist.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/framework/ux/FileUploadField.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/framework/ux/IconCombo.js?v1.7.4"></script>

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading geometry...';</script>

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Loading application...';</script>
<script type="text/javascript" src="lib/js/public/credits.js"></script>
<script type="text/javascript" src="lib/js/framework/AnimatedCluster.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/common.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/public/proposition.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/public/export.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/public/map.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/public/main.js?v1.7.2"></script>
<script type="text/javascript" src="lib/js/framework/AnimatedCluster.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/common.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/public/proposition.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/public/export.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/public/map.js?v1.7.4"></script>
<script type="text/javascript" src="lib/js/public/main.js?v1.7.4"></script>

<script type="text/javascript">document.getElementById('loading-msg').innerHTML = 'Initialization...';</script>
</div>
Expand Down
30 changes: 30 additions & 0 deletions lib/php/commonfunction.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
<?php
include_once 'key.php';
$link = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME);
mysql_query("SET NAMES utf8mb4");

function getObservationDetailsForTwitterCard($id_poi){

$sql = "SELECT poi.id_poi,
poi.desc_poi,
commune.id_commune,
commune.lib_commune,
subcategory.id_subcategory,
subcategory.icon_subcategory,
subcategory.lib_subcategory
FROM poi
INNER JOIN subcategory ON (subcategory.id_subcategory = poi.subcategory_id_subcategory)
INNER JOIN commune ON (commune.id_commune = poi.commune_id_commune)
WHERE poi.id_poi = ".$id_poi;
$result = mysql_query($sql);
$nbrows = mysql_num_rows($result);
$row = mysql_fetch_assoc( $result );
$observationArray = array();
if ($result && $nbrows ==1){
$observationArray['id_poi'] = addslashes($row['id_poi']);
$observationArray['desc_poi'] = addslashes($row['desc_poi']);
$observationArray['commune_poi'] = addslashes($row['lib_commune']);
$observationArray['lib_category'] = addslashes($row['lib_subcategory']);
}
return $observationArray;
}
/* Function name : getTranslation
* Input : language id, string
* Output : string translation
Expand Down
26 changes: 26 additions & 0 deletions lib/php/mobile/getMobilePriority.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php header('Content-Type:text/xml; charset=UTF-8');
include_once '../key.php';

switch (SGBD) {
case 'mysql':
$link = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME);
mysql_query("SET NAMES utf8mb4");

$sql = "SELECT id_priorite, lib_priorite FROM priorite";
$result = mysql_query($sql);
print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
print '<priorities>';
while ($row = mysql_fetch_array($result)) {
print '<priority nom="'.stripslashes($row['lib_priorite']).'" id="'.$row['id_priorite'].'"></priority>';
}
print '</priorities>';
mysql_free_result($result);
mysql_close($link);
break;
case 'postgresql':
// TODO
break;
}

?>
39 changes: 39 additions & 0 deletions lib/php/mobile/validateUserKey.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?php header('Content-Type:text/xml; charset=UTF-8');
include_once '../key.php';

switch (SGBD) {
case 'mysql':
$link = mysql_connect(DB_HOST,DB_USER,DB_PASS);
mysql_select_db(DB_NAME);
mysql_query("SET NAMES utf8mb4");

print '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>';
print '<response>';
//$buffer = $_POST['buffer'];
if (!isset($_POST['moderatorKey']) || !isset($_POST['moderatorEmail'])) {
print '<coderetour result="-1" />';
print '</response>';
} else {

$sql = "SELECT COUNT(*)
FROM users
WHERE mail_users = '".mysql_real_escape_string($_POST['moderatorEmail'])."' AND moderator_mobile_key = '".mysql_real_escape_string($_POST['moderatorKey'])."'";

$result = mysql_query($sql);
$numberMatchingUsers = mysql_result($result, 0);
if (DEBUG){
error_log(date("Y-m-d H:i:s") . " " .__FUNCTION__ . " - validateUserKey.php pour ".$_POST['moderatorEmail']." \n", 3, LOG_FILE);
error_log(date("Y-m-d H:i:s") . " " .__FUNCTION__ . " - validateUserKey.php retourne $numberMatchingUsers \n", 3, LOG_FILE);
}
print '<coderetour>'.$numberMatchingUsers.'</coderetour>';
print '</response>';
mysql_free_result($result);
mysql_close($link);
}
break;
case 'postgresql':
// TODO
break;
}

?>
2 changes: 1 addition & 1 deletion lib/php/public/getJsonObsVotes.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
// echo '{"statistiques":'.json_encode($arr).'}';
$html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"
\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\"><html><head><title>Observations ouvertes les plus votées, par territoire et commune</title></head><body class=\"votes\">\r\n";
$html .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../resources/css/public.css?v1.7.2\" />\r\n";
$html .= "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../../resources/css/public.css?v1.7.4\" />\r\n";
$html .= "<H1>Listing des observations les plus votées (1 vote est associé à une adresse email)";
if ($groupByCity) {
$html .= " classées par commune.</H1>";
Expand Down
Loading

0 comments on commit 738bf1f

Please sign in to comment.