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.

First topics excerpt

EilieneEiliene New
edited July 2011 in Vanilla 2.0 - 2.8
How to make first 1 - 3 new topics to have excerpts?
Tagged:

Best Answer

  • peregrineperegrine MVP
    edited July 2012 Answer ✓

    I don't know if this is what you want. but if you download the

    http://vanillaforums.org/addon/discussionexcerpt2-plugin

    and replace the lines around line 43 from

     public function DiscussionsController_AfterDiscussionTitle_Handler(&$Sender) {
    
    to
    
    
     public function DiscussionsController_AfterDiscussionTitle_Handler($Sender) {  
    
           static $discussionNumber=0;
           $discussionNumber++;
    
           if ($discussionNumber > 3) return;
    

    in the default.php - it will present excepts only for the first 3 topics.

    BTW. you never responded if you solved the welcome! translation.

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

Answers

  • lucluc ✭✭
    Check out the timely theme, it does that for all the discussions on the front page.
    You will have to limit to 3.
    http://vanillaforums.org/addon/timely-theme
    UnderDog
  • That works, but cant find how to limit only the 1- 3 first one to have excerpts

  • peregrineperegrine MVP
    edited July 2012 Answer ✓

    I don't know if this is what you want. but if you download the

    http://vanillaforums.org/addon/discussionexcerpt2-plugin

    and replace the lines around line 43 from

     public function DiscussionsController_AfterDiscussionTitle_Handler(&$Sender) {
    
    to
    
    
     public function DiscussionsController_AfterDiscussionTitle_Handler($Sender) {  
    
           static $discussionNumber=0;
           $discussionNumber++;
    
           if ($discussionNumber > 3) return;
    

    in the default.php - it will present excepts only for the first 3 topics.

    BTW. you never responded if you solved the welcome! translation.

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

  • EilieneEiliene New
    edited July 2012

    That worket in timely hooks :D. I jus insert static $discussionNumber=0; $discussionNumber++; if ($discussionNumber > 3) return; after $Discussion = GetValue('Discussion', $Sender->EventArguments);.
    Next thing is to figure out how to remove links (youtube etc) from exerpts, or display message like "includes video" or something like that.

    No, didn´t managet to translate that Welcome message, but its not big deal, it shows only in activities :D.

Sign In or Register to comment.