2009-09-25, 03:45 PM
I was just wondering what people thought about this - I found it when I was trying to fix a bug in a module...
In forumdisplay.php, the hook
...is slightly useless. The only reason why I can see that being there is to affect the $thread variable in the loop, and because it isn't passed into the hook, it really can't do anything. The only practical workaround is an str_replace, and if you have 50 threads in a display, then that takes it's toll.
It would be much, much, easier if the the hook was:
...just like the posts and PMs. What do people think?...
In forumdisplay.php, the hook
if(is_array($threadcache))
{
foreach($threadcache as $thread)
{
$plugins->run_hooks("forumdisplay_thread");
...is slightly useless. The only reason why I can see that being there is to affect the $thread variable in the loop, and because it isn't passed into the hook, it really can't do anything. The only practical workaround is an str_replace, and if you have 50 threads in a display, then that takes it's toll.
It would be much, much, easier if the the hook was:
$plugins->run_hooks_by_ref("forumdisplay_thread", $thread);
...just like the posts and PMs. What do people think?...