• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 2.0 Extended prepareThread in XF1.5, what in XF2


Active member
I've created a custom thread URL field and adding/editing it is working.

My issue was that in 1.5 I extended the prepareThread to include link proxy.

But can't seem to find an alternative place within XF2.

Any tips?

if ($thread['external_url'])
                                       if (!empty(XenForo_Application::get('options')->imageLinkProxy['links']))
                        $hash = hash_hmac('md5', $thread['external_url'],
                        XenForo_Application::getConfig()->globalSalt . XenForo_Application::getOptions()->imageLinkProxyKey    );

                        $thread['external_url_proxy'] =  'proxy.php?' . 'link' . '=' . urlencode($thread['external_url']) . '&hash=' . $hash;

Chris D

XenForo developer
Staff member
This would be a good candidate for extending the entity itself and adding a "getter".

You could add a getter called external_url_proxy to the Thread entity structure, and so if you were to access {$thread.external_url_proxy} in a template or similar then that would try to call a getExternalUrlProxy() method on the entity; that would be where your equivalent code would be.