1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Getting XML/RSS while board is "closed"

Discussion in 'XenForo Development Discussions' started by Adam K M, Jun 25, 2015.

  1. Adam K M

    Adam K M Active Member


    I'm currently working on some custom resources for a forum, currently in the Options -> Board Active, I have turned the forum off, as I don't want users coming and seeing incomplete parts of the new forum.

    On the homepage (a regular page node), I would like to show the content from the most recent thread from our news and announcements forum. I decided the easiest and quickest way to do so would be by using XenForo's built-in RSS feeds. However, when the server fetches the post content via php (by <xen:callback>) with a custom plugin, the returned data is not the xml of the forum, but rather, a message saying that the board is currently closed.

    How would I go about getting the most recent post to show up? Fixing the XML loader to view board options is probably the quickest, but I don't mind using another method via templates.

    Here's the current code:
    class SCC_Main_miscFuncs {
        public static function 
    printMostRecentPost() {
    $rssUrl func_get_arg(1);
    $xml simplexml_load_string(self::returnContents($rssUrl));
    echo $xml->message;
        public static function 
    curl_setopt($curl_handleCURLOPT_USERAGENT'ShortCut Central');
    $query curl_exec($curl_handle);
    Page Code
                    <xen:callback class="SCC_Main_miscFuncs"
                        params="{$xenOptions.boardUrl}/{xen:link 'forums', {xen:array 'node_id=4'}}index.rss">


Share This Page