#1 Re : GCweb » Problème affichage » 21-11-2012 11:43

J'ai testé malheureusement chez moi ça ne fonctionne pas. Premièrement dans la séquence le no de port est inversé par rapport à la fin de l'URL et de plus le fait que le test soit intégré au substr() le résultat n'est jamais pris en compte.

J'ai sorti le test du substr(). Il faudrait tester sur un site sans port pour confirmer que c'est fonctionnel dans tous les cas.

Voici une modification qui fonctionne chez moi :

if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
    define('URLRACINE_GCWEB','https://'.$_SERVER['SERVER_NAME'].(isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] != 443) ? ':'.$_SERVER['SERVER_PORT'] : '').substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));
else
    define('URLRACINE_GCWEB','http://'.$_SERVER['SERVER_NAME'].(isset($_SERVER['SERVER_PORT']) && ($_SERVER['SERVER_PORT'] != 80) ? ':'.$_SERVER['SERVER_PORT'] : '').substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));

#2 Re : GCweb » Problème affichage » 20-11-2012 21:49

Oui j'avais déjà fait une modif. j'ai ajouté un test sur le port. Voilà pourquoi ça fonctionnait. Maintenant je n'ai pas beaucoup d'expérience en php il y a donc peut moyen de faire plus propre.

if (isset($_SERVER['SERVER_PORT']))
        define('URLRACINE_GCWEB','http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));
    else

        define('URLRACINE_GCWEB','http://'.$_SERVER['SERVER_NAME'].substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));

#3 Re : GCweb » Problème affichage » 20-11-2012 21:27

Je pense avoir trouvé. J'ai apporté une modification dans le fichier index.php.

Voici mon code source, regardez si cette modification vous semble correcte.


<?php
/*
 *      This file is a part of GCweb (unoffical web render for GCstar)
 *      Copyright (c) 2007 Jonas Fourquier <http://jonas.tuxfamily.org> and contributors
 *
 *      GCweb is free software; you can redistribute it and/or modify
 *      it under the terms of the GNU General Public License as published by
 *      the Free Software Foundation; either version 2 of the License, or
 *      (at your option) any later version.
 *
 *      This program 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 General Public License for more details.
 *
 *      You should have received a copy of the GNU General Public License
 *      along with this program; if not, write to the Free Software
 *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 */

if (get_magic_quotes_runtime())     set_magic_quotes_runtime(0);

//$temps_debut = microtime(true);

//Chemin relatif à ce fichier vers la racine de GCWeb. (pas de "/" au début, un à la fin)
define('DIR_GCWEB', './');

define('PATH_GCWEB', dirname(__FILE__).'/'.DIR_GCWEB);

if (isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on')
	if (isset($_SERVER['SERVER_PORT']))
		define('URLRACINE_GCWEB','https://'.$_SERVER['SERVER_NAME'].substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));
	else
		define('URLRACINE_GCWEB','https://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));
else
	if (isset($_SERVER['SERVER_PORT']))
		define('URLRACINE_GCWEB','http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));
	else
		define('URLRACINE_GCWEB','http://'.$_SERVER['SERVER_NAME'].substr($_SERVER['REQUEST_URI'],0,strrpos($_SERVER['REQUEST_URI'],'/')));
define('URL_GCWEB',URLRACINE_GCWEB.'/'.DIR_GCWEB);

include (PATH_GCWEB.'inc/render.php');
?>

Ça fonctionne chez moi mais il faudrait voir sur un site sans port dans l'URL.
Encore merci et bravo pour ce site.

#4 Re : GCweb » Problème affichage » 20-11-2012 20:59

Voici une partie du code généré :

<head>
    <title>Bdthèque</title>
    <meta http-equiv="Content-Type" content="application/x-php;charset=UTF-8" />
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <meta http-equiv="Content-Style-Type" content="text/css" />
    <link rel="icon" type="image/png" href="http://cahor.dynalias.com/GCWeb/./templates/default/img/favicon.png" />
    <link rel="stylesheet" type="text/css" href="http://cahor.dynalias.com/GCWeb/./templates/default/style.css" media="screen, print" />
    <link rel="stylesheet" type="text/css" href="http://cahor.dynalias.com/GCWeb/./templates/default/style_print.css" media="print" />
    <!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="http://cahor.dynalias.com/GCWeb/./templates/default/style_ie.css" media="screen, print" /><![endif]-->
         <link rel="alternate" type="application/rss+xml" title="Bdthèque - BD (Toute la collection)" href="?collec=0&model=rss" /><script type="text/javascript" src=".//templates/default//javascript.js"></script></head>

Comme on le voit ici :

<link rel="icon" type="image/png" href="http://cahor.dynalias.com/GCWeb/./templates/default/img/favicon.png" />

Le port :7070 a disparu. Je ne sais pas si c'est une option à changer sur mon apache ou s'il faut adapter le code php.

#5 Re : GCweb » Problème affichage » 20-11-2012 20:49

J'étais en train de tester mon serveur, je stoppe pour ce soir. Ma redirection devrait fonctionner à nouveau.
Sinon voici le lien plus direct : http://cahor.dynalias.com:7070/GCWeb/
Ce qui se passe c'est qu'à certains moments ce lien se transforme comme ceci : http://cahor.dynalias.com/GCWeb/

Le port disparaît donc il ne trouve plus les feuilles de style. Je me demande si un virtualhost ne pourrait pas corriger ça mais j'avoue ne pas être expert là dedans surtout que ce serveur fait tourner Openmediavault et d'autres choses...


Merci pour votre support.

#6 Re : GCweb » Problème affichage » 20-11-2012 20:04

Je vois d'où ça vient, j'utilise un port dans mon url et ce port est enlevé lorsque la page est interprétée du coup on perd les feuilles de style. Faut que je fouille pour contourner ça, si quelqu'un a une idée je suis preneur.

#7 GCweb » Problème affichage » 20-11-2012 19:15

Akura
Réponses : 11

Bonjour,

Je suis actuellement en train de me créer un serveur Web pour héberger GCWeb. Tout semble fonctionner correctement sauf que l'affichage n'est pas bon. Les données sont correctes et les recherches fonctionnent.

Voici le lien de mon site :

http://collectionbd.dyndns.org/GCWeb

Pouvez-vous me dire d'où cela pourrait venir ?

D'avance merci.

Pied de page des forums

Propulsé par FluxBB