YAFLogo

thebeloved
  • thebeloved
  • 56% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
I wonder if is possible to display in a page only the Active Discussion panel, for example to place it in an iframe on another portal or website.

I search the forum to find a solution, but any of the suggestion i found are useful, maybe because they refer to old version of YAF.

Any suggestion will be really appreciated. Thanks.
Gianni Mantellini
Napulevola Vice-CEO
http://www.napulevola.it/ 
Sponsor

bbobb
  • bbobb
  • 100% (Exalted)
  • YAF Developer
14 years ago
RSS feed for Active Discussions?
thebeloved
  • thebeloved
  • 56% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
bbobb wrote:

RSS feed for Active Discussions?



Is there a possibility to retrieve the active discussions via RSS feed?
Gianni Mantellini
Napulevola Vice-CEO
http://www.napulevola.it/ 
chriscoe71
14 years ago
thebeloved wrote:

I wonder if is possible to display in a page only the Active Discussion panel, for example to place it in an iframe on another portal or website.

I search the forum to find a solution, but any of the suggestion i found are useful, maybe because they refer to old version of YAF.

Any suggestion will be really appreciated. Thanks.



Are you referring to the Active Discussions table on the main page (Latest Posts) or the Active Topics page, which can be reach by clicking on "Active Topics" in the top toolbar?
thebeloved
  • thebeloved
  • 56% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
chriscoe71 wrote:


Are you referring to the Active Discussions table on the main page (Latest Posts) or the Active Topics page, which can be reach by clicking on "Active Topics" in the top toolbar?



I'm referring to the Active Discussions table on main page. I tought to show only this table in another website to easily track the latest posts. I tried to see a bit the code to find what user control can do this, but unfortunately i'm not so much skilled about programming, and YAF is a large project.
Gianni Mantellini
Napulevola Vice-CEO
http://www.napulevola.it/ 
chriscoe71
14 years ago
You could expose the data that is returned from the topic_latest stored procedure using a Web Service and then consume it on any site.

Because the user would not be authenticated on the other site, the example below has the guest account hardcoded so that only topics that a Guest can view will be returned.

Add this to YafWebService.asmx


      [WebMethod( Description = "Return Active Discussions Topics for Guest Users", EnableSession = false )]
   public DataTable GetActiveDiscussions(string token, int PageBoardID, int ActiveDiscussionsCount)
    {
        // validate token...
        if (token != YafContext.Current.BoardSettings.WebServiceToken)
        {
            throw new Exception("Invalid Secure Web Service Token: Operation Failed");
        }
        DataTable activeTopics = YAF.Classes.Data.DB.topic_latest(PageBoardID, ActiveDiscussionsCount, 1);

        return activeTopics;
    }

You could copy the code from the Controls/ForumActiveDiscussion.ascx and alter it to consume the data from the web service if you want the same look/feel.

Hope that helps.
thebeloved
  • thebeloved
  • 56% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
chriscoe71 wrote:

You could expose the data that is returned from the topic_latest stored procedure using a Web Service and then consume it on any site.

Because the user would not be authenticated on the other site, the example below has the guest account hardcoded so that only topics that a Guest can view will be returned.

Add this to YafWebService.asmx


      [WebMethod( Description = "Return Active Discussions Topics for Guest Users", EnableSession = false )]
   public DataTable GetActiveDiscussions(string token, int PageBoardID, int ActiveDiscussionsCount)
    {
        // validate token...
        if (token != YafContext.Current.BoardSettings.WebServiceToken)
        {
            throw new Exception("Invalid Secure Web Service Token: Operation Failed");
        }
        DataTable activeTopics = YAF.Classes.Data.DB.topic_latest(PageBoardID, ActiveDiscussionsCount, 1);

        return activeTopics;
    }

You could copy the code from the Controls/ForumActiveDiscussion.ascx and alter it to consume the data from the web service if you want the same look/feel.

Hope that helps.



Thanks in advance for Your help! I'll try it soon on my website. I'll let You know, ciao!
Gianni Mantellini
Napulevola Vice-CEO
http://www.napulevola.it/ 
herman_herman
14 years ago
Hey thebeloved,
Nice to see a FS fan use YAF as his forum.Happy landings.
thebeloved
  • thebeloved
  • 56% (Neutral)
  • YAF Forumling Topic Starter
14 years ago
herman_herman wrote:

Hey thebeloved,
Nice to see a FS fan use YAF as his forum.Happy landings.



Thanks herman_herman!

as we told: Blue Skies to all the YAF dev group for his great work!!! :-d


Gianni Mantellini
Napulevola Vice-CEO
http://www.napulevola.it/ 
YAF Logo Copyright © YetAnotherForum.NET & Ingo Herbote. All rights reserved
About Us

The YAF.NET is an open source .NET forum project. YAF.NET is supported by an team of international developers who are build community by building community software.

Powered by Resharper Donate with PayPal button