Hi,
I have customised my page.tal as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
tal:attributes="lang language; xml:lang language">
<tal:block define="global sito string:http://MysiteURL" />
<tal:block define="global tema string:http://MysiteURL/sites/MysiteURL/themes/custom/zental" />
<head>
<title tal:content="head_title" />
${head}
${styles}
<!--[if IE]><link rel="stylesheet" type="text/css" href="tripoli/tripoli.simple.ie.css"><![endif]-->
${scripts}
<script language="javascript">
var km = <?= zental_calcola_stats(); ?>; /* qui invece di 10 ci va il valore pescato dal db in km */
var CO2 = parseInt(km * 0.23); /* espresso in kg */
var foresta = parseInt(km * 3); /* espresso in mq */
var risparmio = parseInt(((km * 5) + (km * 9))/100); /* in euro */
if (document.images) {
var imgArray = new Array( );
imgArray[0] = new Image(40,40);
imgArray[0].src = "${tema}/digits/0.jpg";
imgArray[1] = new Image(40,40);
imgArray[1].src = "${tema}/digits/1.jpg";
imgArray[2] = new Image(40,40);
imgArray[2].src = "${tema}/digits/2.jpg";
imgArray[3] = new Image(40,40);
imgArray[3].src = "${tema}/digits/3.jpg";
imgArray[4] = new Image(40,40);
imgArray[4].src = "${tema}/digits/4.jpg";
imgArray[5] = new Image(40,40);
imgArray[5].src = "${tema}/digits/5.jpg";
imgArray[6] = new Image(40,40);
imgArray[6].src = "${tema}/digits/6.jpg";
imgArray[7] = new Image(40,40);
imgArray[7].src = "${tema}/digits/7.jpg";
imgArray[8] = new Image(40,40);
imgArray[8].src = "${tema}/digits/8.jpg";
imgArray[9] = new Image(40,40);
imgArray[9].src = "${tema}/digits/9.jpg";
}
function setImages(a, b, c, d) {
var i;
a = formatNum(a, 5);
for (i = 0; i < a.length; i++) {
document.images["km" + i].src = imgArray[a.charAt(i)].src;
}
b = formatNum(b, 5);
for (i = 0; i < b.length; i++) {
document.images["carbon" + i].src = imgArray[b.charAt(i)].src;
}
c = formatNum(c, 5);
for (i = 0; i < c.length; i++) {
document.images["foresta" + i].src = imgArray[c.charAt(i)].src;
}
d = formatNum(d, 5);
for (i = 0; i < d.length; i++) {
document.images["risparmio" + i].src = imgArray[d.charAt(i)].src;
}
}
function formatNum(num, len) {
var numStr = "" + num;
while (numStr.length < len) {
numStr = "0" + numStr;
}
return numStr
}
</script>
</head>
<tal:block comment="different ids allow for separate theming of the home page" />
<body tal:attributes="class body_classes" onload=" setImages(km, CO2, foresta, risparmio)">
<div id="scatola" class="clear-block">
<div id="header">
<a href="${sito}/home">
<div id="logo" class="noborder nomargin nopadding inlined" style="float:right;width:469px; height:96px; background-image:url(${tema}/immagini/logo.jpg);" />
</a>
<div id="sfondo" style="float:left;height:96px; width:26px; background-image:url(${tema}/immagini/corner-header.jpg);" />
<a href="${sito}/node/add/viaggio">
<div id="offri" style="background-image:url(${tema}/immagini/bottone-offri.jpg);" />
</a>
<a href="${sito}/cerco">
<div id="cerco" style="background-image:url(${tema}/immagini/bottone-cerca.jpg)" />
</a>
</div> <!-- /header -->
<div id="sidebar">
<div tal:condition="php:!empty(sidebar_left)" id="sidebar-left" class="column sidebar" tal:content="sidebar_left" />
<div id="specmenu"><ul id="specmenuul">
<li><a href="${sito}/collabora">Collabora con noi</a></li>
<li><a href="${sito}/regolamento">Regolamento</a></li>
<li><a href="${sito}/privacy">Privacy</a></li>
</ul>
</div>
</div>
<div id="corpo" class="column"> <!-- <div id="squeeze"> -->
<div id="corpo-top" class="top">
<div id="corner-sx" class="sx top"></div>
<div id="corner-dx" class="dx top"></div>
</div>
<div id="#content" class="content">
<div id="sx"><div id="dx"><div id="contenuto">
<div tal:condition="php:!empty(content_top)" id="content-top" tal:content="content_top" />
<h1 tal:condition="php:!empty(title)" class="title" tal:content="title" />
<div tal:condition="php:!empty(tabs)" class="tabs" tal:content="tabs" />
${help}
${messages}
${content}
${feed_icons}
<div tal:condition="php:!empty(content_bottom)" id="content-bottom" tal:content="content_bottom" />
</div></div></div>
</div> <!-- /content -->
<!-- </div> /squeeze -->
<div id="corpo-footer" class="bottom">
<img src="${tema}/immagini/corner-bassodes-contenuto.jpg" class="noborder nomargin nopadding inlined" style="float:right;" alt="corner-bassodes-contenuto.jpg" />
<div id="contatori" class="bottom">
<table>
<tr class="spessore"></tr>
<tr>
<td class="colsx">
<img class="cifra" name="km0" src="${tema}/digits/0.jpg" alt="km" />
<img class="cifra" name="km1" src="${tema}/digits/0.jpg" alt="km" />
<img class="cifra" name="km2" src="${tema}/digits/0.jpg" alt="km" />
<img class="cifra" name="km3" src="${tema}/digits/0.jpg" alt="km" />
<img class="cifra" name="km4" src="${tema}/digits/0.jpg" alt="km" />
</td>
<td class="coltxt">
<a href="${sito}/spiegastat" class="testo">Km</a>
</td>
<td class="vuota"> </td>
<td class="coldx">
<img class="cifra" name="risparmio0" src="${tema}/digits/0.jpg" alt="risparmio" />
<img class="cifra" name="risparmio1" src="${tema}/digits/0.jpg" alt="risparmio" />
<img class="cifra" name="risparmio2" src="${tema}/digits/0.jpg" alt="risparmio" />
<img class="cifra" name="risparmio3" src="${tema}/digits/0.jpg" alt="risparmio" />
<img class="cifra" name="risparmio4" src="${tema}/digits/0.jpg" alt="risparmio" />
</td>
<td class="coltxt">
<a href="${sito}/spiegastat" class="testo">Euro</a>
</td>
</tr>
<tr>
<td class="colsx">
<img class="cifra" name="carbon0" src="${tema}/digits/0.jpg" alt="carbon" />
<img class="cifra" name="carbon1" src="${tema}/digits/0.jpg" alt="carbon" />
<img class="cifra" name="carbon2" src="${tema}/digits/0.jpg" alt="carbon" />
<img class="cifra" name="carbon3" src="${tema}/digits/0.jpg" alt="carbon" />
<img class="cifra" name="carbon4" src="${tema}/digits/0.jpg" alt="carbon" />
</td>
<td class="coltxt">
<a href="${sito}/spiegastat" class="testo">CO2 (kg)</a>
</td>
<td class="vuota"> </td>
<td>
<img class="cifra" name="foresta0" src="${tema}/digits/0.jpg" alt="foresta" />
<img class="cifra" name="foresta1" src="${tema}/digits/0.jpg" alt="foresta" />
<img class="cifra" name="foresta2" src="${tema}/digits/0.jpg" alt="foresta" />
<img class="cifra" name="foresta3" src="${tema}/digits/0.jpg" alt="foresta" />
<img class="cifra" name="foresta4" src="${tema}/digits/0.jpg" alt="foresta" />
</td>
<td class="coltxt">
<a href="${sito}/spiegastat" class="testo">Foresta (mq)</a>
</td>
</tr>
</table>
</div>
</div>
</div> <!-- /corpo (originariamente: main) -->
${closure}
</div> <!-- /page -->
</body>
</html>
I get the following error on some pages (cck generated content, visible on editing mode gives error in show mode):
warning: htmlspecialchars() [function.htmlspecialchars]: Invalid multibyte sequence in argument in /var/www/virtual/MySiteURL/htdocs/sites/all/themes/engines/phptal/PHPTAL/Context.php on line 393.
The phptal code has not been edited, it's their last version from the website with the last version of the engine from drupal website.
This error text does not appear the first time that I go to the page, but only when I hit refresh.
The error (which is there also the first time I load the page) is that on those pages the structure is entirely visible except that for part of the content, that disappears.
The same content is visible if I apply other themes using the same engine, like the phptal theme itself, so the problem is in this page.
What is the problem?
Thanks,
Dario
Comments
Up.
Up.