collapse

* Simple Portal Archived Forum

This is an Archive Forum.

The content in this forum may be out-of-date or have been superseded by newer information, and links in forum pages to other sites may not work.
This forum contains archives for future reference.

Visit our thread at Simple Machines Forum for current support.

SMF 2.1 users: EhPortal is a ported version of Simple Portal specifically designed for the SMF 2.1 branch.
Please visit web-develop.ca to download EhPortal and for its support.

* User Info

 
 
Welcome, Guest. Please login or register.

* Who's Online

  • Dot Guests: 419
  • Dot Hidden: 0
  • Dot Users: 0

There aren't any users online.

* Shoutbox

Refresh History
  • Shoutbox is not for support!
  • {OCS}MasterSeal: Yup, Still adore SP
    April 21, 2019, 07:08:06 PM
  • {OCS}MasterSeal: STILL love SP :)
    November 24, 2018, 05:05:50 AM
  • ♦ Ninja ZX-10RR ♦: <3 aegersz
    September 13, 2018, 03:36:09 PM
  • aegersz: I STILL <3 LOVE SimplePortal
    September 13, 2018, 07:11:39 AM
  • aegersz: o LOVE you guys - Simple Portal rocks !
    May 09, 2018, 05:18:59 AM
  • Chen Zhen: our apologies for the site being down.. please read server issues topic
    March 22, 2018, 05:32:38 AM
  • {OCS}MasterSeal: LOL PLEASE forget I just posted that. I found the answer in my own dang post back in 2015. lol sorry!
    July 04, 2017, 10:47:55 PM
  • {OCS}MasterSeal: I know this SB isnt' for support, but I just have a general question. Who would I contact to find out where SP stores its block info? Is it DB driven or files? I searched the site but came up with nothing. probably my fault any insight is appreciated.
    July 04, 2017, 10:43:36 PM
  • ♦ Ninja ZX-10RR ♦: Excuse me but what does Simpleportal have to deal with that?
    February 05, 2017, 08:21:14 PM
  • WhiteEagle: of course IMHO that site appears to be dead :(
    February 04, 2017, 01:08:05 PM
  • WhiteEagle: If I can get that, then I'll use it for that site...
    February 04, 2017, 01:07:35 PM
  • WhiteEagle: decided to not use SMF for any projects, unless I can get a copy of the premium version of the fanfiction archive plugin
    February 04, 2017, 01:06:54 PM
  • expertdecisions: cloudflare
    January 28, 2017, 08:01:47 AM
  • aegersz: SM release 2.0.13 !
    January 12, 2017, 06:00:13 AM
  • raffo: Tks Emanuele, even if I didn't understand the fix :D
    November 07, 2016, 02:01:20 AM
  • emanuele: [link]
    November 01, 2016, 12:43:50 PM
  • emanuele: raffo: the English support board is a good place. ;)
    November 01, 2016, 12:43:38 PM
  • raffo: Where can I find the fix for the shoutbox?
    November 01, 2016, 05:06:09 AM
  • {OCS}MasterSeal: To the SP team, I make a point to come here and thank you as much as possible for your work.  so again, THANK YOU!
    October 28, 2016, 10:38:05 AM
  • emanuele: That's indeed funny, the limit is present only in the patch and not the full install.
    October 22, 2016, 06:14:58 PM

* Recent Posts

Adding Forums Button to Nav bar by jirapon
[August 01, 2019, 09:07:12 AM]


Re: Board Icons by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 04:03:41 PM]


MOVED: Czech translation???? by ♦ Ninja ZX-10RR ♦
[July 30, 2019, 03:04:51 PM]


Board Icons by jirapon
[July 30, 2019, 07:28:44 AM]


Re: Thankyou Simpleportal, by ♦ Ninja ZX-10RR ♦
[July 29, 2019, 09:41:29 AM]

NEED HELP? If you're looking for support with Simple Portal, look no further than the Support Board!

Author Topic: Display MediaWiki RSS Feed In Simple Portal Block  (Read 6166 times)

0 Members and 1 Guest are viewing this topic.

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Display MediaWiki RSS Feed In Simple Portal Block
« on: August 28, 2011, 10:27:28 AM »
I'm trying to create a custom block (RSS) in Simple Portal to display my MediaWiki RSS feed of 'Recent Changes'.

I've added /index.php?title=Special:Recentchanges&feed=rss to the MediaWiki URL but on previewing the new block I get the error 'XML error: Undeclared entity warning at line 150'.

