Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: anycontent - Cannot redeclare make_clickable()  (Read 8980 times)

0 Members and 1 Guest are viewing this topic.

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
anycontent - Cannot redeclare make_clickable()
« on: May 08, 2009, 07:37:20 pm »

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

Code: [Select]
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

Code: [Select]
<?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&#269;et p&#345;ísp&#283;vk&#367; pro zobrazení a oprávn&#283;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&#283;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&#269;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&#271; 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']}&amp;t={$row['topic_id']}&amp;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
Logged

Joachim Müller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47843
  • aka "GauGau"
    • gaugau.de
Re: anycontent - Cannot redeclare make_clickable()
« Reply #1 on: May 09, 2009, 02:44:18 pm »

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.
Logged

mahdi1234

  • Coppermine regular visitor
  • **
  • Offline Offline
  • Posts: 60
Re: anycontent - Cannot redeclare make_clickable()
« Reply #2 on: May 09, 2009, 05:57:34 pm »

Ok, I do it using iframe then, thanks anyway.
Logged
Pages: [1]   Go Up
 

Page created in 0.018 seconds with 19 queries.