Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Options

search results with pages

edited August 2006 in Vanilla 1.0 Help
When searching in "comments" mode, results have links like this comments.php?DiscussionID=364&Focus=21491#Comment_21491 and since there is no "page" variable, if comment is not on the first page of that topic, search result won't be displayed correctly. Link will open first comment on first page of that topic. "page" variable in that resulting link would solve problem, but I can't figure out what piece of code to add and get that page link. I've tried with changing line 30 of library/Vanilla.Functions.php file from <dd class=\"ExtendedMetaItem SearchCommentBody\"><a href=\"./comments.php?DiscussionID=".$Comment->DiscussionID."&Focus=".$Comment->CommentID."#Comment_".$Comment->CommentID."\">".HighlightTrimmedString($Comment->Body, $HighlightWords, 300)."</a></dd> to <dd class=\"ExtendedMetaItem SearchCommentBody\"><a href=\"./comments.php?DiscussionID=".$Comment->DiscussionID."&page=". CalculateNumberOfPages($Discussion->CountComments, agCOMMENTS_PER_PAGE) ."&Focus=".$Comment->CommentID."#Comment_".$Comment->CommentID."\">".HighlightTrimmedString($Comment->Body, $HighlightWords, 300)."</a></dd> in this part I've added &page=". CalculateNumberOfPages($Discussion->CountComments, agCOMMENTS_PER_PAGE) ." I know agCOMMENTS_PER_PAGE is correct for number of comment per page, but $Discussion->CountComments obviously isn't. ... so tell me what needs to be changed for this to work? I know this isn't the cleanest coding, so post also if there is some better solution for this problem

Comments

  • Options
    MarkMark Vanilla Staff
    The Focus variable is supposed to keep redirecting pages until it hits the correct one. Making the page parameter unnecessary.

    I'm 99% sure this has been resolved in the new Vanilla.
  • Options
    edited April 2006
    well 0.9.2.6 version is installed, I guess that's the last one. I tried with multiple search terms.. some results are on 3rd, some on 9th page of topic, but links still open 1st comment of that topic. tried with firefox and IE, there wasn't any redirection
  • Options
    TreyTrey Charlotte NC New
    vanilla 0.9.3 (or vanilla 1? correct me if I'm wrong) is soon to be released to everyone so thats prolly the vanilla Mark is talking about. I believe he just has to write up somekind of updater script to transfer older versions to the new one.
  • Options
    hm ok... anybody else having this problem with current version? It's strange 'cause nobody mentioned this problem anywhere. At least I couldn't find that discussion
  • Options
    TreyTrey Charlotte NC New
    edited April 2006
    yeah, I just tested it on my vanilla (I have version 0.9.2.6 also) and it goes right to the first post instead of the page that the post was on.

    that is a weird bug =/ hopefully it is fixed with the newest version that will be out.
  • Options
    is there some variable or function I could use in library/Vanilla.Functions.php, inside GetCommentResult() function, that shows resulting comment number in that topic? for example, I searched some word and that word is 97th comment in some topic. Is there some variable/function that can give me that "97" data in this example? in that case, I could divide that number with number of posts per page, "upper" round it and get page # that I need
  • Options
    MarkMark Vanilla Staff
    It will be fixed for version 1. Don't worry about it too much.
  • Options
    Bump. It will be fixed for version 1 you say? :)
  • Options
    MarkMark Vanilla Staff
    I thought it was fixed. Do you have an example of it not working properly?
  • Options
    Well, I have a thread on my forum which is 80 pages long. When I search for a term which is contained in a post on the 30th page, and click on the result, it only shows the first page of the thread.
  • Options
    MarkMark Vanilla Staff
    Wierd. I've bookmarked this discussion and I'll double-check it in the source before the next minor upgrade.
  • Options
    Alrighty.
  • Options
    He's right you know.
  • Options
    edited July 2006
    Test case: http://lussumo.com/community/search/?PostBackAction=Search&Keywords=redimenssioner+&Type=Comments&btnSubmit=Search Should go to page 3, goes to page 1. (Uh, use the link that doesn't go to this thread :D)
  • Options
    yeah, that's what I'm talking about.

    (Uh, use the link that doesn't go to this thread :D)
    heheh :)
  • Options
    MarkMark Vanilla Staff
    I've fixed this bug.
  • Options
    It is updated in SVN or in the downloadable zip?
This discussion has been closed.