Any help advice would be welcome.
SMF 2.0 Gold
SP 2.3.3

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #1 on: August 28, 2011, 11:03:22 AM »
I was looking for something similar, too - some month ago...

It is not possible...

http://simpleportal.net/index.php?topic=7615.msg42675#msg42675

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #2 on: August 28, 2011, 11:46:54 AM »
The following is some code another portal user (name not remembered) left on a topic.

This is my rss which I use for local news.

Hope it helps.

You can see it working on my forum at www.miltonkeynesaware.co.cc the block has been renamed as Local News.

Code: [Select]
    global $rss_data, $rss_current, $rss_counter, $rss_main;

    // This needs to be unique to each block
    $id = 1;
   
    // Your feed url
    $feed = 'http://[color=red]FEED URL';[/color]

    $rss_data = array();
    $rss_current = "";
    $rss_counter = 0;
    $rss_main = '';

    $xml_parser = xml_parser_create();

    xml_set_element_handler($xml_parser, "sp_startElement", "sp_endElement");

    xml_set_character_data_handler($xml_parser, "sp_characterData");

    if (!($fp = @fopen($feed, "r")))
    {
        echo 'Invalid feed URL.';
        return;
    }

    while ($data = fread($fp, 4096))
    {
        if (!xml_parse($xml_parser, $data, feof($fp)))
        {
            $xmlerr = (sprintf("XML error: %s at line %d",
            xml_error_string(xml_get_error_code($xml_parser)),
            xml_get_current_line_number($xml_parser)));

            break;
        }
    }

    fclose($fp);
   
    xml_parser_free($xml_parser);

    if (!empty($xmlerr))
    {
        echo $xmlerr;
        return;
    }

    if (empty($rss_data))
    {
        echo 'No items to show.';
        return;
    }

    if (isset($rss_data['ITEMS']))
    {
        echo '
        <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
            function toggleDescription(id)
            {
                id = \'rss_descr_\' + id;
                if(document.getElementById(id).style.display == \'none\')
                    document.getElementById(id).style.display = \'\';
                else
                    document.getElementById(id).style.display = \'none\';
            }
        // ]]></script>';
       
        $max = count($rss_data['ITEMS']);
        if ($max > 0)
        {
            for($i = 0; $i < $max; $i++)
            {
                echo '
                    <span style="font-weight: bold;" class="smalltext"><a href="javascript:toggleDescription(\'', $id, '_', $i, '\')">', $rss_data['ITEMS'][$i]['TITLE'], '</a></span><br />';
                echo '
                    <div id="rss_descr_', $id, '_', $i, '" class="smalltext">
                        ', html_entity_decode($rss_data['ITEMS'][$i]['DESCRIPTION']) . '<br /><br />
                        <a href="', $rss_data['ITEMS'][$i]['LINK'], '" target="_blank"><b>view link ยป</b></a>';
                if ($i != $max - 1)
                    echo '<hr />';
                echo '
                    </div>
                    <script language="JavaScript" type="text/javascript"><!-- // --><![CDATA[
                        toggleDescription(\'', $id, '_', $i, '\');
                    // ]]></script>';
               
            }
        }
    }
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #3 on: August 28, 2011, 12:09:29 PM »
I just tried the feed from Wikipedia with the new RSS block I coded for 2.3.4 and it worked just fine. Hopefully the new block is going to solve most the issues people have with feeds.
And slowly, you come to realize... It's all as it should be...

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #4 on: August 28, 2011, 01:21:48 PM »
Do ya need a guinea pig for testing the new version Sinan?
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #5 on: August 29, 2011, 05:04:39 AM »
Thanks for the code, Brack 1, I'll give a try and report back.

Looking forward to the 2.3.4! 
SMF 2.0 Gold
SP 2.3.3

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #6 on: August 29, 2011, 06:27:48 AM »
@ Brack1

This is what I get when I try to access your site.

ESET NOD32 Antivirus - Alert
Access denied !

Details:

Web page:
http://www.miltonkeynesaware.co.cc/

Description:
Access to the web page was blocked by ESET NOD32 Antivirus.
The web page is on the list of websites with potentially dangerous content.


Thought you ought to know. 
SMF 2.0 Gold
SP 2.3.3

Offline [SiNaN]

  • Mr. SimplePortal
  • Developer
  • *
  • Posts: 6782
  • SMF Version: 2.0.15
  • SP Version: 2.3.7
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #7 on: August 29, 2011, 09:27:06 AM »
Do ya need a guinea pig for testing the new version Sinan?

Nope, not yet.
And slowly, you come to realize... It's all as it should be...

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #8 on: August 29, 2011, 09:50:13 AM »
@ Brack1

This is what I get when I try to access your site.

ESET NOD32 Antivirus - Alert
Access denied !


I'd move to a more reliable anti virus if I were you.

Nobody else has ever had the same message as you.

In fact the forum is almost 18 months old and has over 300 followers on twitter.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #9 on: August 29, 2011, 12:47:27 PM »
I'm not casting aspersions, just making you aware of the message.
SMF 2.0 Gold
SP 2.3.3

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #10 on: August 29, 2011, 01:07:17 PM »
I'm not casting aspersions, just making you aware of the message.

No worries bud. Seems as though a contact is required lol.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline ccbtimewiz

  • Hero Member
  • *****
  • Posts: 2185
  • Gender: Male
  • $("div.content:dd").hide();
  • SMF Version: None
  • SP Version: None
  • Elkarte Version: None
  • EhPortal Version: None
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #11 on: August 29, 2011, 04:28:49 PM »
@ Brack1

This is what I get when I try to access your site.

ESET NOD32 Antivirus - Alert
Access denied !


I'd move to a more reliable anti virus if I were you.

ESET NOD32 is probably the most reliable anti-virus on the market. One of the best.

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #12 on: August 30, 2011, 09:29:05 AM »
newtoallthis,
Did the code from Brack1 help?
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #13 on: August 30, 2011, 04:48:38 PM »
Not got round to trying it yet, but it would be useful to know where to put it!  :nervous-happy:

SMF 2.0 Gold
SP 2.3.3

Offline Old Fossil

  • Beta Tester
  • *
  • Posts: 796
  • Gender: Male
  • SMF Version: 2.0.4
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #14 on: August 30, 2011, 06:00:48 PM »
Not got round to trying it yet, but it would be useful to know where to put it!  :nervous-happy:

Ops.

The php block is the one ya want.
Daily backups mean less headaches

Block Set Up

I may be no coding expert but I am willing to help where I can.

I eat Spammers for breakfast

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #15 on: August 31, 2011, 03:29:36 PM »
OK, understood.

Placing this code in a PHP custom block and adding a rss feed URL (e.g. BBC) doesn't work.

Thanks for trying though.
SMF 2.0 Gold
SP 2.3.3

Offline Divecall

  • Full Member
  • ***
  • Posts: 201
  • SMF Version: 2.0.2
  • SP Version: 2.3.5
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #16 on: August 31, 2011, 06:02:46 PM »
Doesnt work for me, too (the block-code)....

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #17 on: September 01, 2011, 11:32:16 AM »
hmm.  In what way does it not work?
Even when you replace
Code: [Select]
    // Your feed url
    $feed = 'http://[color=red]FEED URL';[/color]
with something like
Code: [Select]
    // Your feed url
    $feed = 'http://simpleportal.net/index.php?type=rss;action=.xml';
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?

Offline newtoallthis

  • Jr. Member
  • **
  • Posts: 94
  • SMF Version: 2 RC5
  • SP Version: 2.3.3
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #18 on: September 02, 2011, 05:05:13 PM »
hmm.  In what way does it not work?
Even when you replace
Code: [Select]
    // Your feed url
    $feed = 'http://[color=red]FEED URL';[/color]
with something like
Code: [Select]
    // Your feed url
    $feed = 'http://simpleportal.net/index.php?type=rss;action=.xml';

I've tried various rss feeds and only one worked and even then not well.

xml is the bit that makes the difference it seems, but I can't trace paths to appropriate xml files for 99% of rss feeds.
SMF 2.0 Gold
SP 2.3.3

Offline AngelinaBelle

  • Comrade
  • *
  • Posts: 4870
  • Gender: Female
  • SMF Version: 2 RC3
  • SP Version: 2.3.2
Re: Display MediaWiki RSS Feed In Simple Portal Block
« Reply #19 on: September 07, 2011, 08:05:47 AM »
I'm sorry to hear that brack1's RSS block is not working well for you.
I know that Sinan has been working on the RSS block for SimplePortal. In the past, it has used certain SMF functions that seemed as though they ought to do the job but did not quite do it. In the future, it will use functions that can handle valid RSS feeds.
Please to keep this website running, if you like SimplePortal, make a
one-time subscription. Thank you for your support.

Have you tried the SimplePortal documentation?