Ok I think I worked out why the extra queries. The moderator bar and navigation templates are not being preloaded, so I made the following change to template.php:
Code:
case 'PAGE_CONTAINER':
$template->preloadTemplate('scheduled_post_navigation_tabs');
$template->preloadTemplate('scheduled_post_moderator_bar');
break;
I then noticed that the query for grabbing the scheduled post count is being run twice so I made the following changes:
I added to the top of template.php just above the template_hook function:
Code:
private static $countScheduleds = null;
Then made the following change to the three instances of code which grab the count:
Code:
$conditions = array(
'scheduled_date' => array(">", XenForo_Application::$time)
);
if(is_null(self::$countScheduleds)) {
self::$countScheduleds = $scheduledModel->countScheduleds($conditions);
}
$params += array(
'viewScheduled' => $scheduledModel->viewScheduledPage(),
'totalScheduledPosts' => self::$countScheduleds
);
I can send you the file to see the changes I made if it is easier, makes the add-on more query friendly
I have not been able to figure out why the threads are not being marked as read yet though.