1

Topic: extern.php (print last topics) - troubleshotting :(

Hi,

I try to print a list of last topics on my homepage.
The basic usage of extern.php does't work sad I try this:

<?php
$cp = curl_init("http://terrainland.com/forum/extern.php?action=active&show=7");
curl_exec($cp);
?>

but this does not works... then I try this:

$old_get = $_GET;
$_GET = array();
$_GET['action'] = 'active';
include 'forum/extern.php';
$_GET = $old_get;

The forum is a subfolder of main site... and I have error:

Fatal error: require() [function.require]: Failed opening required './include/dblayer/mysql.php' (include_path='.:/:/usr/php/pear') in /forum/include/dblayer/common_db.php on line 48

(see in the footer of site: www.kursprawojazdy.pl/_index.php).

What I do wrong?


P.S. Sorry for my engish smile

Regards,
Fresh

Re: extern.php (print last topics) - troubleshotting :(

The second is certainly not going to work wink
Try

<?php
require 'http://www.kursprawojazdy.pl/forum/extern.php?action=active&show=7';
?>

If that doesn't work, I can't think of a way for you to use extern.php in its current form. You would need to find a modification/write one to allow syndication from within your own site.

3

Re: extern.php (print last topics) - troubleshotting :(

Hi,

I trayed with this.. no good results, one errors I saw. So, i thing... go to work smile I get the code from extern.php, and change it little, to fit im my site... now it works. Maybye this help someone. There is changed code (some variables is temporary, like max_subject_lenght or limit of displays post in SQL querry):

        $max_subject_length=20;
        $sql="SELECT t.id, t.subject FROM pl_forumtopics AS t INNER JOIN pl_forumforums AS f ON f.id=t.forum_id LEFT JOIN pl_forumforum_perms AS fp ON (fp.forum_id=f.id AND fp.group_id=3) WHERE (fp.read_forum IS NULL OR fp.read_forum=1) AND t.moved_to IS NULL ORDER BY t.last_post DESC LIMIT 5";
        $result = $result=mysql_query($sql); //$db->query(') or error('Unable to fetch topic list', __FILE__, __LINE__, $db->error());
        while ($row = mysql_fetch_array($result))
        {
            if ($pun_config['o_censoring'] == '1')
                $row['subject'] = censor_words($row['subject']);

            
            if (pun_strlen($row['subject']) > $max_subject_length)
                $subject_truncated = '1.'.pun_htmlspecialchars(trim(substr($row['subject'], 0, ($max_subject_length-5)))).' …';
            else
                $subject_truncated = '2.'.pun_htmlspecialchars($row['subject']);

            echo '<li>'.$row['subject'].' - <a href="forum/viewtopic.php?id='.$row['id'].'&action=new" title="'.pun_htmlspecialchars($row['subject']).'">'.$subject_truncated.'</a></li>'."\n";
        }

This displays 5 last posts smile

So, thank you for interesting of my problem... I read Your ansfers for problem like taht and I thing you very good know a PunBB.

Best regards,
Fresh

4

Re: extern.php (print last topics) - troubleshotting :(

I have a similare problem, and I don't get your script to work. What should i modify to make it work?