function step_21($data = null) { /* * Can't display checkbox options in the cli without a lot of mess so just skip */ if ($this->caller == 'cli') { $this->skip_message(); } else { if ($data['htmlsubmit']) { require_once DIR . '/includes/class_bootstrap_framework.php'; vB_Bootstrap_Framework::init('../'); $expire = intval($data['htmldata']['expire']); if ($expire > 180) { $expire = 180; } if ($expire < 1) { $expire = 1; } vB::$vbulletin->options['as_expire'] = $expire; unset($data['htmldata']['expire']); $this->db->query_write("\n\t\t\t\tUPDATE " . TABLE_PREFIX . "activitystreamtype\n\t\t\t\tSET enabled = 0\n\t\t\t"); foreach (array_keys($data['htmldata']) as $type) { $values = explode('_', $type); $section = $values[0]; $type = $values[1]; $this->db->query_write("\n\t\t\t\t\tUPDATE " . TABLE_PREFIX . "activitystreamtype\n\t\t\t\t\tSET enabled = 1\n\t\t\t\t\tWHERE\n\t\t\t\t\t\tsection = '{$section}'\n\t\t\t\t\t\t\tAND\n\t\t\t\t\t\ttype = '{$type}'\n\t\t\t\t"); vB::$vbulletin->options['as_content'] = vB::$vbulletin->options['as_content'] | vB::$vbulletin->bf_misc_ascontent[$type]; } build_activitystream_datastore(); vB_ActivityStream_Manage::rebuild(); // build_options() is executed after each version step of the upgrade so this will be processed before the final settings import $this->run_query(sprintf($this->phrase['vbphrase']['update_table'], TABLE_PREFIX . "setting"), "REPLACE INTO " . TABLE_PREFIX . "setting\n\t\t\t\t\t(varname, value, grouptitle, defaultvalue, optioncode, displayorder, volatile, datatype, product)\n\t\t\t\tVALUES\n\t\t\t\t\t('as_expire', {$expire}, 'activitystream', '30', '', 10, 1, 'number', 'vbulletin')\n\t\t\t"); } else { $row = $this->db->query_first("\n\t\t\t\tSELECT COUNT(*) AS count\n\t\t\t\tFROM " . TABLE_PREFIX . "activitystream\n\t\t\t"); if ($row['count'] == 0) { return $this->asform(); } else { $this->skip_message(); } } } }
print_cp_header($vbphrase['clear_system_cache']); vB_Cache::instance()->clean(false); print_cp_message($vbphrase['cache_cleared']); } else { print_cp_header($vbphrase['maintenance']); } // ###################### Clear Autosave option ####################### if ($_REQUEST['do'] == 'clearauto') { print_form_header('misc', 'doclearauto'); print_table_header($vbphrase['clear_autosave_title']); print_description_row($vbphrase['clear_autosave_desc']); print_input_row($vbphrase['clear_autosave_limit'], 'cleandays', 21); print_submit_row($vbphrase['clear_autosave_run']); } if ($_POST['do'] == 'rebuildactivity') { vB_ActivityStream_Manage::rebuild(); vB_ActivityStream_Manage::updateScores(); print_stop_message('rebuild_activity_stream_done'); } if ($_POST['do'] == 'doclearauto') { $vbulletin->input->clean_array_gpc('p', array('cleandays' => TYPE_UINT)); if ($vbulletin->GPC['cleandays'] < 7) { print_stop_message('clear_autosave_toolow'); } // Clear out the actual autosave entries $cleandate = TIMENOW - $vbulletin->GPC['cleandays'] * 86400; $vbulletin->db->query_write("DELETE FROM " . TABLE_PREFIX . "autosave WHERE dateline < {$cleandate}"); print_stop_message('clear_autosave_done'); } // ###################### Rebuild all style info ####################### if ($_POST['do'] == 'rebuildstyles') {