예제 #1
0
function xthreads_plugins_quickthread_install()
{
    if ($GLOBALS['codename'] != 'quickthread' || !$GLOBALS['install_uninstall']) {
        return;
    }
    xthreads_plugins_quickthread_tplmod();
}
예제 #2
0
     * ^ about same speed
     * select tid from mybb_threadfields_data tfd where not exists (select tid from mybb_threads t where t.tid=tfd.tid)
     * ^ a fair bit slower
     */
    $tids = '';
    while ($tid = $db->fetch_field($query, 'tid')) {
        $tids .= ($tids ? ',' : '') . $tid;
    }
    $db->free_result($query);
    if ($tids) {
        $db->delete_query('threadfields_data', 'tid IN (' . $tids . ')');
        require_once MYBB_ROOT . 'inc/xthreads/xt_modupdhooks.php';
        xthreads_rm_attach_query('tid IN (' . $tids . ')');
    }
    require_once MYBB_ROOT . 'inc/xthreads/xt_install.php';
    xthreads_plugins_quickthread_tplmod();
    $xt_forums_cache = $cache->read('xt_forums');
    if (!empty($xt_forums_cache)) {
        // remove old xt_forums cache if present
        xthreads_delete_datacache('xt_forums');
    }
}
if (XTHREADS_INSTALLED_VERSION < 1.45 && XTHREADS_INSTALLED_VERSION > 1.32) {
    // we'll fix up broken regexes in these versions if they exist
    // note that this does assume people haven't deliberately used bad regexes
    $db->update_query('threadfields', array('textmask' => $db->escape_string('^(https?)\\://([a-z0-9.\\-_]+)(/[^\\r\\n"<>&]*)?$')), 'textmask="' . $db->escape_string('^(https?)\\://([a-z.\\-_]+)(/[^\\r\\n"<>&]*)?$') . '"');
    $db->update_query('threadfields', array('textmask' => $db->escape_string('^([a-z0-9]+)\\://([a-z0-9.\\-_]+)(/[^\\r\\n"<>&]*)?$')), 'textmask="' . $db->escape_string('^([a-z0-9]+)\\://([a-z.\\-_]+)(/[^\\r\\n"<>&]*)?$') . '"');
}
if (XTHREADS_INSTALLED_VERSION < 1.5) {
    // template modification
    $tpl_threadfields_inputrow = $db->fetch_field($db->simple_select('templates', 'template', 'title="threadfields_inputrow" AND sid=-1'), 'template');