PeKaOs
Enviado: 20/03/2006 a las 00:03
Habitual
Karma: 0 (0 Votos)
Registrado: 25/02/05
Mensajes: 76
Estado: Desconectado Ultima visita: 27/07/06
Queria editar el bloque que me sale de ultimos mensajes del pnforum 2.6 pero la verdad q ando bastante perdido. El bloque en cuestion me sale totalmente descuadrado cuando hay muchos mensajes. Cuando alguien postea algo no usa los puntos suspensivos para acortar como aquí y me descuadra todo el bloque de largo. Q es lo q tengo q editar y como?
Creo q es en pnforum_centerblock_display, verdad??
Aqui os dejo el código por si alguien se anima...lo q me gustaría sería q el post saliera acortado con puntos suspensivos y no como ahora q sale entero y se va quedando hacia abajo ensanchandolo todo. Una ayuda plis!
Código <table width="100%" border="0" cellpadding="3" cellspacing="1" >
<tr>
<td colspan="4" >
<strong><!--[ $lastpostcount ] --> <!--[ pnml name='_PNFORUM_CB_RECENTPOSTS' ] --></strong>
</td>
</tr>
<!--[ foreach item=lastpost from=$lastposts ] -->
<tr>
<td >
<a href="<!--[ pnmodurl modname=pnForum type=user func=viewforum forum=$lastpost.forum_id ]-->" ><!--[ $lastpost .forum_name ] --></a>
</td>
<td >
<a href="<!--[ pnmodurl modname=pnForum type=user func=viewtopic topic=$lastpost.topic_id start=$lastpost.start ]-->" ><!--[ $lastpost .topic_title ] --></a>
</td>
<td >
<!--[ $lastpost .posted_time ] -->
</td>
<td >
<!--[ $lastpost .poster_name|profilelink ] -->
</td>
</tr>
<!--[ /foreach ] -->
</table>
<!--[ else ] -->
<div ></div>
<!--[ /if ] -->
<div >
<a href="<!--[ pnmodurl modname=pnForum func=main ]-->" title="<!--[ pnml name='_PNFORUM_GOTO_FORUM' ]-->" ><!--[ pnml name='_PNFORUM_GOTO_FORUM' ] --></a>
</div>
Dos no discuten si uno no quiere.
gerkynet
Enviado: 20/03/2006 a las 19:03
Posteador de Oro
Karma: 7 (77 Votos)
Registrado: 11/02/06
Mensajes: 1490
Estado: Desconectado Ultima visita: 18/11/06
Vamos a ver,
Código // cambia la línea13 :
<a href="<!--[ pnmodurl modname=pnForum type=user func=viewtopic topic=$lastpost.topic_id start=$lastpost.start ]-->" ><!--[ $lastpost .topic_title ] --></a>
por esta:
<a href=
"<!--[ pnmodurl modname=pnForum type=user func=viewtopic topic=$lastpost.topic_id start=$lastpost.start ]-->" ><!--
[ ( ( strlen ( $lastpost .topic_title
) >
12 ) ?
( substr ( $lastpost .topic_title,
0 ,
9 ) +
'...' ) :
$lastpost .topic_title
) ] --></a>
(No lo he probado)
PeKaOs
Enviado: 21/03/2006 a las 00:03
Habitual
Karma: 0 (0 Votos)
Registrado: 25/02/05
Mensajes: 76
Estado: Desconectado Ultima visita: 27/07/06
He cambiado tal como me has dicho y me da este error:
Fatal error: Smarty error: [in pnforum_centerblock_display.html line 19]: syntax error: unrecognized tag: ((strlen($lastpost.topic_title)>12)?(substr($lastpost.topic_title,0,9)+'...') :$lastpost.topic_title) (Smarty_Compiler.class.php, line 436 in....../includes/classes/Smarty/Smarty.class.php on line 1088
Y se descuadra todo el index eliminando bloques de los lados...un poco caótico.
No se..
Dos no discuten si uno no quiere.
PeKaOs
Enviado: 21/03/2006 a las 12:03
Habitual
Karma: 0 (0 Votos)
Registrado: 25/02/05
Mensajes: 76
Estado: Desconectado Ultima visita: 27/07/06
Es posible q sea q no tengo alguna etiqueta soportada y con parametros del html?
Gracias por las molestias gerkynet
Dos no discuten si uno no quiere.
gerkynet
Enviado: 21/03/2006 a las 19:03
Posteador de Oro
Karma: 7 (77 Votos)
Registrado: 11/02/06
Mensajes: 1490
Estado: Desconectado Ultima visita: 18/11/06
El error ha sido mío, la función es correcta, pero para un archivo .php, no para html, lo voy a corregir.
PeKaOs
Enviado: 21/03/2006 a las 19:03
Habitual
Karma: 0 (0 Votos)
Registrado: 25/02/05
Mensajes: 76
Estado: Desconectado Ultima visita: 27/07/06
Gracias por el enlace unkito...sería eso lo q querría modificar, pero tengo un problema, no encuentro por ningún lado el plugin...he mirado en el emule y nada de nada , sabéis si hay algúna web q lo tenga en descargas?
Ok, gerkynet...estaré a la espera, muchas gracias por las molestias.
Dos no discuten si uno no quiere.
gerkynet
Enviado: 21/03/2006 a las 20:03
Posteador de Oro
Karma: 7 (77 Votos)
Registrado: 11/02/06
Mensajes: 1490
Estado: Desconectado Ultima visita: 18/11/06
Si no lo encuentras crealo a partir del código:
Código <?php
// $Id: modifier.dpslicerend.php,v 1.2 2004/04/22 12:22:37 drak Exp $
// ----------------------------------------------------------------------
// PostNuke Content Management System
// Copyright (C) 2002 by the PostNuke Development Team.
// http://www.postnuke.com/
// ----------------------------------------------------------------------
// Based on:
// PHP-NUKE Web Portal System - http://phpnuke.org/
// Thatware - http://thatware.org/
// ----------------------------------------------------------------------
// LICENSE
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License (GPL)
// 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.
//
// To read the license please visit http://www.gnu.org/copyleft/gpl.html
// ----------------------------------------------------------------------
/**
* pnRender plugin
*
* This file is a plugin for pnRender, the PostNuke implementation of Smarty
*
* @package Xanthia_Templating_Environment
* @subpackage pnRender
* @version $Id: modifier.dpslicerend.php,v 1.2 2004/04/22 12:22:37 drak Exp $
* @author The PostNuke development team
* @link http://www.postnuke.com The PostNuke Home Page
* @copyright Copyright (C) 2002 by the PostNuke Development Team
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License
*/
/**
* @author Fernando Jordan (el_cuervo)
* @since 26. August. 2004
*
* Purpose: formats a filesize (in bytes) to human-readable format
* <!--[]$url|dpslicerend:20]-->
* If $url == 'http://www.phpinsider.com/'
* it outputs 'http://www.phpinsid...'
*/
function smarty_modifier_dpslicerend( $string , $length = 20 , $etc = '...' )
{
if ( $length == 0 ) {
return '' ;
}
$ret_string =
substr ( $ret_string ,
0 ,
$length ) ;
$ret_string .= "..." ;
return $ret_string ;
} else {
return $string ;
}
}
?>
gerkynet
Enviado: 21/03/2006 a las 20:03
Posteador de Oro
Karma: 7 (77 Votos)
Registrado: 11/02/06
Mensajes: 1490
Estado: Desconectado Ultima visita: 18/11/06
basicamente es lo mismo que iba a hacer,
el nombre del fichero es "modifier.dpslicerend.php"
PeKaOs
Enviado: 21/03/2006 a las 21:03
Habitual
Karma: 0 (0 Votos)
Registrado: 25/02/05
Mensajes: 76
Estado: Desconectado Ultima visita: 27/07/06
Joer, me ha salido perfecto, justo como quería. Muchísimas gracias. Al final cogí el código q has puesto lo hice .php lo metí en pntemplates/plugins y modifiqué el pnforum_center_block_display.html tal y como decía Viga. Genial!
Ahora a esperar posts y q todo vaya sobre ruedas jeje. Saludos y gracias!
Dos no discuten si uno no quiere.
PeKaOs
Enviado: 21/03/2006 a las 21:03
Habitual
Karma: 0 (0 Votos)
Registrado: 25/02/05
Mensajes: 76
Estado: Desconectado Ultima visita: 27/07/06
Gracias unkito..al final lo solucioné cogiendo el código de gerkynet. Espero q todo vaya bien...
Saludos
Dos no discuten si uno no quiere.
gerugato
Enviado: 04/05/2006 a las 22:05
Novato
Karma: 0 (0 Votos)
Registrado: 09/04/05
Mensajes: 14
Estado: Desconectado Ultima visita: 14/08/06
Hola, yo tambien necesito modificar el bloque de ultimos mensajes del pnforum pero para que solo me aparescan los ultimos temas agragados al foro.
Por favor alguien me puede ayudar?
Gracias de antemano...
paranoik
Enviado: 04/05/2006 a las 23:05
Posteador de Oro
Karma: 8 (132 Votos)
Registrado: 05/06/04
Mensajes: 2929
Estado: Desconectado Ultima visita: 28/01/08
No entiendo lo que dices gerugato , con el bloque ya te aparecen los últimos temas agregados al foro