News: April 7th, 2019, The Tinyportal team is pleased to announce the release of ~~ TinyPortal 1.6.3! GET IT NOW!!!

Login  |  Register
HTML5 Icon HTML5 Icon
TP on Social Media
Welcome, Guest. Please login or register.
Did you miss your activation email?

July 16, 2019, 02:56:30 AM

Login with username, password and session length

Recent

Members
Stats
  • Total Posts: 188512
  • Total Topics: 20736
  • Online Today: 26
  • Online Ever: 629
  • (November 08, 2018, 01:36:54 PM)
Users Online
Users: 0
Guests: 19
Total: 19

Author Topic: Funcion tp_renderarticle y options  (Read 5548 times)

0 Members and 1 Guest are viewing this topic.

Offline kohai.raul

  • Jr. Member
  • **
  • Posts: 19
Funcion tp_renderarticle y options
« on: June 18, 2015, 11:52:06 AM »
Hola, tprenderarticle es la siguiente función,

En Sources/TPSubs.php

Code: [Select]
function tp_renderarticle($intro = '')
{
global $context, $txt, $scripturl, $boarddir;

// just return if data is missing
if(!isset($context['TPortal']['article']))
return;

echo '
<div class="article_inner">';
// use intro!
if(($context['TPortal']['article']['useintro'] == '1' && !$context['TPortal']['single_article']) || !empty($intro))
{
if($context['TPortal']['article']['rendertype'] == 'php')
{
echo eval(tp_convertphp($context['TPortal']['article']['intro'], true)), '
<p><b><a href="' .$scripturl . '?page=' , !empty($context['TPortal']['article']['shortname']) ? $context['TPortal']['article']['shortname'] : $context['TPortal']['article']['id'] , '' , WIRELESS ? ';' . WIRELESS_PROTOCOL : '' , '">'.$txt['tp-readmore'].'</a></b></p>';
}
elseif($context['TPortal']['article']['rendertype'] == 'bbc' || $context['TPortal']['article']['rendertype'] == 'import')
{
if(!WIRELESS)
echo parse_bbc($context['TPortal']['article']['intro']), '<p><b><a href="' .$scripturl . '?page=' , !empty($context['TPortal']['article']['shortname']) ? $context['TPortal']['article']['shortname'] : $context['TPortal']['article']['id'] , '' , WIRELESS ? ';' . WIRELESS_PROTOCOL : '' , '">'.$txt['tp-readmore'].'</a></b></p>';
else
echo parse_bbc($context['TPortal']['article']['intro']);
}
else
{
if(!WIRELESS)
echo $context['TPortal']['article']['intro'], '<p><b><a href="' .$scripturl . '?page=' , !empty($context['TPortal']['article']['shortname']) ? $context['TPortal']['article']['shortname'] : $context['TPortal']['article']['id'] , '' , WIRELESS ? ';'.WIRELESS_PROTOCOL : '' , '">'.$txt['tp-readmore'].'</a></b></p>';
else
echo $context['TPortal']['article']['intro'];
}
}
else
{
if($context['TPortal']['article']['rendertype'] == 'php')
eval(tp_convertphp($context['TPortal']['article']['body'], true));
elseif($context['TPortal']['article']['rendertype'] == 'bbc')
echo parse_bbc($context['TPortal']['article']['body']);
elseif($context['TPortal']['article']['rendertype'] == 'import')
{
if(!file_exists($boarddir. '/' . $context['TPortal']['article']['fileimport']))
echo '<em>' , $txt['tp-cannotfetchfile'] , '</em>';
else
include($context['TPortal']['article']['fileimport']);
}
else
echo $context['TPortal']['article']['body'];
}
echo '
</div>';
return;
}

Al editar el artículo, puedo ver que tengo activado correctamente "allow to comment" y " Display comments underneath article"

Tengo el problema de que los Comments y el Formulario de Respuesta sólo me aparecen en el listado de artículos de una categoría dada. Cuando entro a leer un artículo completo, ya no me aparecen los comentarios ni el formulario de respuesta. Sí en cambio las GlobalTags y Socialbookmarks.

Rebuscando por el código, he podido comprobar que la función tp_renderarticle es la que está relacionada con el rendering de un artículo completo. Pero no acabo de entender dónde y cómo se renderizan las globalTags, SocialBookmarks, y los comments.

Necesito entenderlo para ver cómo solucionar el problema con los comentarios.

Alguien me podría ayudar????? muchísimas gracias!
 :)


« Last Edit: June 18, 2015, 01:07:17 PM by kohai.raul »