[ubuntu-it-www] Re: Problema sulle news

Leo Iannacone leo.iannacone at gmail.com
Wed May 19 08:57:03 BST 2010


Il giorno mar, 18/05/2010 alle 20.58 +0200, Fabio Marzocca ha scritto:
> Il feed viene generato correttamente dal sito.


Nell'index.html del planet (il file sul server) ci sono link di questo
tipo:
<a
href="http://www.ubuntu-it.org/index.php?mact=News,cntnt01,detail,0&amp;amp;cntnt01articleid=288&amp;amp;cntnt01returnid=104">30 April 2010 alle 11.09</a>


Ovvero: &amp;amp; (duplicato!).


In particolare è successo qualcosa al sito perché ora nella cache del
planet compaiono due tipi diversi di file:

ubuntu-it.org,index.php,mact=News,cntnt01,detail,0&amp;cntnt01articleid=292&amp;cntnt01returnid=104
ubuntu-it.org,index.php,mact=News,cntnt01,detail,0&cntnt01articleid=205&cntnt01returnid=53

Notate la &amp; nel file più recente?


Per ora ho corretto il problema con un js, ma non è il massimo,
considerando anche che il js è su onload del body e la pagina del planet
ci sta un po' per caricarsi tutta.

function fixurls () {
  var h2 = document.getElementsByTagName('h2');
  var i = 0;
  for (i = 0 ; i < h2.length ; i++ ) {
    if (h2[i].className == 'post-title') {
      var posttitle = h2[i].getElementsByTagName('a')[0];
      var href = posttitle.href;
      if (href.indexOf('http://www.ubuntu-it.org/index.php?mact=News',
0) == 0) {
        while(href.indexOf('&amp;') > 0) {
          href = href.replace('&amp;', '&');
        }
      }
      posttitle.href = href;
    }
  }
}



Lorenzo appena puoi però fai un cambio di permessi sul server eh...

cd /srv/planet.ubuntu-it.org/
chgrp -R ubuntu-it *
find -type d -exec chmod -R g+s '{}' \;
chmod -R g+w *


È difficile collaborare senza. :)






More information about the Gruppo-web mailing list