本文整理汇总了PHP中add_integration_function函数的典型用法代码示例。如果您正苦于以下问题:PHP add_integration_function函数的具体用法?PHP add_integration_function怎么用?PHP add_integration_function使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_integration_function函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadMenuButtonWithBoardsListHooks
/**
* Load all needed hooks
*/
function loadMenuButtonWithBoardsListHooks()
{
add_integration_function('integrate_admin_areas', 'addMenuButtonWithBoardsListAdminArea', false);
add_integration_function('integrate_modify_modifications', 'addMenuButtonWithBoardsListAdminAction', false);
add_integration_function('integrate_menu_buttons', 'addMenuButtonWithBoardsList', false);
add_integration_function('integrate_menu_buttons', 'addMenuButtonWithBoardsListCopyright', false);
}
开发者ID:realdigger,项目名称:SMF-Menu-Button-With-Boards-List,代码行数:10,代码来源:Mod-MenuButtonWithBoardsList.php
示例2: loadMathJaxHooks
/**
* Load all needed hooks
*/
function loadMathJaxHooks()
{
add_integration_function('integrate_load_theme', 'loadMathJaxJs', false);
add_integration_function('integrate_bbc_buttons', 'addMathJaxBbcButton', false);
add_integration_function('integrate_bbc_codes', 'addMathJaxBbcCode', false);
add_integration_function('integrate_menu_buttons', 'addMathJaxCopyright', false);
}
示例3: installIntegration
public function installIntegration($forumDirectoryPath)
{
try {
//Using SMF native functions
$smfSSI = DRUPAL_ROOT . '/' . $forumDirectoryPath . '/SSI.php';
if (file_exists($smfSSI)) {
require_once $smfSSI;
add_integration_function('integrate_pre_include', DRUPAL_ROOT . '/' . drupal_get_path('module', 'smfbridge') . '/src/Smf/Hooks.php');
add_integration_function('integrate_actions', 'Drupal\\smfbridge\\Smf\\Hooks::actions', TRUE);
add_integration_function('integrate_menu_buttons', 'Drupal\\smfbridge\\Smf\\Hooks::smfMenuButtons', TRUE);
//Use database driven sessions - on
$this->updateSmfSettingsValues('databaseSession_enable', '1');
/**
* @var \Drupal\Core\Session\SessionConfiguration $sessionConfiguration
*/
$sessionConfiguration = \Drupal::service('session_configuration');
$options = $sessionConfiguration->getOptions(\Drupal::request());
$this->updateSmfSettingsValues('databaseSession_lifetime', $options['gc_maxlifetime']);
} else {
throw new \Exception(t('Can\'t forum/SSI.php. Please, place SMF sources into DRUPAL_ROOT/forum folder.'));
}
return TRUE;
} catch (\Exception $e) {
$errorMsg = t('Error while enabling smfbridge. @message', ['@message' => $e->getMessage()]);
\Drupal::logger('smfbridge')->error($errorMsg);
drupal_set_message($errorMsg, 'error');
return FALSE;
}
}
示例4: testAddHooks
/**
* Tests adding hooks in some different ways
*/
function testAddHooks()
{
global $modSettings;
foreach ($this->_tests as $test) {
add_integration_function($this->_hook_name, $test['call'], $test['file'], $test['perm']);
$this->assertTrue($this->_hook_exists($test, $test['perm']));
}
}
示例5: loadLegacyKarmaHooks
/**
* Load all needed hooks
*/
function loadLegacyKarmaHooks()
{
global $modSettings;
add_integration_function('integrate_general_mod_settings', 'changeLegacyKarmaSettings', false);
add_integration_function('integrate_menu_buttons', 'addLegacyKarmaCopyright', false);
if (empty($modSettings['legacy_karma_enabled'])) {
return;
}
add_integration_function('integrate_menu_buttons', 'printLegacyKarmaForMember', false);
//add_integration_function('integrate_query_message', 'showLegacyKarmaInMessage', false);
// TODO calculate summary likes and show it or sum with legacy
}
示例6: reloadSettings
/**
* Load the $modSettings array and many necessary forum settings.
*
* What it does:
* - load the settings from cache if available, otherwse from the database.
* - sets the timezone
* - checks the load average settings if available.
* - check whether post moderation is enabled.
* - calls add_integration_function
* - calls integrate_pre_include, integrate_pre_load,
*
* @global array $modSettings is a giant array of all of the forum-wide settings and statistics.
*/
function reloadSettings()
{
global $modSettings;
$db = database();
// Try to load it from the cache first; it'll never get cached if the setting is off.
if (($modSettings = cache_get_data('modSettings', 90)) == null) {
$request = $db->query('', '
SELECT variable, value
FROM {db_prefix}settings', array());
$modSettings = array();
if (!$request) {
display_db_error();
}
while ($row = $db->fetch_row($request)) {
$modSettings[$row[0]] = $row[1];
}
$db->free_result($request);
// Do a few things to protect against missing settings or settings with invalid values...
if (empty($modSettings['defaultMaxTopics']) || $modSettings['defaultMaxTopics'] <= 0 || $modSettings['defaultMaxTopics'] > 999) {
$modSettings['defaultMaxTopics'] = 20;
}
if (empty($modSettings['defaultMaxMessages']) || $modSettings['defaultMaxMessages'] <= 0 || $modSettings['defaultMaxMessages'] > 999) {
$modSettings['defaultMaxMessages'] = 15;
}
if (empty($modSettings['defaultMaxMembers']) || $modSettings['defaultMaxMembers'] <= 0 || $modSettings['defaultMaxMembers'] > 999) {
$modSettings['defaultMaxMembers'] = 30;
}
if (empty($modSettings['subject_length'])) {
$modSettings['subject_length'] = 24;
}
$modSettings['warning_enable'] = $modSettings['warning_settings'][0];
if (!empty($modSettings['cache_enable'])) {
cache_put_data('modSettings', $modSettings, 90);
}
}
// Setting the timezone is a requirement for some functions in PHP >= 5.1.
if (isset($modSettings['default_timezone'])) {
date_default_timezone_set($modSettings['default_timezone']);
}
// Check the load averages?
if (!empty($modSettings['loadavg_enable'])) {
if (($modSettings['load_average'] = cache_get_data('loadavg', 90)) == null) {
$modSettings['load_average'] = detectServerLoad();
cache_put_data('loadavg', $modSettings['load_average'], 90);
}
if ($modSettings['load_average'] !== false) {
call_integration_hook('integrate_load_average', array($modSettings['load_average']));
}
// Let's have at least a zero
if (empty($modSettings['loadavg_forum']) || $modSettings['load_average'] === false) {
$modSettings['current_load'] = 0;
} else {
$modSettings['current_load'] = $modSettings['load_average'];
}
if (!empty($modSettings['loadavg_forum']) && $modSettings['current_load'] >= $modSettings['loadavg_forum']) {
display_loadavg_error();
}
} else {
$modSettings['current_load'] = 0;
}
// Is post moderation alive and well?
$modSettings['postmod_active'] = isset($modSettings['admin_features']) ? in_array('pm', explode(',', $modSettings['admin_features'])) : true;
// Here to justify the name of this function. :P
// It should be added to the install and upgrade scripts.
// But since the convertors need to be updated also. This is easier.
if (empty($modSettings['currentAttachmentUploadDir'])) {
updateSettings(array('attachmentUploadDir' => serialize(array(1 => $modSettings['attachmentUploadDir'])), 'currentAttachmentUploadDir' => 1));
}
// Integration is cool.
if (defined('ELK_INTEGRATION_SETTINGS')) {
$integration_settings = unserialize(ELK_INTEGRATION_SETTINGS);
foreach ($integration_settings as $hook => $function) {
add_integration_function($hook, $function);
}
}
// Any files to pre include?
call_integration_include_hook('integrate_pre_include');
// Call pre load integration functions.
call_integration_hook('integrate_pre_load');
}
示例7: array
$found['id'] = $row['id_install'];
$found['themes'] = $row['themes_installed'];
}
$smcFunc['db_free_result']($request);
if (!empty($found['id'])) {
$smcFunc['db_query']('', '
UPDATE {db_prefix}log_packages
SET package_id = {string:pkgid}, db_changes = {string:dbchg},' . (!empty($found['themes']) ? ' themes_installed = {string:thchg},' : '') . ' install_state = 1
WHERE id_install = {int:id}', array('id' => $found['id'], 'pkgid' => 'portamx_corp:PortaMx', 'thchg' => !empty($found['themes']) ? $found['themes'] : '', 'dbchg' => serialize($dbupdates)));
}
}
// setup all the hooks we use
_dbinst_write($newline . 'Setup integration functions.' . $newline);
$hooklist = array('integrate_pre_include' => '$sourcedir/PortaMx/PortaMxLoader.php', 'integrate_buffer' => 'ob_portamx', 'integrate_actions' => 'PortaMx_Actions', 'integrate_admin_areas' => 'PortaMx_AdminMenu', 'integrate_dynamic_buttons' => 'PortaMx_MenuContext', 'integrate_whos_online' => 'PortaMx_whos_online', 'integrate_load_theme' => 'pmx_eclnonemodal', 'integrate_pre_css_output' => 'PortaMx_loadCSS');
foreach ($hooklist as $hook => $function) {
add_integration_function($hook, $function, true, '', false);
}
// update pmxsef settings
_dbinst_write('Setup SEF settings.' . $newline);
$sefsettings = array('pmxsef_autosave' => '0', 'pmxsef_singletoken' => 'add,advanced,all,asc,calendar,check,children,conversation,desc,home,image,kstart,moderate,nw,profile,save,sound,togglebar,topicseen,view,viewweek,xml', 'pmxsef_actions' => 'about:mozilla,about:unknown,activate,announce,attachapprove,buddy,calendar,clock,collapse,community,coppa,credits,deletemsg,display,dlattach,editpoll,editpoll2,emailuser,findmember,groups,help,helpadmin,im,jseditor,jsmodify,jsoption,keepalive,lock,lockvoting,login,login2,logout,markasread,mergetopics,mlist,moderate,modifycat,modifykarma,movetopic,movetopic2,notify,notifyboard,openidreturn,pm,post,post2,printpage,profile,promote,quotefast,quickmod,quickmod2,recent,register,register2,reminder,removepoll,removetopic2,reporttm,requestmembers,restoretopic,search,search2,sendtopic,smstats,suggest,spellcheck,splittopics,stats,sticky,trackip,unread,unreadreplies,verificationcode,viewprofile,vote,viewquery,viewsmfile,who,.xml,xmlhttp,theme,notifytopic,likes,signup,loadeditorlocale,xml', 'pmxsef_ignoreactions' => '', 'pmxsef_aliasactions' => serialize(array()), 'pmxsef_ignorerequests' => serialize(array()), 'pmxsef_codepages' => '/PortaMx/sefcodepages/x');
foreach ($sefsettings as $sefname => $value) {
$smcFunc['db_insert']('replace', '
{db_prefix}settings', array('variable' => 'string', 'value' => 'string'), array($sefname, $value), array('variable'));
}
// other settings
_dbinst_write('Setup global settings.' . $newline);
$othersettings = array('pmx_ecl' => '0', 'pmx_eclmodal' => '0', 'pmx_eclmodalaction' => 'calendar,markasread,mlist,search,search2,stats,who,post', 'pmx_eclmodalmobi' => '0', 'pmx_eclmodaltop' => '32', 'pmx_frontmode' => '1', 'pmx_fronttheme' => '0', 'pmx_frontthempg' => '0');
foreach ($othersettings as $name => $value) {
$smcFunc['db_insert']('replace', '
{db_prefix}settings', array('variable' => 'string', 'value' => 'string'), array($name, $value), array('variable'));
}
示例8: add_integration_function
<?php
add_integration_function('integrate_load_theme', 'cleantalk_load');
// flush settings cache
cache_put_data('modSettings', null, 1);
示例9: integrate_chars
function integrate_chars()
{
global $user_info, $user_settings, $txt, $modSettings;
$user_info += ['id_character' => isset($user_settings['id_character']) ? (int) $user_settings['id_character'] : 0, 'character_name' => isset($user_settings['character_name']) ? $user_settings['character_name'] : (isset($user_settings['real_name']) ? $user_settings['real_name'] : ''), 'char_avatar' => isset($user_settings['char_avatar']) ? $user_settings['char_avatar'] : '', 'char_signature' => isset($user_settings['char_signature']) ? $user_settings['char_signature'] : '', 'char_is_main' => !empty($user_settings['is_main']), 'immersive_mode' => !empty($user_settings['immersive_mode'])];
// Because we're messing with member groups, we need to tweak a few things.
// We need to glue their groups together for the purposes of permissions.
// But we also need to consider whether they're in immersive mode or not
// to recalculate board access.
$original_groups = $user_info['groups'];
$with_char_groups = $user_info['groups'];
if (!empty($user_settings['main_char_group'])) {
$with_char_groups[] = $user_settings['main_char_group'];
}
if (!empty($user_settings['char_groups'])) {
$with_char_groups = array_merge($with_char_groups, array_diff(array_map('intval', explode(',', $user_settings['char_groups'])), [0]));
}
// At this point, we already built access based on account level groups
// but if we're in immersive mode we need to include character groups
// - unless admin, because admin implicitly has everything anyway.
if ($user_info['immersive_mode'] && !$user_info['is_admin']) {
$user_info['original_query_see_board'] = $user_info['query_see_board'];
$user_info['original_query_wanna_see_board'] = $user_info['query_wanna_see_board'];
$user_info['query_see_board'] = '((FIND_IN_SET(' . implode(', b.member_groups) != 0 OR FIND_IN_SET(', $with_char_groups) . ', b.member_groups) != 0)' . (!empty($modSettings['deny_boards_access']) ? ' AND (FIND_IN_SET(' . implode(', b.deny_member_groups) = 0 AND FIND_IN_SET(', $with_char_groups) . ', b.deny_member_groups) = 0)' : '') . (isset($user_info['mod_cache']) ? ' OR ' . $user_info['mod_cache']['mq'] : '') . ')';
if (empty($user_info['ignoreboards'])) {
$user_info['query_wanna_see_board'] = $user_info['query_see_board'];
} else {
$user_info['query_wanna_see_board'] = '(' . $user_info['query_see_board'] . ' AND b.id_board NOT IN (' . implode(',', $user_info['ignoreboards']) . '))';
}
}
// And now glue account plus current character together for permissions.
$user_info['groups'] = $with_char_groups;
// And since this is now done early in the process, but after language is identified...
loadLanguage('characters/Characters');
// We can now also hook the rest of the characters stuff, meaning we
// only need to remember and manage one hook in the installer.
add_integration_function('integrate_buffer', 'integrate_chars_buffer', false);
add_integration_function('integrate_pre_profile_areas', 'chars_profile_menu', false, '$sourcedir/Profile-Chars.php');
add_integration_function('integrate_admin_areas', 'integrate_chars_admin_actions', false, '$sourcedir/Admin-Chars.php');
add_integration_function('integrate_load_profile_fields', 'chars_profile_field', false, '$sourcedir/Profile-Chars.php');
add_integration_function('integrate_autosuggest', 'integrate_character_autosuggest', false, '$sourcedir/AutoSuggest-Chars.php');
add_integration_function('integrate_menu_buttons', 'integrate_chars_main_menu', false);
add_integration_function('integrate_query_message', 'integrate_get_chars_messages', false);
add_integration_function('integrate_prepare_display_context', 'integrate_display_chars_messages', false);
add_integration_function('integrate_create_post', 'integrate_create_post_character', false);
add_integration_function('integrate_load_member_data', 'integrate_load_member_data_chars', false);
add_integration_function('integrate_member_context', 'integrate_membercontext_chars', false);
add_integration_function('integrate_after_create_post', 'integrate_character_post_count', false);
add_integration_function('integrate_load_permissions', 'integrate_chars_permissions', false, '$sourcedir/Admin-Chars.php');
add_integration_function('integrate_create_board', 'integrate_chars_create_board', false, '$sourcedir/Admin-Chars.php');
add_integration_function('integrate_message_index', 'integrate_message_index_chars', false);
add_integration_function('integrate_display_topic', 'integrate_display_topic_chars', false);
add_integration_function('integrate_search_message_context', 'integrate_search_message_chars', false);
add_integration_function('integrate_actions', 'integrate_chars_actions', false);
add_integration_function('integrate_delete_members', 'integrate_delete_members_chars', false, '$sourcedir/Admin-Chars.php');
add_integration_function('integrate_register_check', 'integrate_register_check_chars', false);
add_integration_function('integrate_register', 'integrate_register_chars', false);
add_integration_function('integrate_post_register', 'integrate_post_register_chars', false);
add_integration_function('integrate_change_member_data', 'integrate_chars_change_member_data', false);
}
示例10: action_install2
//.........这里部分代码省略.........
$failed_count = 0;
foreach ($install_log as $action) {
$failed_count++;
if ($action['type'] == 'modification' && !empty($action['filename'])) {
if ($action['boardmod']) {
$mod_actions = parseBoardMod(file_get_contents(BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename']), false, $action['reverse'], $theme_paths);
} else {
$mod_actions = parseModification(file_get_contents(BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename']), false, $action['reverse'], $theme_paths);
}
// Any errors worth noting?
foreach ($mod_actions as $key => $action) {
if ($action['type'] == 'failure') {
$failed_steps[] = array('file' => $action['filename'], 'large_step' => $failed_count, 'sub_step' => $key, 'theme' => 1);
}
// Gather the themes we installed into.
if (!empty($action['is_custom'])) {
$themes_installed[] = $action['is_custom'];
}
}
} elseif ($action['type'] == 'code' && !empty($action['filename'])) {
// This is just here as reference for what is available.
global $txt, $modSettings, $context;
// Now include the file and be done with it ;).
if (file_exists(BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename'])) {
require BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename'];
}
} elseif ($action['type'] == 'credits') {
// Time to build the billboard
$credits_tag = array('url' => $action['url'], 'license' => $action['license'], 'copyright' => $action['copyright'], 'title' => $action['title']);
} elseif ($action['type'] == 'hook' && isset($action['hook'], $action['function'])) {
if ($action['reverse']) {
remove_integration_function($action['hook'], $action['function'], $action['include_file']);
} else {
add_integration_function($action['hook'], $action['function'], $action['include_file']);
}
} elseif ($action['type'] == 'database' && !empty($action['filename']) && (!$context['uninstalling'] || !empty($_POST['do_db_changes']))) {
// These can also be there for database changes.
global $txt, $modSettings, $context;
// Let the file work its magic ;)
if (file_exists(BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename'])) {
require BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename'];
}
} elseif ($action['type'] == 'redirect' && !empty($action['redirect_url'])) {
$context['redirect_url'] = $action['redirect_url'];
$context['redirect_text'] = !empty($action['filename']) && file_exists(BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename']) ? file_get_contents(BOARDDIR . '/packages/temp/' . $context['base_path'] . $action['filename']) : ($context['uninstalling'] ? $txt['package_uninstall_done'] : $txt['package_installed_done']);
$context['redirect_timeout'] = $action['redirect_timeout'];
// Parse out a couple of common urls.
$urls = array('$boardurl' => $boardurl, '$scripturl' => $scripturl, '$session_var' => $context['session_var'], '$session_id' => $context['session_id']);
$context['redirect_url'] = strtr($context['redirect_url'], $urls);
}
}
package_flush_cache();
// First, ensure this change doesn't get removed by putting a stake in the ground (So to speak).
package_put_contents(BOARDDIR . '/packages/installed.list', time());
// See if this is already installed
$is_upgrade = false;
$old_db_changes = array();
$package_check = isPackageInstalled($packageInfo['id']);
// Change the installed state as required.
if (!empty($package_check['install_state'])) {
if ($context['uninstalling']) {
setPackageState($package_check['package_id']);
} else {
// not uninstalling so must be an upgrade
$is_upgrade = true;
$old_db_changes = empty($package_check['db_changes']) ? array() : $package_check['db_changes'];
示例11: foreach
ALTER TABLE ' . $table['table_name'] . '
ADD FULLTEXT {raw:index} ({raw:index})', ['index' => $index]);
}
}
}
// Create new rows, if any
foreach ($rows as $row) {
$smcFunc['db_insert']($row['method'], $row['table_name'], $row['columns'], $row['data'], $row['keys']);
}
// Create new columns, if any
foreach ($columns as $column) {
$smcFunc['db_add_column']($column['table_name'], $column['column_info'], $column['parameters'], $column['if_exists'], $column['error']);
}
// Add integration hooks, if any
foreach ($hooks as $hook) {
add_integration_function($hook['hook'], $hook['function'], $hook['perm'], !empty($hook['file']) ? $hook['file'] : '');
}
// Create characters if an account doesn't have characters
$insert_rows = [];
$result = $smcFunc['db_query']('', '
SELECT mem.id_member, mem.real_name, COUNT(id_character) AS count
FROM {db_prefix}members AS mem
LEFT JOIN {db_prefix}characters AS chars ON (mem.id_member = chars.id_member)
GROUP BY mem.id_member HAVING count = 0');
while ($row = $smcFunc['db_fetch_assoc']($result)) {
$insert_rows[] = [$row['id_member'], $row['real_name'], '', '', 0, 0, '', time(), 0, 1, 0, ''];
}
$smcFunc['db_free_result']($result);
if (!empty($insert_rows)) {
foreach ($insert_rows as $new_row) {
$smcFunc['db_insert']('insert', '{db_prefix}characters', ['id_member' => 'int', 'character_name' => 'string', 'avatar' => 'string', 'signature' => 'string', 'id_theme' => 'int', 'posts' => 'int', 'age' => 'string', 'date_created' => 'int', 'last_active' => 'int', 'is_main' => 'int', 'main_char_group' => 'int', 'char_groups' => 'string'], $new_row, []);
示例12: installHooks
/**
* Installs the hooks to be used by this module.
*/
public function installHooks()
{
foreach ($this->hooks as $hook) {
add_integration_function($hook, __CLASS__ . '::handleHook', $this->persistHooks);
}
}
示例13: add_integration_function
<?php
if (!defined('SMF')) {
require_once 'SSI.php';
}
add_integration_function('integrate_pre_include', '$sourcedir/og.php');
add_integration_function('integrate_bbc_codes', 'og_bbc');
add_integration_function('integrate_modify_modifications', 'og_admin');
add_integration_function('integrate_admin_areas', 'og_admin_areas');
$smcFunc['db_query']('', "INSERT INTO {db_prefix}scheduled_tasks (time_offset, time_regularity, time_unit, disabled, task) VALUES ('0', '1', 'w', '0', 'og_prune')");
示例14: list
FROM {db_prefix}arcade_categories');
list($count) = $smcFunc['db_fetch_row']($request);
$smcFunc['db_free_result']($request);
if ($count == 0 || $forced) {
$smcFunc['db_insert']('insert', '{db_prefix}arcade_categories', array('cat_name' => 'string', 'member_groups' => 'string', 'cat_order' => 'int'), array('Default', '-2,-1,0,1,2', 1), array('id_cat'));
}
// Step 8: Update Arcade Version in Database
updateSettings(array('arcadeVersion' => $arcade_version));
// Step 9: Hooks
add_integration_function('integrate_pre_include', '$sourcedir/ArcadeHooks.php');
add_integration_function('integrate_actions', 'Arcade_actions');
add_integration_function('integrate_core_features', 'Arcade_core_features');
add_integration_function('integrate_load_permissions', 'Arcade_load_permissions');
add_integration_function('integrate_profile_areas', 'Arcade_profile_areas');
add_integration_function('integrate_menu_buttons', 'Arcade_menu_buttons');
add_integration_function('integrate_admin_areas', 'Arcade_admin_areas');
function doRenameTables()
{
global $smcFunc, $db_prefix, $db_type;
if ($db_type != 'mysql') {
return;
}
$tables = $smcFunc['db_list_tables']();
// Detect eeks mod from unique table name
if (in_array($db_prefix . 'arcade_shouts', $tables)) {
$tables = array('arcade_games' => 'earcade_games', 'arcade_personalbest' => 'earcade_personalbest', 'arcade_scores' => 'earcade_scores', 'arcade_categories' => 'earcade_categories', 'arcade_favorite' => 'earcade_favorite', 'arcade_rates' => 'earcade_rates', 'arcade_settings' => 'earcade_settings', 'arcade_v3temp' => 'earcade_v3temp', 'arcade_shouts' => 'earcade_shouts', 'arcade_tournament_rounds' => 'earcade_tournament_rounds', 'arcade_tournament_players' => 'earcade_tournament_players', 'arcade_tournament_scores' => 'earcade_tournament_scores', 'arcade_tournament' => 'earcade_tournament');
foreach ($tables as $old => $new) {
// Drop old copies of earcade tables if exists
$smcFunc['db_query']('', '
DROP TABLE IF EXISTS {db_prefix}{raw:new}', array('old' => $old, 'new' => $new));
$smcFunc['db_query']('', '
示例15: smfAddHooks
/**
* * Add integration functions to SMF
*/
public function smfAddHooks()
{
global $modSettings;
$controller = $this->config['corePath'] . 'controllers/smf-include.php';
/**@var array $modSettings */
if (empty($modSettings['integrate_pre_include']) || $modSettings['integrate_pre_include'] != $controller) {
if (!function_exists('add_integration_function')) {
$smfPath = $this->config['smfPath'];
/** @noinspection PhpIncludeInspection */
require $smfPath . 'Sources/Subs.php';
/** @noinspection PhpIncludeInspection */
require $smfPath . 'Sources/Load.php';
}
$hooks = $this->_smfHooks;
$hooks['integrate_pre_include'] = $controller;
foreach ($hooks as $hook => $value) {
if (!empty($modSettings[$hook])) {
$tmp = explode(',', $modSettings[$hook]);
foreach ($tmp as $v) {
remove_integration_function($hook, $v);
}
}
add_integration_function($hook, $value);
}
}
}