getDB()->getType(); $updater->addExtensionTable('isekai_user_daily_sign', $dir . $type . '/isekai_user_daily_sign.sql'); $updater->addExtensionTable('isekai_user_daily_sign_log', $dir . $type . '/isekai_user_daily_sign_log.sql'); $updater->addExtensionTable('isekai_user_points', $dir . $type . '/isekai_user_points.sql'); $updater->addExtensionTable('isekai_user_points_log', $dir . $type . '/isekai_user_points_log.sql'); } public static function onBeforePageDisplay(OutputPage $out, Skin $skin) { $config = MediaWikiServices::getInstance()->getMainConfig(); $out->addModuleStyles(['ext.isekai.userpoints.base']); $dailySignConfig = $config->get('IsekaiUserDailySignConfig'); if ($dailySignConfig) { $out->addModules(['ext.isekai.userpoints.dailysign']); } } public static function onGetPreferences(User $user, &$preferences) { $config = MediaWikiServices::getInstance()->getMainConfig(); if ($config->get('IsekaiUserPointShowOnUserPerferences')) { $userPointConfig = $config->get('IsekaiUserPointConfig'); /** @var \Isekai\UserPoints\Service\IsekaiUserPointsFactory */ $userPointsFactory = MediaWikiServices::getInstance()->getService('IsekaiUserPoints'); foreach ($userPointConfig as $pointType => $pointConfig) { $userPoints = $userPointsFactory->newFromUser($user, $pointType); $icon = Utils::getPointIcon($pointType); $name = Utils::getPointName($pointType); $language = MediaWikiServices::getInstance()->getContentLanguage(); $preferences['isekai-userpoints-' . $pointType] = [ 'type' => 'text', 'label-raw' => $icon . ' ' . $name, 'default' => $language->formatNum($userPoints->points), 'section' => 'personal/info', 'raw' => true, ]; } } } }