Re: [Release?] Extern.php News Extension

gleb wrote:

...I´m really lost here.

I´m using this line:

include('http://****/extern3.php?action=news&fid=2,8,9&summary=yes&show=3')

The line works but I want the first post in forums 2,8,9 to be displayed, not the last post in the selected forums. Do I have to change the code in my extern3.php or is there another incude for this?

Cheerrs!!

Yes, you'll have to edit the code. This mod behaves similarly to the news generator plugin.

Looking for a certain modification for your forum? Please take a look here before posting.

77

Re: [Release?] Extern.php News Extension

pogenwurst wrote:
gleb wrote:

...I´m really lost here.

I´m using this line:

include('http://****/extern3.php?action=news&fid=2,8,9&summary=yes&show=3')

The line works but I want the first post in forums 2,8,9 to be displayed, not the last post in the selected forums. Do I have to change the code in my extern3.php or is there another incude for this?

Cheerrs!!

Yes, you'll have to edit the code. This mod behaves similarly to the news generator plugin.

Well I think  I´ve found the string to change. Changed it to...

$msg = $db->query('SELECT id, poster, poster_id, poster_ip, poster_email, message, posted, edited, edited_by FROM '.$db_prefix.'posts WHERE topic_id='.$id.' ORDER BY id LIMIT 1') or error('Unable to fetch post info', __FILE__, __LINE__, $db->error());

For thoose who are intrested.

Re: [Release?] Extern.php News Extension

hi all,

i know this is quite an old topic but i hope you guys can help me out.

This mod only display 1 paragraph, how to change it  to show any desirable numbers of paragraph?

Thanks again!

if mONey is lOSt nOThINg is lOSt,
if cHArACtER is lOSt sOMeTHiNG is lOSt,
bUT,
if rELiGIon and eDUcATiON aRE lOSt eVErYThINg is lOSt.

79 (edited by TGO 2008-07-12 00:06)

Re: [Release?] Extern.php News Extension

FaRe-Ed wrote:

hi all,

i know this is quite an old topic but i hope you guys can help me out.

This mod only display 1 paragraph, how to change it  to show any desirable numbers of paragraph?

Thanks again!

Not sure if you still need this, but you'd change this code:

                    $truncate = isset($_GET['summary']) ? 1 : 0;
                    if ($truncate == 1)
                    {
                        $paragraph = preg_split("/\s*\n+/", $cur_post['message']);
                        if (isset($paragraph[1])) 
                        {
                            $cur_post['message'] = $paragraph[0] . "...";
                        }
                    }

To something like...

                    $truncate = isset($_GET['summary']) ? $_GET['summary'] : 0;
                    for($truncate > 0)
                    {
                        $result = preg_split("/\s*\n+/", $cur_post['message']);

                        if (count($result) > $truncate) 
                        {
                            $result = array_slice($result, 0, $truncate);
                            $cur_post['message'] = implode('\n\n', $result) . "...";
                        }
                    }

Then in your URL rather than
www.yourhost.com/forums/extern.php?action=news&fid=1,4,5&summary=yes

You'd have
www.yourhost.com/forums/extern.php?action=news&fid=1,4,5&summary=NUMBER_OF_PARAGRAPHS


I haven't tested this, but it should work.

80 (edited by JUICEG 2008-07-24 17:02)

Re: [Release?] Extern.php News Extension

Is it possible to use extern.php to extract the body of ONE specific forum topic?

eg, calling extern.php?topicid=123 will display just the content of that forum post? no replies required.

81

Re: [Release?] Extern.php News Extension

working for 1.3.2?
reference website for implementation?

82

Re: [Release?] Extern.php News Extension

tbone wrote:

working for 1.3.2?
reference website for implementation?

I doubt it - this mod is very much 1.2.* specific.