Skip to content

Instantly share code, notes, and snippets.

@GerB
Last active October 10, 2018 06:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GerB/d87e1a52903f45d0bdcc063ed6d0366f to your computer and use it in GitHub Desktop.
Save GerB/d87e1a52903f45d0bdcc063ed6d0366f to your computer and use it in GitHub Desktop.
Reset phpBB style to proSilver
<?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