Recordad que para pedir soporte alguno, debéis facilitar los datos de soporte oportunos por favor, mirad aquí y leer las Normas generales del foro, esto nos servirá de ayuda para dar el mejor soporte..

Gracias.

La Administración de phpBB España.

Ultimos post/topic en un html para verlo por iframeTema Solucionado

Foros de soporte phpBB 3.1.x
Cerrado
chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Ultimos post/topic en un html para verlo por iframe  Tema Solucionado

#1

Mensaje por chicosandro2004 »

Hola

he actualizado a 3.1.8 y este mod ya no me funciona...
alguien sabrá donde encontrarlo actualizado para dicha version?

se lo agradecería mucho ya que me es muy necesario

Código: Seleccionar todo

<?php 

// Amount of active topics to show 
define("TOPIC_COUNT", 8); 

// Path to the phpBB 3.0 root directory 
define("PHPBB_PATH", "../foros/"); 

// URL to the phpBB 3.0 installation 
define("PHPBB_LOCATION", "http://www.rompelo.cl/foros/"); 

// Time format to output the date/time (for format see PHP manual) 
define("TIME_FORMAT", "d/m/Y"); 

// php extension using
$phpEx = "php";

// No Editing unless you know what your doing
if ( !defined('IN_PHPBB') ) 
{
	define('IN_PHPBB', true);
}


