HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Featured Topics on home page

I am interested in finding out if there is any addon that can replace the home page (All Discusions) with a custom page that displays topics that admins find interesting and have decided to feature them. Admins will be go through all new/previous threads and if there is a need to highlight them then they will be marked as "featured posts" which will automatically take them to the home page.

Best Answers

«1

Answers

  • peregrineperegrine MVP
    edited November 2015

    if the yaga application best of doesn't cut it for you. you could probably easily clone aspects of it to fit your purposes or write an additional rule if necessary. and route/default controller change.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • airsayairsay New
    edited November 2015

    I will look that up and post my feedback. The feature I am trying to mimick is located on the homepage at www.nairaland.com. This is a very popular style amongst Nigerian Forums as it happens to be the most succesful forum in Nigeria. One of its major feature is the ability to display certain threads as "Featured Topics" on the Home page which happens to be a potential for monetisation

  • peregrineperegrine MVP
    edited November 2015

    which happens to be a potential for monetisation

    not much potential here. :innocent:

    suggestions and advice is free.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • PS: I am not looking for this feature for money's sake. I am looking for this feature as that is what most of my target niche expect to find in a forum when they visitis its home page.

  • I believe the hosted vanilla has a best of available to clients - you could try that as well.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • It would be trivial to create a new view of the discussions controller called "Featured" and make that your home page.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • peregrineperegrine MVP
    edited November 2015

    I might add it is pretty much everything is trivial if you have the step by step instructions or the know how.

        triv·i·al
        ˈtrivēəl/
        adjective
        adjective: trivial
            of little value or importance.
            "huge fines were imposed for trivial offenses"
            synonyms:   unimportant, banal, trite, commonplace, insignificant, inconsequential, minor, of no account, of no consequence, of no importance; More
            incidental, inessential, nonessential, petty, trifling, trumpery, pettifogging, footling, small, slight, little, inconsiderable, negligible, paltry, nugatory;
            informalpiddling, picayune, nickel-and-dime, penny-ante;
            de minimis;
            trademarkMickey Mouse
            "trivial problems"
            antonyms:   important, significant, life-and-death
                (of a person) concerned only with trifling or unimportant things.
                synonyms:   frivolous, superficial, shallow, unthinking, airheaded, featherbrained, lightweight, foolish, silly, trite
                "I used to be quite a trivial person"
                antonyms:   profound, serious
                Mathematics
                denoting a subgroup that either contains only the identity element or is identical with the given group.
    

    vanilla hosting would be the least trivial. they do all the work.

    otherwise for newbie users without clear instructions would not find it trivial.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • hgtonighthgtonight MVP
    edited November 2015

    @peregrine said:
    I might add it is pretty much everything is trivial if you have the step by step instructions or the know how.

    Sorry. I made the mistake of assuming people were as used to the codebase as I am. Here are some steps and some sample code.

    1. Create a plugin.
    2. Extend the discussions controller
    3. Change the get query on the discussion model if you are on your new page
    4. Set your home route to the new discussions method via config
          private $CustomView = FALSE;
    
          public function DiscussionsController_Featured_Create($Sender, $Args = array()) {
            $this->CustomView = TRUE;
            $Sender->View = 'Index';
            $Sender->SetData('_PagerUrl', 'discussions/featured/{Page}');
            $Sender->Index(GetValue(0, $Args, 'p1'));
          }
    
          public function Base_AfterDiscussionFilters_Handler($Sender) {
            echo '<li class="Featured ' . ($this->CustomView === TRUE ? ' Active' : '') . '">' .
                    Anchor(Sprite('SpUnansweredQuestions') . ' ' . T('Featured'),
                      '/discussions/featured', 'Featured') . '</li>';
          }
    
          public function DiscussionModel_BeforeGet_Handler($Sender) {
            if($this->CustomView === TRUE) {
              $Wheres = & $Sender->EventArguments['Wheres'];
              $Wheres['d.Score'] = '>= 20';
              Gdn::Controller()->Title('Featured Discussions');
            }
          }
    

    At this point, create an action in Yaga called Featured, give it to admins only, and give it 20 points. Anything you want to feature, click the Featured reaction and it will show up on your featured page.

    Or create a new column called feature and sort on that instead.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • @hgtonight I will get back to you on this "hack" you have provided. It seems to be closer to the solution I am looking for

  • Unfortunately, I am unable to do this without some step by step guide. My knowledge of programming is not that vast. I am able to follow a step-by-step instruction if you are willing toi help me

  • peregrineperegrine MVP
    edited November 2015

    @arisay said: Unfortunately, I am unable to do this without some step by step guide.

    • if you don't get a step-by-step (or perhaps you could hire developer) otherwise ...

    the hard part is laid out for you, perhaps a bit of effort, sweat and tears, on your part will get you up to speed.

    • 1 install yaga application. see the read me, read discussions.
    • 2 insert the above code in a plugin - see discussions on how to create a plugin.
    • 3 enable the plugin
    • 4 go back yaga - create the rule - see the documentation and discussions in forum.

    see documentation link at top of page.

    spend a week or two studying documentation will help you vastly.

    you also have the option of using vanillaforums.com hosting.

    if you have trouble along the way after a week of study, you could ask questions, but if you don't prove you are making an effort, some people may not assist.

    Generally, people who get the most help on the forum, make the most effort in learning the simpler things.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • To be clear, you can do this without Yaga. I was using it as an example because I use the codebase a lot.

    You can also create your own method that modifies a discussion's score (or any other field). Then you create an easy to find link and you are done.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • airsayairsay New
    edited November 2015

    @peregrine said:

    the hard part is laid out for you, perhaps a bit of effort, sweat and tears, on your part will get you up to speed.

    ** - 1 install yaga application. see the read me, read discussions.

    • 2 insert the above code in a plugin - see discussions on how to create a plugin.
    • 3 enable the plugin
    • 4 go back yaga - create the rule - see the documentation and discussions in forum.**

    I have actually done the steps 1 - 4 outlined above. The link for "Featured" is visible. I have also created a discussion with a non-admin user and then logged in as admin to flag the post as featured. However when I click on the "Featured" link, I get the message "No discussions were found"

  • peregrineperegrine MVP
    edited November 2015

    @airsay said:

    @peregrine said:

    @arisay said: Unfortunately, I am unable to do this without some step by step guide.

    • if you don't get a step-by-step (or perhaps you could hire developer) otherwise ...

    the hard part is laid out for you, perhaps a bit of effort, sweat and tears, on your part will get you up to speed.

    • 1 install yaga application. see the read me, read discussions.
    • 2 insert the above code in a plugin - see discussions on how to create a plugin.
    • 3 enable the plugin
    • 4 go back yaga - create the rule - see the documentation and discussions in forum.

    I have actually done the steps 1 - 4 outlined above. The link for "Featured" is visible. I have also created a discussion with a non-admin user and then logged in as admin to flag the post as featured. However when I click on the "Featured" link, I get the message "No discussions were found"

    make sure your rule is working.

    check the discussion table and see if 20 points are added in score field.

    alternatively you might want to manually add a score of 20 to a few discussions in discussion table.

    to test.

    I am running interference best to let hgtonight take over.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • make sure your rule is working.

    check the discussion table and see if 20 points are added in score field.

    alternatively you might want to manually add a score of 20 to a few discussions in discussion table.

    to test.

    I am running interference best to let hgtonight take over.

    How do I verify that the rule is working?

    I have accessed the gdn_discussion table and the initial thread i had marked as a feature thread had a score of 20. I manually assigned another thread 20 and checked the teh "Featured" page with the same "error" message.

  • Yep! That's it. Works Now!!! Thanks a lot for the time and patience.

    How can I make this Feature page my default page for guests and logged in guests

  • what are you using to create the animated gifs? does it work on linux.

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @peregrine said:
    what are you using to create the animated gifs? does it work on linux.

    It is a little tool my friend is writing. I was helping him get it working. It uses .net which is windows only, I believe.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

Sign In or Register to comment.