phpBB

Code Changes

File: includes/acp/acp_styles.php

  Unmodified   Added   Modified   Removed
Line 258Line 258
	{
// Get list of styles to uninstall
$ids = $this->request_vars('id', 0, true);

	{
// Get list of styles to uninstall
$ids = $this->request_vars('id', 0, true);

 

// Don't remove prosilver, you can still deactivate it.
$sql = 'SELECT style_id
FROM ' . STYLES_TABLE . "
WHERE style_name = '" . $this->db->sql_escape('prosilver') . "'";
$result = $this->db->sql_query($sql);
$prosilver_id = (int) $this->db->sql_fetchfield('style_id');
$this->db->sql_freeresult($result);

if ($prosilver_id && in_array($prosilver_id, $ids))
{
trigger_error($this->user->lang('UNINSTALL_PROSILVER') . adm_back_link($this->u_action), E_USER_WARNING);
}


// Check if confirmation box was submitted
if (confirm_box(true))


// Check if confirmation box was submitted
if (confirm_box(true))

Line 398Line 411

// Reset default style for users who use selected styles
$sql = 'UPDATE ' . USERS_TABLE . '


// Reset default style for users who use selected styles
$sql = 'UPDATE ' . USERS_TABLE . '

			SET user_style = 0

			SET user_style = ' . (int) $this->default_style . '

			WHERE user_style IN (' . implode(', ', $ids) . ')';
$this->db->sql_query($sql);


			WHERE user_style IN (' . implode(', ', $ids) . ')';
$this->db->sql_query($sql);


Line 447Line 460
		{
trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}

		{
trigger_error($this->user->lang['NO_MATCHING_STYLES_FOUND'] . adm_back_link($this->u_action), E_USER_WARNING);
}

 

// Read style configuration file
$style_cfg = $this->read_style_cfg($style['style_path']);


// Find all available parent styles
$list = $this->find_possible_parents($styles, $id);


// Find all available parent styles
$list = $this->find_possible_parents($styles, $id);

Line 595Line 611
			'STYLE_ID'			=> $style['style_id'],
'STYLE_NAME' => htmlspecialchars($style['style_name']),
'STYLE_PATH' => htmlspecialchars($style['style_path']),

			'STYLE_ID'			=> $style['style_id'],
'STYLE_NAME' => htmlspecialchars($style['style_name']),
'STYLE_PATH' => htmlspecialchars($style['style_path']),

 
			'STYLE_VERSION'		=> htmlspecialchars($style_cfg['style_version']),

			'STYLE_COPYRIGHT'	=> strip_tags($style['style_copyright']),
'STYLE_PARENT' => $style['style_parent_id'],
'S_STYLE_ACTIVE' => $style['style_active'],

			'STYLE_COPYRIGHT'	=> strip_tags($style['style_copyright']),
'STYLE_PARENT' => $style['style_parent_id'],
'S_STYLE_ACTIVE' => $style['style_active'],

Line 948Line 965
			// Style data
'STYLE_ID' => $style['style_id'],
'STYLE_NAME' => htmlspecialchars($style['style_name']),

			// Style data
'STYLE_ID' => $style['style_id'],
'STYLE_NAME' => htmlspecialchars($style['style_name']),

 
			'STYLE_PHPBB_VERSION'	=> $this->read_style_cfg($style['style_path'])['phpbb_version'],

			'STYLE_PATH'	=> htmlspecialchars($style['style_path']),
'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
'STYLE_ACTIVE' => $style['style_active'],

			'STYLE_PATH'	=> htmlspecialchars($style['style_path']),
'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
'STYLE_ACTIVE' => $style['style_active'],

Line 993Line 1011
				'L_ACTION'	=> $this->user->lang['EXPORT']
); */


				'L_ACTION'	=> $this->user->lang['EXPORT']
); */


 
			if ($style['style_name'] !== 'prosilver')
{

			// Uninstall
$actions[] = array(
'U_ACTION' => $this->u_action . '&action=uninstall&hash=' . generate_link_hash('uninstall') . '&id=' . $style['style_id'],
'L_ACTION' => $this->user->lang['STYLE_UNINSTALL']
);

			// Uninstall
$actions[] = array(
'U_ACTION' => $this->u_action . '&action=uninstall&hash=' . generate_link_hash('uninstall') . '&id=' . $style['style_id'],
'L_ACTION' => $this->user->lang['STYLE_UNINSTALL']
);

 
			}


// Preview
$actions[] = array(


// Preview
$actions[] = array(

Line 1118Line 1139
	*/
protected function read_style_cfg($dir)
{

	*/
protected function read_style_cfg($dir)
{

 
		// This should never happen, we give them a red warning because of its relevance.
if (!file_exists($this->styles_path . $dir . '/style.cfg'))
{
trigger_error($this->user->lang('NO_STYLE_CFG', $dir), E_USER_WARNING);
}


		static $required = array('name', 'phpbb_version', 'copyright');

		static $required = array('name', 'phpbb_version', 'copyright');

 


		$cfg = parse_cfg_file($this->styles_path . $dir . '/style.cfg');

// Check if it is a valid file

		$cfg = parse_cfg_file($this->styles_path . $dir . '/style.cfg');

// Check if it is a valid file

Line 1245Line 1273

// Change default style for users
$sql = 'UPDATE ' . USERS_TABLE . '


// Change default style for users
$sql = 'UPDATE ' . USERS_TABLE . '

			SET user_style = 0

			SET user_style = ' . (int) $this->default_style . '

			WHERE user_style = ' . $id;
$this->db->sql_query($sql);


			WHERE user_style = ' . $id;
$this->db->sql_query($sql);


Line 1351Line 1379
		}

// Hardcoded template bitfield to add for new templates

		}

// Hardcoded template bitfield to add for new templates

 
		$default_bitfield = '1111111111111';


		$bitfield = new bitfield();

		$bitfield = new bitfield();

		$bitfield->set(0);
$bitfield->set(1);
$bitfield->set(2);
$bitfield->set(3);
$bitfield->set(4);
$bitfield->set(8);
$bitfield->set(9);
$bitfield->set(11);
$bitfield->set(12);
$value = $bitfield->get_base64();
return $value;

		for ($i = 0; $i < strlen($default_bitfield); $i++)
{
if ($default_bitfield[$i] == '1')
{
$bitfield->set($i);
}
}

return $bitfield->get_base64();



	}

}

	}

}