// Get the needed phpbb files, thank you phpbb =]
include($phpbb_root_path  . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

$user->session_begin();
$auth->acl($user->data);
$user->setup();

// HTML header start 

?> 
<style>
a:link, 
a:visited {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #496c9f;	
	text-decoration: none;	
}

a:hover {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #496c9f;	
	text-decoration: underline;
}

a:active {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	color: #496c9f;	
	text-decoration: none; 	
}
</style>
<table border="0" cellpadding="1" cellspacing="1" width="100%"> 
<tr> 
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Titulo</font></th> 
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Visitas</font></th> 
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Respuesta</font></th> 
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Ultimos mensajes</font></th> 
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Fecha</font></th> 
</tr> 
<?php 

// HTML header end 

$sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_replies, t.topic_last_post_id, 

p.post_time,p.poster_id, f.forum_name, u.user_id, u.username 
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u 
WHERE 
t.forum_id = f.forum_id

AND p.topic_id = t.topic_id 
AND p.poster_id = u.user_id 
AND p.post_id = t.topic_last_post_id 
ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT; 
$nt_result = $db->sql_query($sql); 

if(!$nt_result) 
{ 
die("Failed obtaining list of active topics".mysql_error()); 
} 
else 
{ 
$nt_data = $db->sql_fetchrowset(); 
} 

if ( count($nt_data) == 0 ) 
{ 
die("No topics found"); 
} 
else 
{ 
$cq = 1; 
$cc = FFFFFF; 
// $nt_data contains all interesting data 
for ($i = 0; $i < count($nt_data); $i++) 
{ 
$title = $nt_data[$i]['topic_title']; 
$Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id']; 
$LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?p" . "=" . $nt_data[$i]['topic_last_post_id'] . "#p" . $nt_data[$i]['topic_last_post_id']; 

$on_forum = 'Forum ' . $nt_data[$i]['forum_name']; 
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']); 
//Profile profile.php?mode=viewprofile&u=23 
$profile = PHPBB_LOCATION . 'memberlist.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ; 
$usrname = $nt_data[$i]['username']; 
// Item HTML start 

if($cq%2 == 0){$cc = E8EFF4;$cq++;} else{$cc = E8EFF4;$cq++;}?> 
<tr> 
<td bgcolor="#<?php echo $cc;?>" align="left"><a href="<?php echo $LPurl; ?>" title="<?php echo $on_forum; ?>" 

target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $title; ?></B></font></a></td> 
<td bgcolor="#<?php echo $cc;?>" align="left"><div align="center"><font face="verdana" color="#5B5B5B" size="1"><?php echo 

$nt_data[$i]['topic_views'] ?></div></td> 
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#5B5B5B" size="1"><div align="center"><?php echo 

$nt_data[$i]['topic_replies'] ?></div></td> 
<td align="center" bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#666666" size="1"><a href="<?php 

echo $profile; ?>" target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $usrname?></B></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#5B5B5B" size="1"><div align="center"><?php echo 

$post_time ?></div></td> 
</tr> 
<?php 

// Item HTML end 

} 
} 

// Footer HTML start 

?> 

URL: www.rompelo.cl/foros
Estilo(s) usuado(s): quarto_asphalt_light
Extensiones instaladas: board3, entre otras que estoy subiendo
Versión de phpBB: 3.1.8
Servidor: dedicado
Si es una actualización desde otra versión: pase de 3.0 a 3.1

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


Avatar de Usuario
nextgen
Ex Staff
Mensajes: 1726
Registrado: 25 Jul 2009, 03:16
Género:
Edad: 40

Re: Ultimos post/topic en un html para verlo por iframe

#2

Mensaje por nextgen »

¿Qué te falla?

chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Re: Ultimos post/topic en un html para verlo por iframe

#3

Mensaje por chicosandro2004 »

este es el codigo de error

en el link se puede ver directo
http://www.rompelo.cl/foros/topic.php

Código: Seleccionar todo

Fatal error: Uncaught exception 'Symfony\Component\DependencyInjection\Exception\RuntimeException' with message 'A string value must be composed of strings and/or numbers, but found parameter "core.root_path" of type NULL inside string value "%core.root_path%includes/".' in /home/rompelo/public_html/foros/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php:235 Stack trace: #0 [internal function]: Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->Symfony\Component\DependencyInjection\ParameterBag\{closure}(Array) #1 /home/rompelo/public_html/foros/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php(242): preg_replace_callback('/%%|%([^%\\s]+)%...', Object(Closure), '%core.root_path...') #2 /home/rompelo/public_html/foros/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php(187): Symfony\Component\DependencyInjection\ParameterBag\ParameterBag->resolveString in /home/rompelo/public_html/foros/vendor/symfony/dependency-injection/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php on line 235

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


Avatar de Usuario
Bermúdez
Asiduo/a
Mensajes: 126
Registrado: 23 Nov 2010, 22:22
Género:
Edad: 55

Re: Ultimos post/topic en un html para verlo por iframe

#4

Mensaje por Bermúdez »

Chicosandro2004, para evitar problemas, antes de actualizar de 3.0.xx a 3.1.x deberías haber desinstalado completa y absolutamente todos los mods, ya que los mods son incompatibles con la nueva versión 3.1.x de phpbb.
Datos de soporte:

URL: https://ferrosim.es
Versión phpBB: 3.3.0
Versión de PHP: 7.3.17
Extensiones Instaladas:

  1. About us 2.1.3

  2. Advanced BBCode Box 3.2.2

  3. Automatic Topic Subscription 1.1.0

  4. Board3 Portal 2.1.0

  5. Board Rules 2.1.2

  6. Change Post Time 1.0.1

  7. Contact Admin 1.1.11

  8. Copyright in footer 1.0.2

  9. External Links Open in New Window 1.0.6

  10. Hotschi's Downloads 8.0.12

  11. Lightbox 2.0.2

  12. Magic OGP parser 1.0.3

  13. Modbreak 1.1.0

  14. NavBar Search 3.2.4

  15. Notify Admin on Registration 1.0.1

  16. Page Loader 1.0.2

  17. Pages 2.0.3

  18. Password Strength 1.2.3

  19. phpBB Media Embed PlugIn 1.1.1

  20. Post Numbers 1.1.3

  21. Pretty Topic 1.0.1

  22. Privacy protection 1.0.0-RC1

  23. Private Message Box Status Bars 2.0.2

  24. Quick Login 1.1.1

  25. Quoted where 1.0.2

  26. Scroll To Up and Bottom 1.0.2

  27. SCSS Compiler 1.0.1

  28. Search user topics 1.0.2

  29. Share On 2.0.1

  30. Simple mentions 1.0.5

  31. Slideshow for Header 3.3.0

  32. Stop Forum Spam 1.1.9

  33. Thanks for posts 2.0.7-dev

Estilo(s) usado(s): Elegance
Servidor: Linux - IONOS

Conversión desde otro sistema de foros: No

El inteligente no es aquel que lo sabe todo, sino aquel que sabe utilizar lo poco que sabe. -Sebastian Cohen Saavedra


chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Re: Ultimos post/topic en un html para verlo por iframe

#5

Mensaje por chicosandro2004 »

si, los deshimtale todos...

pero este mod o nose como llamarle, es solo una pagina "topic.php" que se mete dentro de la raiz del foro, modificas la ruta y ya esta...


tonces no era un mod que antes funcionaba bien y ahora no....

ojala pueda alguien ayudarme ya que igual es bien util este topic.php ya que puedes ver los posteos de mi foro en otros sitios...

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


towen
Moderador
Mensajes: 489
Registrado: 27 Dic 2011, 05:17
Género:
Edad: 28

Re: Ultimos post/topic en un html para verlo por iframe

#6

Mensaje por towen »

Prueba con este código, la manera de hacer las cosas en phpbb3.1 es mediante extensiones y este tipo de modificación no se considera correcto usarla (pero es más rápido corregirla que llevarla a extensión)

Código: Seleccionar todo

<?php

// Amount of active topics to show
define("TOPIC_COUNT", 8);

// URL to the phpBB installation
define("PHPBB_LOCATION", "http://www.rompelo.cl/foros/"); 

// Time format to output the date/time (for format see PHP manual)
define("TIME_FORMAT", "d/m/Y");

// php extension using
$phpEx = "php";

// No Editing unless you know what your doing
if ( !defined('IN_PHPBB') )
{
   define('IN_PHPBB', true);
}

$phpbb_root_path = './';

// Get the needed phpbb files, thank you phpbb =]
include($phpbb_root_path  . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);

$user->session_begin();
$auth->acl($user->data);
$user->setup();

// HTML header start

?>
<style>
a:link,
a:visited {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: none;   
}

a:hover {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: underline;
}

a:active {
   font-family: Verdana, Arial, Helvetica, sans-serif;
   color: #496c9f;   
   text-decoration: none;    
}
</style>
<table border="0" cellpadding="1" cellspacing="1" width="100%">
<tr>
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Titulo</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Visitas</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Respuestas</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Ultimos mensajes</font></th>
<th align="center" bgcolor="#DFE6EF"><font color="#5F5757" size="2">Fecha</font></th>
</tr>
<?php

// HTML header end

$sql = "SELECT DISTINCT t.topic_title, t.topic_id,t.topic_views,t.topic_posts_approved, t.topic_last_post_id,

p.post_time,p.poster_id, f.forum_name, u.user_id, u.username
FROM " . TOPICS_TABLE . " AS t, " . POSTS_TABLE . " AS p, " . FORUMS_TABLE . " AS f, " . USERS_TABLE . " AS u
WHERE
t.forum_id = f.forum_id

AND p.topic_id = t.topic_id
AND p.poster_id = u.user_id
AND p.post_id = t.topic_last_post_id
ORDER BY p.post_time DESC LIMIT " . TOPIC_COUNT;
$nt_result = $db->sql_query($sql);

if(!$nt_result)
{
die("Failed obtaining list of active topics".mysql_error());
}
else
{
$nt_data = $db->sql_fetchrowset();
}

if ( count($nt_data) == 0 )
{
die("No topics found");
}
else
{
$cq = 1;
$cc = 'FFFFFF';
// $nt_data contains all interesting data
for ($i = 0; $i < count($nt_data); $i++)
{
$title = $nt_data[$i]['topic_title'];
$Turl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?t=" . $nt_data[$i]['topic_id'];
$LPurl = PHPBB_LOCATION . 'viewtopic.' . $phpEx . "?p" . "=" . $nt_data[$i]['topic_last_post_id'] . "#p" . $nt_data[$i]['topic_last_post_id'];

$on_forum = 'Forum ' . $nt_data[$i]['forum_name'];
$post_time = date(TIME_FORMAT, $nt_data[$i]['post_time']);
//Profile profile.php?mode=viewprofile&u=23
$profile = PHPBB_LOCATION . 'memberlist.' . $phpEx . "?mode=viewprofile&u=" . $nt_data[$i]['poster_id'] ;
$usrname = $nt_data[$i]['username'];
// Item HTML start

if($cq%2 == 0){$cc = 'E8EFF4';$cq++;} else{$cc = 'E8EFF4';$cq++;}?>
<tr>
<td bgcolor="#<?php echo $cc;?>" align="left"><a href="<?php echo $LPurl; ?>" title="<?php echo $on_forum; ?>"

target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $title; ?></B></font></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><div align="center"><font face="verdana" color="#5B5B5B" size="1"><?php echo

$nt_data[$i]['topic_views'] ?></div></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#5B5B5B" size="1"><div align="center"><?php echo

$nt_data[$i]['topic_posts_approved'] ?></div></td>
<td align="center" bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#666666" size="1"><a href="<?php

echo $profile; ?>" target="_parent"><font face="verdana" color="#496C9F" size="1"><B><?php echo $usrname?></B></a></td>
<td bgcolor="#<?php echo $cc;?>" align="left"><font face="verdana" color="#5B5B5B" size="1"><div align="center"><?php echo

$post_time ?></div></td>
</tr>
<?php

// Item HTML end

}
}

// Footer HTML start

?> 

chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Re: Ultimos post/topic en un html para verlo por iframe

#7

Mensaje por chicosandro2004 »

exelente... esta modificacion es del codigo nuevo o es lo que yo mas arriba coloque?

gracias y aquí queda esta extencion para quienes quieran usarla

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Re: Ultimos post/topic en un html para verlo por iframe

#8

Mensaje por chicosandro2004 »

me podría ayudar con este... es similar al otro pero en este, solo muestro un foro en especifico... a diferecia del otro, me muestra los últimos posteos de todos los foros

Código: Seleccionar todo

<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../foros/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);

// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup('viewforum');




/* create_where_clauses( int[] gen_id, String type )
* This function outputs an SQL WHERE statement for use when grabbing
* posts and topics */

function create_where_clauses($gen_id, $type)
{
global $db, $auth;

$size_gen_id = sizeof($gen_id);

switch($type)
{
case 'forum':
$type = 'forum_id';
break;
case 'topic':
$type = 'topic_id';
break;
default:
trigger_error('No type defined');
}

// Set $out_where to nothing, this will be used of the gen_id
// size is empty, in other words "grab from anywhere" with
// no restrictions
$out_where = '';

if ($size_gen_id > 0)
{
// Get a list of all forums the user has permissions to read
$auth_f_read = array_keys($auth->acl_getf('f_read', true));

if ($type == 'topic_id')
{
$sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
WHERE ' . $db->sql_in_set('topic_id', $gen_id) . '
AND ' . $db->sql_in_set('forum_id', $auth_f_read);

$result = $db->sql_query($sql);

while ($row = $db->sql_fetchrow($result))
{
// Create an array with all acceptable topic ids
$topic_id_list[] = $row['topic_id'];
}

unset($gen_id);

$gen_id = $topic_id_list;
$size_gen_id = sizeof($gen_id);
}

$j = 0; 

for ($i = 0; $i < $size_gen_id; $i++)
 {
$id_check = (int) $gen_id[$i]; // If the type is topic, all checks have been made and the query can start to be built if( $type == 'topic_id' ) { $out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' '; } // If the type is forum, do the check to make sure the user has read permissions else if( $type == 'forum_id' && $auth->acl_get('f_read', $id_check) )
{
$out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
} 

$j++;
}
}

if ($out_where == '' && $size_gen_id > 0)
{
trigger_error('A list of topics/forums has not been created');
}

return $out_where;
}



