Lack of interest New Code Event: template_pre_fetch

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Chris D

XenForo developer
Staff member
PHP:
    /**
    * Goes to the data source to load the list of templates.
    *
    * @param array Template list
    *
    * @return array Key-value pairs of template titles/compiled templates
    */
    protected function _getTemplatesFromDataSource(array $templateList)
    {
        XenForo_CodeEvent::fire('template_pre_fetch', array(&$templateList, $this));

        $db = XenForo_Application::getDb();

        return $db->fetchPairs('
            SELECT title, template_compiled
            FROM xf_template_compiled
            WHERE title IN (' . $db->quote($templateList) . ')
                AND style_id = ?
                AND language_id = ?
        ', array(self::$_styleId, self::$_languageId));
    }
This is actually pretty similar to the already existing template_create code event, except this happens only once per page load and $templateList represents a final list of templates to be fetched.
 
Upvote 0
This suggestion has been closed. Votes are no longer accepted.
Back
Top Bottom