phpBB

Code Changes

File: includes/acp/acp_styles.php

  Unmodified   Added   Modified   Removed
Line 99Line 99
		$this->template_cfg .= '
# Some configuration options


		$this->template_cfg .= '
# Some configuration options


#
# You can use this function to inherit templates from another template.
# The template of the given name has to be installed.
# Templates cannot inherit from inheriting templates.
#';

# Template inheritance
# See http://blog.phpbb.com/2008/07/31/templating-just-got-easier/
# Set value to empty or this template name to ignore template inheritance.
inherit_from = {INHERIT_FROM}
';


$this->imageset_keys = array(
'logos' => array(


$this->imageset_keys = array(
'logos' => array(

Line 540Line 540
		global $user, $template, $db, $config, $phpbb_root_path, $phpEx;

$sql_from = '';

		global $user, $template, $db, $config, $phpbb_root_path, $phpEx;

$sql_from = '';

 
		$sql_sort = 'LOWER(' . $mode . '_name)';

		$style_count = array();

switch ($mode)
{
case 'style':
$sql_from = STYLES_TABLE;

		$style_count = array();

switch ($mode)
{
case 'style':
$sql_from = STYLES_TABLE;

 
				$sql_sort = 'style_active DESC, ' . $sql_sort;


$sql = 'SELECT user_style, COUNT(user_style) AS style_count
FROM ' . USERS_TABLE . '


$sql = 'SELECT user_style, COUNT(user_style) AS style_count
FROM ' . USERS_TABLE . '

Line 571Line 573
			case 'imageset':
$sql_from = STYLES_IMAGESET_TABLE;
break;

			case 'imageset':
$sql_from = STYLES_IMAGESET_TABLE;
break;

 
			
default:
trigger_error($user->lang['NO_MODE'] . adm_back_link($this->u_action), E_USER_WARNING);

		}

$l_prefix = strtoupper($mode);

		}

$l_prefix = strtoupper($mode);

Line 594Line 599
		);

$sql = "SELECT *

		);

$sql = "SELECT *

			FROM $sql_from";


			FROM $sql_from
ORDER BY $sql_sort ASC";

		$result = $db->sql_query($sql);

$installed = array();

		$result = $db->sql_query($sql);

$installed = array();

Line 630Line 636

'NAME' => $row[$mode . '_name'],
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,


'NAME' => $row[$mode . '_name'],
'STYLE_COUNT' => ($mode == 'style' && isset($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : 0,

 

'S_INACTIVE' => ($mode == 'style' && !$row['style_active']) ? true : false,

				)
);
}

				)
);
}

Line 659Line 667

if ($name && !in_array($name, $installed))
{


if ($name && !in_array($name, $installed))
{

							$new_ary[] = array(



							// The array key is used for sorting later on.
// $file is appended because $name doesn't have to be unique.
$new_ary[$name . $file] = array(

								'path'		=> $file,
'name' => $name,
'copyright' => $items['copyright'],

								'path'		=> $file,
'name' => $name,
'copyright' => $items['copyright'],

Line 675Line 685

if (sizeof($new_ary))
{


if (sizeof($new_ary))
{

 
			ksort($new_ary);


			foreach ($new_ary as $cfg)
{
$template->assign_block_vars('uninstalled', array(

			foreach ($new_ary as $cfg)
{
$template->assign_block_vars('uninstalled', array(

Line 2039Line 2051
			// Export template core code
if ($mode == 'template' || $inc_template)
{

			// Export template core code
if ($mode == 'template' || $inc_template)
{

				$template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version']), $this->template_cfg);

$use_template_name = '';

				$use_template_name = $style_row['template_name'];




// Add the inherit from variable, depending on it's use...
if ($style_row['template_inherits_id'])


// Add the inherit from variable, depending on it's use...
if ($style_row['template_inherits_id'])

Line 2055Line 2065
					$db->sql_freeresult($result);
}


					$db->sql_freeresult($result);
}


				$template_cfg .= ($use_template_name) ? "\ninherit_from = $use_template_name" : "\n#inherit_from = ";


				$template_cfg = str_replace(array('{MODE}', '{NAME}', '{COPYRIGHT}', '{VERSION}', '{INHERIT_FROM}'), array($mode, $style_row['template_name'], $style_row['template_copyright'], $config['version'], $use_template_name), $this->template_cfg);


				$template_cfg .= "\n\nbbcode_bitfield = {$style_row['bbcode_bitfield']}";

$data[] = array(

				$template_cfg .= "\n\nbbcode_bitfield = {$style_row['bbcode_bitfield']}";

$data[] = array(