hello,
I'd like to fetch phpbb latest topics and display them on my front page.
Doing this outside of coppermine works fine - http://testing.fotoluzr.net/ticker.php
However when I include it as a part of anyconent, I'm getting following error
Fatal error: Cannot redeclare make_clickable() (previously declared in /DISK3/WWW/fotoluzr.net/testing/include/functions.inc.php:549) in /DISK3/WWW/fotoluzr.net/testingboard/includes/functions_content.php on line 669
anycontent.php contains following
<?php
starttable("100%", "Latest Forum Topics");
?>
<tr><td class="tableb" >
<?php
/**
* newest_posts - raw dump of newest posts from forum
*
* @copyright (c) 2008 ameeck / Vojtech Vondra - phpBB.cz
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/
define('IN_PHPBB', true);
$phpbb_root_path = '../testingboard/';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin();
$auth->acl($user->data);
$user->setup();
// Number of posts and grabbing permissions
// Počet příspěvků pro zobrazení a oprávnění
$topic_limit = request_var('topic_limit', 10);
$forums = array_unique(array_keys($auth->acl_getf('f_read', true)));
// Select the last topics to which we have permissions
// Vybrat poslední témata ke kterým máme oprávnění
$sql = 'SELECT p.post_id, p.topic_id, p.forum_id, p.post_subject, p.post_time, u.username
FROM ' . POSTS_TABLE . ' p , ' . USERS_TABLE . ' u
WHERE post_approved = 1
AND u.user_id = p.poster_id
ORDER BY post_time DESC
LIMIT 0,' . $topic_limit;
$result = $db->sql_query($sql);
// Proper header since output not buffered
// Poslat hlavičky pro správné kódování, protože výpis obsahu je postupný
header('Content-Type: text/html; charset=utf-8');
// Now let's output the content
// A teď vypsat obsah
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Last Topics</title></head><body><div id="post_content"><strong>Last Topics:</strong><br/><ul>';
while ($row = $db->sql_fetchrow($result))
{
$url = generate_board_url() . "/viewtopic.{$phpEx}?f={$row['forum_id']}&t={$row['topic_id']}&p={$row['post_id']}#p{$row['post_id']}";
echo '<li><a target="_top" href="' . $url . '">' . $row['post_subject'] . '</a> from ' . $row['username'] . ' on ' . $user->format_date($row['post_time']) . '</li>';
}
echo '</ul></div></body></html>';
?>
<?php
endtable();
?>
Would you have any idea how to fix this or if there's better way than use anycontent for this?
thanks,
mahdi
You can not include complex scripts into anycontent.php, as you'll run into errors like the one you get. What you're up to simply is not possible.
Ok, I do it using iframe then, thanks anyway.