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.
search results with pages
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
0
This discussion has been closed.
Comments
I'm 99% sure this has been resolved in the new Vanilla.
that is a weird bug =/ hopefully it is fixed with the newest version that will be out.
(Uh, use the link that doesn't go to this thread )
heheh