function xthreads_forumdisplay_quickthread() { $tpl =& $GLOBALS['templates']->cache['forumdisplay_quick_thread']; if (xthreads_empty($tpl)) { return; } // grab fields $edit_fields = $GLOBALS['threadfield_cache']; // will be set // filter out non required fields (don't need to filter out un-editable fields as editable by all implies this) foreach ($edit_fields as $k => &$v) { if (!empty($v['editable_gids']) || $v['editable'] != XTHREADS_EDITABLE_REQ) { unset($edit_fields[$k]); } } if (empty($edit_fields)) { return; } require_once MYBB_ROOT . 'inc/xthreads/xt_updatehooks.php'; $blank = array(); xthreads_input_generate($blank, $edit_fields, $GLOBALS['fid']); if (!strpos($tpl, 'enctype="multipart/form-data"')) { $tpl = str_replace('<form method="post" ', '<form method="post" enctype="multipart/form-data" ', $tpl); } //$tpl = preg_replace('~(\<tbody.*?\<tr\>.*?)(\<tr\>)~is', '$1'.strtr($GLOBALS['extra_threadfields'], array('\\' => '\\\\', '$' => '\\$')).'$2', $tpl, 1); }
function _xthreads_input_generate(&$data, $fid, $tid = 0) { global $threadfield_cache; if (!isset($threadfield_cache)) { $threadfield_cache = xthreads_gettfcache($fid); } xthreads_filter_tfeditable($threadfield_cache, $fid); // NOTE: modifies the global tfcache! xthreads_input_generate($data, $threadfield_cache, $fid, $tid); }