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.
HotThreads page navigation not working
Hi..
setup HotThreads plugin..
Vanilla=Version 2.0.18.11
HotThreads=Version' => '14.01.24'
Everything ok expect HotThreads page navigation..It's not showing any page navigation bottom of the hotthreads discussions page..
any help
0
Comments
Most probably, you don't have enough "hot discussions" to fill more than one page. If you want to check how many discussions are fetched, you can have a look at the
HotThreadsPlugin::ShowHotThreads()
method. From the code documentation for such method:Renders the Hot Threads page.
This method is an almost exact copy of
DiscussionController::Index()
, with the exception that it doesn't load Announcements. Also, it loads only Discussions with a certain amount of Views or CommentsMy shop | About Me
i could confirm it has enough hot thread to display.because when i change following code it's give me navigation menu(but load same page result on every page navigation pages)
change code
$Sender->DiscussionData = $DiscussionModel->Get($Page, $Limit);
to
$Sender->DiscussionData = $DiscussionModel->Get($Page, 100);
i check another site that using hot thread plugin..That site also has same problem..(loading first page result on every page navigation pages)
didn't know about it..i will check both php files..
for some reason your code Offset will not increment when go to second page..may be Offset mix with limit values.
DiscussionController using below equation to calculate
Offset = floor($CountCommentWatch / $Limit) * $Limit;
but i didn't see such a calculation on your code... haven't code for use $CountDiscussions to calculate Offset value
could u kindly check again using u test development site
@VanillaFan I will take note of this and have a look at it, but I can't say when, as I'm working on different projects at the moment (I look after the free plugins on this site on a "spare time" basis, and I have no spare time these days).
Please note that the code you looked at does calculate the offset, it just calls it
$Page
. First line ofHotThreadsPlugin::ShowHotThreads()
:Note: if anyone is willing to contribute to the plugin development, the Github repository is https://github.com/daigo75/vanilla-hotthreads (there's a link also on the plugin page).
My shop | About Me
wrong,after spend several hours i discovered it was
DiscussionsController::Index()
able to identify reason for not showing page numbers..It was Wrong Discussion Count
Need to get Discussion Count before below code
$this->DiscussionData = $DiscussionModel->Get($Page, $Limit);
current code Discussion Count will be generate using above result,that should be wrong..(it always give limit result as total count )
To test set $CountDiscussions to fix value and page navigation numbers back
But all pages loading same first results
So i guess their has another bug combined with Offset..
I try to fix those bugs..but unable to do that
if someone going fix those bugs hope this tip will be help
Tip:-
use following sql code to get total hot discussions
assign ablove total count to
Well spotted. A small "s" makes a big difference. This is the reason why I tend to avoid variables, classes and methods with similar names (singular/plural), I confuse them way too often.
Regarding the pager, I was actually tempted to remove it altogether and put a cap to the amount of retrieved discussions. The purpose of the Hot Threads plugin is to display the "top X hot discussions", but not the "top 150.000 hot discussions". Having too many in the list would defeat the purpose of the plugin, as one could simply go to one of the many discussions lists to see them all, if needed.
My shop | About Me
Uploaded a fix for the bug. I don't have time to test it properly, so be careful.
My shop | About Me
Now page navigation back Thank you very much..even if u are busy, u help me,i appreciate your help
as i previously mention their has another bug...Even if u click second page it's load first page result..i try to debug and here what i found
debug code for first page
debug code for second page
For work as excepted page navigation and result
First page code should be
Second page code should be
As above images,Get method first parameter not increment when visit second page..
hope this explain will help others to identify above problem.. when u have free time ,u could get some fun fixing bugs
Hurreyyyyyyyyyyyyy
Able to identify problem and fix it
Remove code
Change following Code
to
How about adding $Args to the arguments?
Before:
After:
wow,That solutions better than my solution Thank you very much
Not sure, but I think Netbeans would have pointed out that the function is using an undeclared variable and thus made it quite easy to find the solution. Those are the benefits of a full blown IDE
I actually do use a full blown IDE, but it doesn't report this kind of things. Not a big fan of Netbeans, though.
My shop | About Me