?>
<link rel="stylesheet" type="text/css" href="http://www.ponelo.cl/clasificados/style/foros.css"/>
<body bgcolor="#111111">


<?php



// Número de últimos posts a mostrar:
$search_limit = 2;

// ID del foro específico. Si deseas más de un foro, separar por "comas".
$forum_id = array(4);
$forum_id_where = create_where_clauses($forum_id, 'forum');



$topics = 'SELECT * FROM ' . TOPICS_TABLE . '
' . $forum_id_where . '
AND topic_status <> ' . ITEM_MOVED . '
AND topic_approved = 1
ORDER BY topic_id DESC';

$topics_result = $db->sql_query_limit($topics, $search_limit);

while ($topics_row = $db->sql_fetchrow($topics_result))
{


//$topic_title = $topics_row['topic_title'];
$topic_title=substr($topics_row["topic_title"],0,20)."";
$topic_title = censor_text($topic_title);
$topic_author = get_username_string('full', $topics_row['topic_poster'], $topics_row['topic_first_poster_name'], $topics_row['topic_first_poster_colour']);
$topic_date = $user->format_date($topics_row['topic_time']);
$topic_last_post = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $topics_row['topic_last_post_id'] . "#" . $topics_row['topic_last_post_id']);
$topic_last_author = get_username_string('full', $topics_row['topic_last_poster_id'], $topics_row['topic_last_poster_name'], $topics_row['topic_last_poster_colour']);
$topic_link = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=" . $topics_row['topic_id']);

