Ver Mensaje Individual
  #1 (permalink)  
Antiguo 24/10/2003, 18:42
Avatar de sdf23
sdf23
 
Fecha de Ingreso: diciembre-2002
Mensajes: 297
Antigüedad: 23 años, 9 meses
Puntos: 0
nuevo problema con noktemplate

Hola amigos de fdw!

He empezado a usar Noktemplate(muy bueno por cierto )
pero surgio un problema es que me repite el ultimo bloque 2 veces ya intente la solucion de cluster y la misma que da nok ($html->expandir('ROWS','-fSites') y $html->asignar('ROWS',''); pero aun asi no funciona :
pongo el codigo:

index.php

Código PHP:
<?php  
include ('templates/Class.nok.php');  
include (
'config/config.php');
include 
'./templates/'.$config["theme"].'/lang/'.$config["idioma"].'.php';
$html = new NokTemplate('./templates/'.$config["theme"]);  

$html->cargar('tCuerpo','index.tpl.html');

$html->definirBloque('tNews', 'tCuerpo');
$html->definirBloque('fNews', 'tCuerpo');

$html->definirBloque('tSites', 'tCuerpo');
$html->definirBloque('fSites', 'tCuerpo');

/* Asignamos los nombres para los bloques */

$html->asignar('sitename', $config["sitename"]);   
$html->asignar('menuizq', $lang["menuizq"]);
$html->asignar('menuder', $lang["menuder"]);

$html->asignar('home', $lang["home"]);
$html->asignar('newsite', $lang["newsite"]);
$html->asignar('login', $lang["login"]);
$html->asignar('news', $lang["news"]);

/* Fin de nombres */

$news = mysql_query("SELECT * FROM news ORDER BY id DESC LIMIT 1");

while(
$nrow = mysql_fetch_array($news))
{
    
$noticia = nl2br($nrow['noticia']);
    
$html->asignar('titulonoticia', $nrow['titulo']);    
    
$html->asignar('noticia', $noticia);       
    
$html->asignar('por',date("H:i:s", $nrow['fecha']));
    
    
$html->expandir('FILAS', '+fNews');   
}  

$sites = mysql_query("SELECT * FROM sites ORDER BY hitsout LIMIT 100");
$pos = 1;
$html->expandir('ROWS','-fSites');
while(
$srow = mysql_fetch_array($sites))
{
    
//$html->expandir('ROWS','-fSites');
    
if($pos <= 3)
        
$html->asignar('info', '<a href="'.$srow['url'].'" target="_blank"><img src="'.$srow['banner'].'" border="0" alt="'.$srow['descripcion'].'"></a>');
    else
           
$html->asignar('info', '');   
         
    
$html->asignar('pos', $pos);    
    
$html->asignar('uname', $srow['nombre']);       
    
$html->asignar('desc', $srow['descripcion']);
    
$html->asignar('hitsin', $srow['hitsin']);
    
$html->asignar('hitsout', $srow['hitsout']);
    
$html->asignar('url', $srow['url']);
    
    
$html->expandir('ROWS', '+fSites');  
    
//$html->asignar('ROWS','');
    
$pos++;
}
//$html->asignar('ROWS','');

$html->expandir('CONTENIDO', 'tNews');  
$html->expandir('SITES', 'tSites');


$html->expandir('FINAL', 'tCuerpo');  

$html->imprimir('FINAL');  
?>
index.tpl.html:

error1:

<!-- inicioBloque: tNews -->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="95%" id="AutoNumber3">
{FILAS}
<!-- inicioBloque: fNews -->
<tr>
<td width="100%">{titulonoticia}</td>
</tr>
<tr>
<td width="100%">{noticia}</td>
</tr>
<tr>
<td width="100%">{fecha}</td>
</tr>
<!-- finBloque: fNews -->
</table>
<!-- finBloque: tNews -->

error2:

<!-- inicioBloque: tSites -->
<table width="80%" border="0" align="center">
{ROWS}
<!-- inicioBloque: fSites -->
<tr>
<td>{pos}.- {uname}</td>
</tr>
<tr>
<td><center>{info}</center><br><center>{desc}</center>
</td>
</tr>
<tr>
<td>In: {hitsin} Out: {hitsout}</td>
</tr>
<!-- finBloque: fSites -->
</table>
<!-- finBloque: tSites -->


ojala mepuedan ayudar
__________________

la vida es bella cuando no es culera

Última edición por sdf23; 24/10/2003 a las 18:44