Zeile 149 | Zeile 149 |
---|
{ if($options['templateset']) {
|
{ if($options['templateset']) {
|
$sid = $options['templateset'];
| $sid = (int)$options['templateset'];
|
} else {
| } else {
|
Zeile 262 | Zeile 262 |
---|
$loop = 1; foreach($theme['stylesheets']['stylesheet'] as $stylesheet) {
|
$loop = 1; foreach($theme['stylesheets']['stylesheet'] as $stylesheet) {
|
| $stylesheet['attributes']['name'] = my_substr($stylesheet['attributes']['name'], 0, 30);
|
if(substr($stylesheet['attributes']['name'], -4) != ".css") { continue;
|
if(substr($stylesheet['attributes']['name'], -4) != ".css") { continue;
|
}
| }
|
if(empty($stylesheet['attributes']['lastmodified'])) { $stylesheet['attributes']['lastmodified'] = TIME_NOW;
|
if(empty($stylesheet['attributes']['lastmodified'])) { $stylesheet['attributes']['lastmodified'] = TIME_NOW;
|
}
| }
|
if(empty($stylesheet['attributes']['disporder']))
|
if(empty($stylesheet['attributes']['disporder']))
|
{
| {
|
$stylesheet['attributes']['disporder'] = $loop; }
if(empty($stylesheet['attributes']['attachedto'])) { $stylesheet['attributes']['attachedto'] = '';
|
$stylesheet['attributes']['disporder'] = $loop; }
if(empty($stylesheet['attributes']['attachedto'])) { $stylesheet['attributes']['attachedto'] = '';
|
}
$properties['disporder'][$stylesheet['attributes']['name']] = $stylesheet['attributes']['disporder'];
| }
$properties['disporder'][$stylesheet['attributes']['name']] = $stylesheet['attributes']['disporder'];
|
$new_stylesheet = array( "name" => $db->escape_string($stylesheet['attributes']['name']),
| $new_stylesheet = array( "name" => $db->escape_string($stylesheet['attributes']['name']),
|
Zeile 298 | Zeile 300 |
---|
if($cached) { $css_url = $cached;
|
if($cached) { $css_url = $cached;
|
}
| }
|
$attachedto = $stylesheet['attributes']['attachedto']; if(!$attachedto) {
| $attachedto = $stylesheet['attributes']['attachedto']; if(!$attachedto) {
|
Zeile 374 | Zeile 376 |
---|
$filename = basename($filename); $tid = (int) $tid; $theme_directory = "cache/themes/theme{$tid}";
|
$filename = basename($filename); $tid = (int) $tid; $theme_directory = "cache/themes/theme{$tid}";
|
| if(substr($filename, -4) != ".css") { return false; }
|
// If we're in safe mode save to the main theme folder by default if($mybb->safemode)
| // If we're in safe mode save to the main theme folder by default if($mybb->safemode)
|
Zeile 407 | Zeile 414 |
---|
$fp = @fopen(MYBB_ROOT . "{$theme_directory}/{$filename}", "wb"); if(!$fp)
|
$fp = @fopen(MYBB_ROOT . "{$theme_directory}/{$filename}", "wb"); if(!$fp)
|
{ return false; }
| { return false; }
|
@fwrite($fp, $stylesheet); @fclose($fp);
| @fwrite($fp, $stylesheet); @fclose($fp);
|
Zeile 707 | Zeile 714 |
---|
function get_selectors_as_options($css, $selected_item=null) { $select = "";
|
function get_selectors_as_options($css, $selected_item=null) { $select = "";
|
if(!is_array($css))
| if(!is_array($css))
|
{ $css = css_to_array($css); }
| { $css = css_to_array($css); }
|
Zeile 718 | Zeile 725 |
---|
if(is_array($css)) { uasort($css, "css_selectors_sort_cmp");
|
if(is_array($css)) { uasort($css, "css_selectors_sort_cmp");
|
|
|
foreach($css as $id => $css_array) { if(!$css_array['name'])
| foreach($css as $id => $css_array) { if(!$css_array['name'])
|
Zeile 727 | Zeile 734 |
---|
}
if($selected_item == $id || (!$selected_item && !$selected))
|
}
if($selected_item == $id || (!$selected_item && !$selected))
|
{
| {
|
$select .= "<option value=\"{$id}\" selected=\"selected\">{$css_array['name']}</option>\n"; $selected = true; }
| $select .= "<option value=\"{$id}\" selected=\"selected\">{$css_array['name']}</option>\n"; $selected = true; }
|
Zeile 856 | Zeile 863 |
---|
if(!$class_id) { $class_id = $parsed_css[$selector]['class_name'];
|
if(!$class_id) { $class_id = $parsed_css[$selector]['class_name'];
|
}
| }
|
// The specified class ID cannot be found, add CSS to end of file if(!$css || !$parsed_css[$selector]) {
| // The specified class ID cannot be found, add CSS to end of file if(!$css || !$parsed_css[$selector]) {
|
Zeile 912 | Zeile 919 |
---|
/** * @param array $stylesheet
|
/** * @param array $stylesheet
|
* @param int $tid *
| * @param int $tid *
|
* @return bool|int */ function copy_stylesheet_to_theme($stylesheet, $tid)
| * @return bool|int */ function copy_stylesheet_to_theme($stylesheet, $tid)
|
Zeile 922 | Zeile 929 |
---|
$stylesheet['tid'] = $tid; unset($stylesheet['sid']);
|
$stylesheet['tid'] = $tid; unset($stylesheet['sid']);
|
|
|
$new_stylesheet = array(); foreach($stylesheet as $key => $value) { if(!is_numeric($key)) { $new_stylesheet[$db->escape_string($key)] = $db->escape_string($value);
|
$new_stylesheet = array(); foreach($stylesheet as $key => $value) { if(!is_numeric($key)) { $new_stylesheet[$db->escape_string($key)] = $db->escape_string($value);
|
} }
$sid = $db->insert_query("themestylesheets", $new_stylesheet);
| } }
$sid = $db->insert_query("themestylesheets", $new_stylesheet);
|
return $sid; }
| return $sid; }
|
Zeile 969 | Zeile 976 |
---|
if($stylesheet['tid'] != $tid) { $stylesheet['inherited'] = $stylesheet['tid'];
|
if($stylesheet['tid'] != $tid) { $stylesheet['inherited'] = $stylesheet['tid'];
|
}
| }
|
$stylesheets[$stylesheet['name']] = $stylesheet; }
| $stylesheets[$stylesheet['name']] = $stylesheet; }
|
Zeile 1005 | Zeile 1012 |
---|
{ $css_url = "cache/themes/theme{$theme_id}/{$stylesheet['name']}"; break;
|
{ $css_url = "cache/themes/theme{$theme_id}/{$stylesheet['name']}"; break;
|
} }
| } }
|
} if(is_object($plugins))
| } if(is_object($plugins))
|
Zeile 1016 | Zeile 1023 |
---|
$attachedto = $stylesheet['attachedto']; if(!$attachedto)
|
$attachedto = $stylesheet['attachedto']; if(!$attachedto)
|
{
| {
|
$attachedto = "global"; } // private.php?compose,folders|usercp.php,global|global
| $attachedto = "global"; } // private.php?compose,folders|usercp.php,global|global
|
Zeile 1025 | Zeile 1032 |
---|
{ $attached_actions = array(); if(strpos($attached_file, '?') !== false)
|
{ $attached_actions = array(); if(strpos($attached_file, '?') !== false)
|
{
| {
|
$attached_file = explode('?', $attached_file); $attached_actions = explode(",", $attached_file[1]); $attached_file = $attached_file[0];
|
$attached_file = explode('?', $attached_file); $attached_actions = explode(",", $attached_file[1]); $attached_file = $attached_file[0];
|
}
| }
|
if(count($attached_actions) == 0) { $attached_actions = array("global"); }
|
if(count($attached_actions) == 0) { $attached_actions = array("global"); }
|
|
|
foreach($attached_actions as $action) { $theme_stylesheets[$attached_file][$action][] = $css_url;
| foreach($attached_actions as $action) { $theme_stylesheets[$attached_file][$action][] = $css_url;
|
Zeile 1044 | Zeile 1051 |
---|
{ $theme_stylesheets['inherited']["{$attached_file}_{$action}"][$css_url] = $stylesheet['inherited']; }
|
{ $theme_stylesheets['inherited']["{$attached_file}_{$action}"][$css_url] = $stylesheet['inherited']; }
|
}
| }
|
} }
| } }
|
Zeile 1081 | Zeile 1088 |
---|
} if($properties['disporder'][$stylesheet['name']] > $max_disporder)
|
} if($properties['disporder'][$stylesheet['name']] > $max_disporder)
|
{
| {
|
$max_disporder = $properties['disporder'][$stylesheet['name']]; }
| $max_disporder = $properties['disporder'][$stylesheet['name']]; }
|
Zeile 1155 | Zeile 1162 |
---|
$themes = array();
foreach($themes_by_parent[$tid] as $key => $theme)
|
$themes = array();
foreach($themes_by_parent[$tid] as $key => $theme)
|
{
| {
|
$themes[] = $theme['tid']; $parents = make_parent_theme_list($theme['pid']);
| $themes[] = $theme['tid']; $parents = make_parent_theme_list($theme['pid']);
|
Zeile 1454 | Zeile 1461 |
---|
*/ function upgrade_css_120_to_140($css) {
|
*/ function upgrade_css_120_to_140($css) {
|
| global $mybb;
|
// Update our CSS to the new stuff in 1.4 $parsed_css = css_to_array($css);
| // Update our CSS to the new stuff in 1.4 $parsed_css = css_to_array($css);
|