echo "

<div id='foro2' align=\"left\">
<a href=\"$topic_link\" target=\"_black\" style=\"font-size:13px;text-transform:lowercase; overflow:hidden\">$topic_title</a> <!-- por $topic_author - $topic_date -->
</div>
<img src=\"http://ponelo.cl/trasparente.gif\" height=\"2\">

";


}
?>

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


towen
Moderador
Mensajes: 489
Registrado: 27 Dic 2011, 05:17
Género:
Edad: 28

Re: Ultimos post/topic en un html para verlo por iframe

#9

Mensaje por towen »

Prueba con este, los dos son modificaciones de los originales que pusiste adaptándolo a como está guardada la información en la base de dato en la nueva versión. No son extensiones, son solo scripts externos que sacan información de phpbb.

Código: Seleccionar todo

<?php
	define('IN_PHPBB', true);
	$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : '../foros/';
	$phpEx = substr(strrchr(__FILE__, '.'), 1);
	include($phpbb_root_path . 'common.' . $phpEx);
	include($phpbb_root_path . 'includes/bbcode.' . $phpEx);
	include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
	
	// Start session management
	$user->session_begin();
	$auth->acl($user->data);
	$user->setup('viewforum');
	
	/* create_where_clauses( int[] gen_id, String type )
	* This function outputs an SQL WHERE statement for use when grabbing
	* posts and topics */
	
	function create_where_clauses($gen_id, $type)
	{
		global $db, $auth;
	
		$size_gen_id = sizeof($gen_id);
	
		switch($type)
		{
			case 'forum':
				$type = 'forum_id';
				break;
			case 'topic':
				$type = 'topic_id';
				break;
			default:
				trigger_error('No type defined');
		}
	
	// Set $out_where to nothing, this will be used of the gen_id
	// size is empty, in other words "grab from anywhere" with
	// no restrictions
		$out_where = '';
	
		if ($size_gen_id > 0)
		{
	// Get a list of all forums the user has permissions to read
			$auth_f_read = array_keys($auth->acl_getf('f_read', true));
	
			if ($type == 'topic_id')
			{
				$sql = 'SELECT topic_id FROM ' . TOPICS_TABLE . '
	WHERE ' . $db->sql_in_set('topic_id', $gen_id) . '
	AND ' . $db->sql_in_set('forum_id', $auth_f_read);
	
				$result = $db->sql_query($sql);
	
				while ($row = $db->sql_fetchrow($result))
				{
	// Create an array with all acceptable topic ids
					$topic_id_list[] = $row['topic_id'];
				}
	
				unset($gen_id);
	
				$gen_id = $topic_id_list;
				$size_gen_id = sizeof($gen_id);
			}
	
			$j = 0;
	
			for ($i = 0; $i < $size_gen_id; $i++)
			{
				$id_check = (int) $gen_id[$i]; // If the type is topic, all checks have been made and the query can start to be built if( $type == 'topic_id' ) { $out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' '; } // If the type is forum, do the check to make sure the user has read permissions else if( $type == 'forum_id' && $auth->acl_get('f_read', $id_check) )
				{
					$out_where .= ($j == 0) ? 'WHERE ' . $type . ' = ' . $id_check . ' ' : 'OR ' . $type . ' = ' . $id_check . ' ';
				}
	
				$j++;
			}
		}
	
		if ($out_where == '' && $size_gen_id > 0)
		{
			trigger_error('A list of topics/forums has not been created');
		}
	
		return $out_where;
	}	
	?>
		<link rel="stylesheet" type="text/css" href="http://www.ponelo.cl/clasificados/style/foros.css"/>
		<body bgcolor="#111111">
	<?php
	// Número de últimos posts a mostrar:
	$search_limit = 2;
	
	// ID del foro específico. Si deseas más de un foro, separar por "comas".
	$forum_id = array(4);
	$forum_id_where = create_where_clauses($forum_id, 'forum');	
	
	$topics = 'SELECT * FROM ' . TOPICS_TABLE . '
	' . $forum_id_where . '
	AND topic_status <> ' . ITEM_MOVED . '
	AND topic_visibility = ' . ITEM_APPROVED .' 
	ORDER BY topic_id DESC';
	
	$topics_result = $db->sql_query_limit($topics, $search_limit);
	
	while ($topics_row = $db->sql_fetchrow($topics_result))
	{
	
	//$topic_title = $topics_row['topic_title'];
		$topic_title=substr($topics_row["topic_title"],0,20)."";
		$topic_title = censor_text($topic_title);
		$topic_author = get_username_string('full', $topics_row['topic_poster'], $topics_row['topic_first_poster_name'], $topics_row['topic_first_poster_colour']);
		$topic_date = $user->format_date($topics_row['topic_time']);
		$topic_last_post = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "p=" . $topics_row['topic_last_post_id'] . "#" . $topics_row['topic_last_post_id']);
		$topic_last_author = get_username_string('full', $topics_row['topic_last_poster_id'], $topics_row['topic_last_poster_name'], $topics_row['topic_last_poster_colour']);
		$topic_link = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "t=" . $topics_row['topic_id']);
	
		echo "
	
	<div id='foro2' align=\"left\">
	<a href=\"$topic_link\" target=\"_black\" style=\"font-size:13px;text-transform:lowercase; overflow:hidden\">$topic_title</a> <!-- por $topic_author - $topic_date -->
	</div>
	<img src=\"http://ponelo.cl/trasparente.gif\" height=\"2\">
	
	";
	}
