Last active
October 10, 2018 06:22
-
-
Save GerB/d87e1a52903f45d0bdcc063ed6d0366f to your computer and use it in GitHub Desktop.
Reset phpBB style to proSilver
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Set prosilver as default style and override user style | |
* @author GerB | |
* @license http://opensource.org/licenses/gpl-license.php GNU Public License | |
*/ | |
/** | |
* @ignore | |
*/ | |
define('IN_PHPBB', true); | |
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; | |
$phpEx = substr(strrchr(__FILE__, '.'), 1); | |
include($phpbb_root_path . 'common.' . $phpEx); | |
include($phpbb_root_path . 'includes/functions_user.' . $phpEx); | |
// Start session management | |
$user->session_begin(); | |
$auth->acl($user->data); | |
$user->setup(); | |
/* | |
if ($user->data['user_type'] != USER_FOUNDER) | |
{ | |
trigger_error('U moet een beheerder zijn om dit script te kunnen draaien'); | |
} | |
*/ | |
$sql = 'SELECT style_id | |
FROM ' . STYLES_TABLE . " | |
WHERE style_path = 'prosilver'"; | |
$result = $db->sql_query($sql); | |
$style = $db->sql_fetchrow($result); | |
$sql2 = 'UPDATE ' . CONFIG_TABLE . " SET config_value = " . (int) $style['style_id'] . " WHERE config_name = 'prosilver'"; | |
$db->sql_query($sql2); | |
$sql3 = 'UPDATE ' . CONFIG_TABLE . " SET config_value = 1 WHERE config_name = 'override_user_style'"; | |
$db->sql_query($sql3); | |
$db->sql_freeresult($result); | |
trigger_error('Board style reset to proSilver, override user style is set to <i>yes</i>. Please remove this script'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment