Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Plugin to recommend relevant content

I'm trying to figure out how I can create a simple plugin that recommends on the left hand side of my forum "Relevant Discussions". This is meant to introduce users to new content and help them stay around longer. The difficulty I am having is figuring out how to create a pocket/module that attaches to the left hand side of my forum's page and also how to show ~5 random discussion titles that the user can click on (after which the 5 random discussion list would refresh to show 5 new discussion titles).

The hardest part here is figuring out how to display discussions in the left hand side pocket.

Comments

  • I believe you can use this function, you can add it anywhere in your plugin class:

        public function siteNavModule_all_handler($sender) {
            // Add a link to the community home.
    $key="somekey";
    $link=["url"=>"someurl","text"=>"sometext"];
            $sender->addLink($key,$link);}
    

    AddLink has the following allowed parameters:

         * @param string|array $key The key of the link. You can nest links in a group by using dot syntax to specify its key.
         * @param array $link The link with the following keys:
         * - **url**: The url of the link.
         * - **text**: The text of the link. Html is allowed.
         * - **icon**: The html of the icon.
         * - **badge**: The link contain a badge. such as a count or alert. Html is allowed.
         * - **sort**: Specify a custom sort order for the item.
         *   This can be either a number or an array in the form ('before|after', 'key').
    
  • Take a look at the DiscussionTopic plugin. It creates a side panel of relevant discussions(rather than random ones), is highly customizable, and the source will give you hints as to the hooks you need to utilize should you want to write something on your own.

  • @rbrahmson said:
    Take a look at the DiscussionTopic plugin. It creates a side panel of relevant discussions(rather than random ones), is highly customizable, and the source will give you hints as to the hooks you need to utilize should you want to write something on your own.

    Wow!!!!! LOVE IT. Can you choose whether you want to attach side panel to right or left side of the forum? I prefer right side because left is crowded with content already.

  • Thank you for trying my plugin. The side panel location is dictated by the theme you use. Some have side panel on the left, some on the right (and you can even have it on the top;-)

  • @rbrahmson said:
    Thank you for trying my plugin. The side panel location is dictated by the theme you use. Some have side panel on the left, some on the right (and you can even have it on the top;-)

    Thanks so much for making this plugin! I'm really excited to try this out..

Sign In or Register to comment.