Correction sur plusieurs URL et modification de la fontion get_server_name pour supprimer des problèmes dans l'administration

This commit is contained in:
Simon Leblanc 2011-06-25 20:23:40 +02:00
parent d434e6e28d
commit 63ebe90f63
4 changed files with 10 additions and 5 deletions

View File

@ -134,8 +134,8 @@ while($dsondage = $sondage->FetchNextObject(false)) {
}
echo'<td>'.$nbuser.'</td>'."\n";
echo '<td><a href="../studs.php?sondage='.$dsondage->id_sondage.'">'. _("See the poll") .'</a></td>'."\n";
echo '<td><a href="/'.$dsondage->id_sondage_admin.'/admin">'. _("Change the poll") .'</a></td>'."\n";
echo '<td><a href="'.getUrlSondage($dsondage->id_sondage).'">'. _("See the poll") .'</a></td>'."\n";
echo '<td><a href="'.getUrlSondage($dsondage->id_sondage_admin, true).'">'. _("Change the poll") .'</a></td>'."\n";
echo '<td><input type="submit" name="supprimersondage'.$i.'" value="'. _("Remove the poll") .'"></td>'."\n";
echo '</tr>'."\n";

View File

@ -74,7 +74,7 @@ echo <<<mentions
<h2>Éditeur et Responsable de la publication</h2>
<p>Alexis Kauffmann (<a href="/contact.php">contact</a>)</p>
<p>Alexis Kauffmann (<a href="contacts.php">contact</a>)</p>
<p>Les propos tenus sur ce site ne représentent que et uniquement lopinion de leur auteur, et nengagent pas les sociétés, entreprises ou collectifs auxquels il contribue ou dont il peut être associé ou employé.</p>

View File

@ -81,7 +81,7 @@ function logo ()
#le bandeau principal
function bandeau_tete()
{
echo '<div class="bandeau"><a href="/" title="Accueil Framadate"><img src="/images/logo-framadate.png" title="Accueil '.NOMAPPLICATION.'" alt="'.NOMAPPLICATION.'"></a></div>'."\n";
echo '<div class="bandeau"><a href="'.get_server_name().'" title="Accueil Framadate"><img src="/images/logo-framadate.png" title="Accueil '.NOMAPPLICATION.'" alt="'.NOMAPPLICATION.'"></a></div>'."\n";
}

View File

@ -57,7 +57,12 @@ function connexion_base()
function get_server_name()
{
$scheme = (isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on") ? 'https' : 'http';
$url = sprintf("%s://%s%s", $scheme, STUDS_URL, dirname($_SERVER["SCRIPT_NAME"]));
$get = explode('/', dirname($_SERVER["SCRIPT_NAME"]));
$folder = explode('/', str_replace('\\', '/', dirname(__FILE__)));
$communs = array_intersect($get, $folder);
$base = implode('/', $communs);
$url = sprintf("%s://%s%s", $scheme, STUDS_URL, $base);
if (!preg_match("|/$|", $url)) {
$url = $url."/";