O script é esse:
<? $sql = mysql_query("SELECT * FROM destaque WHERE categoria='fotodia' AND id_franquia='$cidade' order by rand() LIMIT 1");
$total = mysql_num_rows($sql);
$dados=mysql_fetch_array($sql);
if($total > 0){
?>
<table width="308" border="0" cellpadding="0" cellspacing="0" bgcolor="<?=$coronmouse?>">
<tr>
<td width="20"><img src="images/layout/img_menu.gif"></td>
<td class="branco"><b>DESTAQUE</b></td>
</tr>
</table>
<table width="250" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="border:1px solid #999999;"><table width="305" border="0" cellpadding="0" cellspacing="0" class="text">
<tr>
<td width="165"><div align="center"><a href="?pg=noticia&id=<?=$dados[id_galeria];?>"><img src="thumbs.php?w=159&h=74&imagem=images/destaques/<?=$dados[foto];?>" border="0"></a></div></td>
<td width="140" align="right"><table width="140" height="74" border="0" cellpadding="0" cellspacing="0" class="text">
<tr>
<td height="8"><img src="images/g1.gif" width="140" height="8"></td>
</tr>
<tr>
<td align="center" bgcolor="#65D16F"><table width="130" border="0" cellpadding="0" cellspacing="0" class="text">
<tr>
<td><div align="center"><a href="?pg=noticia&id=<?=$dados[id_galeria];?>">
<?
$msg2 = $dados["texto"];
$str = split(" ",$msg2);
$msg = "";
for ($i=0;$i<count($str);$i++)
{
$tam = strlen($str[$i]);
//echo "<br><Br>Palavra $str[$i]<Br>Tam <b>$tam</b><br><br>";
$ini = 0;
if ($tam>25)
{
$espacos = intval(strlen($str[$i]) / 25);
//echo "<br>Inserir $espacos espacos na palavra";
for ($y=0;$y<$espacos;$y++)
{
$ini = $y*25;
$fim = 25;
$esp = substr($str[$i],$ini,$fim) ." ";
//echo "<Br>Inserindo espaco $y ($ini,$fim) [$esp]";
$msg .= $esp;
$ini = ($y+1)*25;
}
}
$esp = substr($str[$i],$ini,strlen($str[$i])) ." ";
//echo "<Br>Inserindo restante $esp";
$msg .= $esp;
}
//echo nl2br($msg);
$contatamanho = strlen($msg);
$quantidade = 130;
if($contatamanho > $quantidade){
$mensagem = substr_replace($msg, "...", $quantidade, $contatamanho - $quantidade);
} else {
$mensagem = $msg;
}
echo "$mensagem";
?>
</a></div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="8"><img src="images/g2.gif" width="140" height="8"></td>
</tr>
</table></td>
</tr>
</table> </td>
</tr>
<tr>
<td align="center"><a href="?pg=noticia&id=<?=$dados[id_galeria];?>"> </a></td>
</tr>
</table>
<? } else {?>
<table width="250" border="0" cellpadding="0" cellspacing="0" bgcolor="<?=$coronmouse?>">
<tr>
<td width="20"><img src="images/layout/img_menu.gif"></td>
<td class="branco"><b>DESTAQUE</b></td>
</tr>
</table>
<table width="250" border="0" cellspacing="0" cellpadding="0">
<tr>
<td style="border:1px solid #999999;"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="186" align="center">Nenhum registro encontrado!</td>
</tr>
</table></td></tr>
</table>
<? }?>
o script javascript da UOL é esse (já mesclado com o code acima:
<? $sql = mysql_query("SELECT * FROM destaque WHERE categoria='fotodia' AND id_franquia='$cidade' order by rand() LIMIT 1");
$total = mysql_num_rows($sql);
$dados=mysql_fetch_array($sql);
if($total > 0){
?>
<head>
<script type="text/javascript">
var d=document;
$ = function(id) {
if(!arguments[1]) return document.getElementById(id);
else document.getElementById(id).style[arguments[1]]=arguments[2];
}
function delItem(arr,item){
for(;item<arr.length;item++) arr[item]=arr[item + 1];
arr.length=arr.length-1;
} function goURL(){
(Item[atual][3].indexOf('_blank')!=-1) ? window.open(Item[atual][3].substring(0,Item[atual][3].indexOf(' '))) : location.href=Item[atual][3];
} function startSlide(){
loadImages();
if(!paused) timeoutId=setTimeout('changeImg(1)',2000);
} function initialize(){
timeoutId=0;
textareaContent=d.form_cr.select_cr.value.split(/[\r\n]/i);
Item = new Array();
for(x=0,y=0;x<textareaContent.length;x++){
if(textareaContent[x].length>30) Item[y++]=textareaContent[x].split('|');
}
for(i=Item.length-1;i>=0;i--){
Item[i][0]=Item[i][0].replace(/([ \n\t\r])+/, " ");
Item[i][4]=(Item[i][4].length<3) ? '' : '<img src="'+Item[i][4]+'" border="0" style="margin-left:4px;" />';
if(Item[i][1].length<3||Item[i][3].length<3||Item[i][2].length<3||Item[i][0].length<2) delItem(Item,i);
}
if(Item.length==1) d.write('<style>#anterior,#proximo,#pause{visibility:hidden;}</style>');
atual = Math.random().toString().substring(2,6) % Item.length;
} function startPanel(){
usaCredito = '';
initialize();
if(arguments.length>0){
if(!isNaN(arguments[0])) atual = arguments[0];
}
if(paused) {imgpause='on'; altpause='alt="Ligar" title="Ligar"';}
else {imgpause='off'; altpause='alt="Parar" title="Parar"';}
d.write('<div id="to-blend">'+usaCredito+'<a href="java script:goURL()"><img src="'+Item[atual][1]+'" id="imgslide" name="img1" border="0" title="'+Item[atual][0]+'" alt="'+Item[atual][0]+'"></a>');
d.write('<h2><a href="java script:goURL()" id="p-link"><span id="txt1">'+Item[atual][2]+'</span><span id="icon-area">'+Item[atual][4]+'</span></a></h2></div>');
d.write('<div id="prox-ant"><a href="java script:void(0)" id="anterior" onclick="if(okToGo)changeImg(-1)"><img src="images/botao-anterior.gif" border="0" /></a><img src="images/botao-pause1-'+imgpause+'.gif" onclick="pauseSlide()" id="pause" '+altpause+' />');
d.write('<a href="java script:void(0)" id="proximo" onclick="if(okToGo)changeImg(1)"><img src="images/botao-proxima.gif" border="0" /></a></div>');
} function pauseSlide(){
if(paused){
$('pause').src='images/botao-pause1-off.gif';
$('pause').title='Parar'; $('pause').alt = 'Parar';
d.cookie="indexpause=0;domain=.fotonafesta.com.br;expires=Thu, 2 Aug 1970 20:47:11 UTC;";
paused=false;
startSlide();
}else{
clearTimeout(timeoutId);
d.cookie="indexpause=1;domain=.fotonafesta.com.br;expires=Thu, 2 Aug 2222 20:47:11 UTC;";
$('pause').src='images/botao-pause1-on.gif';
$('pause').title='Ligar'; $('pause').alt = 'Ligar';
paused = true;
} }
var okToGo=false;
var paused=(d.cookie.indexOf('indexpause=1')!=-1) ? true : false;
onload=startSlide;
</script>
</head>
<body>
<form name="form_cr" action="" id="painel-conteudo"><textarea name="select_cr" cols="0" rows="0">
<a href="../../?pg=noticia&id=<?=$dados[id_galeria];?>"><img src="../../thumbs.php?w=159&h=74%11!m=images/destaques/<?=$dados[foto];?>" border="0"></a>
<a href="../../?pg=noticia&id=<?=$dados[id_galeria];?>">
<?
$msg2 = $dados["texto"];
$str = split(" ",$msg2);
$msg = "";
for ($i=0;$i<count($str);$i++)
{
$tam = strlen($str[$i]);
//echo "<br><Br>Palavra $str[$i]<Br>Tam <b>$tam</b><br><br>";
$ini = 0;
if ($tam>25)
{
$espacos = intval(strlen($str[$i]) / 25);
//echo "<br>Inserir $espacos espacos na palavra";
for ($y=0;$y<$espacos;$y++)
{
$ini = $y*25;
$fim = 25;
$esp = substr($str[$i],$ini,$fim) ." ";
//echo "<Br>Inserindo espaco $y ($ini,$fim) [$esp]";
$msg .= $esp;
$ini = ($y+1)*25;
}
}
$esp = substr($str[$i],$ini,strlen($str[$i])) ." ";
//echo "<Br>Inserindo restante $esp";
$msg .= $esp;
}
//echo nl2br($msg);
$contatamanho = strlen($msg);
$quantidade = 130;
if($contatamanho > $quantidade){
$mensagem = substr_replace($msg, "...", $quantidade, $contatamanho - $quantidade);
} else {
$mensagem = $msg;
}
echo "$mensagem";
?>
</a>
<a href="../../?pg=noticia&id=<?=$dados[id_galeria];?>"> </a>
<? } else {?>
<? }?>
</textarea></form>
<div id="hn">
<div class="box1">
<div id="painel">
<script type="text/javascript">startPanel(0);</script>
</div>
<script type="text/javascript">
// painel rotativo //
function changeOpac(opacity){
var obj = $('to-blend').style;
obj.opacity=(opacity/101);
obj.MozOpacity=(opacity/101);
obj.KhtmlOpacity=(opacity/101);
} function blend(imagefile){
var speed=7;
var timer=0;
for(i=100;i>0;i-=2) setTimeout('changeOpac('+i+')', timer++ * speed);
setTimeout('changeContent()', timer * speed);
for(i=0;i<=100;i+=2) setTimeout('changeOpac('+i+')', timer++ * speed);
} function changeImg(id){
clearTimeout(timeoutId);
atual+=parseInt(id);
if(atual>Item.length-1) atual=0;
if(atual<0) atual=Item.length-1;
if(imgDsp[atual].complete==false){
atual--;
timeoutId = setTimeout('changeImg('+id+')',500);
return;
}
if(d.all && navigator.userAgent.indexOf('Opera')==-1){
try {
oDiv = $('to-blend');
oDiv.style.filter="blendTrans(duration=0.7)";
oDiv.filters.blendTrans.apply();
oDiv.filters.blendTrans.play();
changeContent();
} catch(e) { changeContent(); }
} else { blend(); }
if(!paused) timeoutId=setTimeout('changeImg(1)',6000);
} function loadImages(){
imgDsp = new Array();
for(n=0;n<Item.length;n++){
imgDsp[n]=new Image();
imgDsp[n].src=Item[n][1];
}
okToGo = true;
} function changeContent(){
d.img1.src=imgDsp[atual].src;
d.img1.alt=d.img1.title=Item[atual][0];
$('txt1').innerHTML=Item[atual][2];
if(usaCredito!='') $('credito').innerHTML=Item[atual][0];
$('icon-area').innerHTML=Item[atual][4];
}
</script>
</body>Só que naum funfa... Se alguem souber, posta ae...