?>

chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Re: Ultimos post/topic en un html para verlo por iframe

#10

Mensaje por chicosandro2004 »

vale, muchas gracias por su ayuda.

pregunta: se puede colocar este script en otro dominio y desde alla llamar a la raiz del foro?

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


towen
Moderador
Mensajes: 489
Registrado: 27 Dic 2011, 05:17
Género:
Edad: 28

Re: Ultimos post/topic en un html para verlo por iframe

#11

Mensaje por towen »

esos no funcionarían

chicosandro2004
Observador/a
Mensajes: 38
Registrado: 11 Oct 2009, 05:43

Re: Ultimos post/topic en un html para verlo por iframe

#12

Mensaje por chicosandro2004 »

vale.. fuiste muy amable... si tienes una cuenta paypal me la das por skype y te regalo algunos usd como agradecimiento

tema solucionado..

Mis datos para soporte

Spoiler

URL: www.rompelo.cl
Estilo: quarto_asphalt_light
Extensiones instaladas: Advanced BBCode Box,Akismet Anti-Spam Extension,Board Announcements,Delete my registration,External Links Open in New Window,Genders,Hide Bots,mChat,Modern quote,Pages,Remove Subject from Replies,Share On,Simple mentions,Subir Imagen, User login redirect.
Versión de phpBB: 3.2.8
Versión de PHP: 5.6.39
Servidor: Dedicado


Cerrado

Volver a “Foros de Soporte 3.1.x”