diff --git a/phpBB/adm/admin_styles.php b/phpBB/adm/admin_styles.php index 3a254cff41..e1bdc1279a 100644 --- a/phpBB/adm/admin_styles.php +++ b/phpBB/adm/admin_styles.php @@ -700,7 +700,7 @@ switch ($mode) } $stylesheet = fread($fp, filesize($phpbb_root_path . 'styles/themes/' . $css_external)); fclose($fp); - $stylesheet = str_replace(array("\t", "\n"), " ", $stylesheet); +// $stylesheet = str_replace(array("\t", "\n"), " ", $stylesheet); // Pull out list of "custom" tags @@ -734,16 +734,16 @@ switch ($mode) // have just selected a class. We must also cope with switching between // simple and rawcss mode $css_element = array(); - if (!empty($_POST['rawcss']) && !empty($_POST['hidecss'])) + if (!empty($_POST['rawcss']) && (!empty($_POST['hidecss']) || !empty($_POST['preview']) || !empty($_POST['update']))) { $css_element = preg_replace("#;[\r\n]*#s", "\n", stripslashes($_POST['rawcss'])); $css_element = explode("\n", $css_element); } - else if (($showcss && !empty($_POST['showcss'])) || !empty($_POST['preview'])) + else if (($showcss && !empty($_POST['showcss'])) || !empty($_POST['preview']) || !empty($_POST['update'])) { if (!empty($_POST['cssother'])) { - $css_element = explode('; ', stripslashes(substr($_POST['cssother'], 0, -2))); + $css_element = explode('; ', stripslashes($_POST['cssother'])); } foreach ($match_elements as $type => $match_ary) @@ -758,52 +758,199 @@ switch ($mode) } } } - else if (preg_match('#^.*?' . $class . ' {(.*?)}#m', $stylesheet, $matches)) + else if (preg_match('#^' . $class . ' {(.*?)}#m', $stylesheet, $matches)) { $css_element = explode('; ', ltrim(substr($matches[1], 0, -2))); } + // User wants to submit data ... + if (!empty($_POST['update'])) + { + $updated_element = implode('; ', $css_element) . ';'; + if (preg_match('#^' . $class . ' {(.*?)}#m', $stylesheet)) + { + $stylesheet = preg_replace('#^(' . $class . ' {).*?(})#m', '\1 ' . $updated_element . ' \2', $stylesheet); + } + else + { + $stylesheet .= ''; + } + + if (!($fp = fopen($phpbb_root_path . 'styles/themes/' . $css_external, 'wb'))) + { + die("ERROR"); + } + $stylesheet = fwrite($fp, $stylesheet); + fclose($fp); + + $error[] = $user->lang['THEME_UPDATED']; + } + + + // I guess really this needs some basic examples, pulled from subSilver + // to demonstrate the default classes. Other, custom classes can just use + // the div/span and some text? This is gonna get nasty :( if (!empty($_POST['preview'])) { - + $output = '%s'; + ?> - + + + + -
Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look?
+ + + + + + + + + + + + +

h1

h2

h3

mainmenu
 
+ + + + +
titles +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
th
cattitle / catcatdiv
topictitle / row1topicauthor / row2topicdetails / row1
row3
spacer
postdetails / row2postbody / row1 posthilit
+ +

+ + + + + + + + + + +
gengenmedgensmall
copyright phpBB
+ +

+ +
+ + + + + + + + + + + + + + +
+ +

+ + + + + + + + + + + + + + +
postbody / bold italic underline
+ + + +
A_N_Other wrote:
quote
+ + + + + + +
Code:
10 Print "hello"
20 Goto 10
+ + + + + + +
PHP:
// syntaxcomment
?>
<HTML>
<?php
echo $this = "HELLO";

-
Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look?
- -
- -
Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look?
- -
- -
Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look? Hello, this is some text. How does it look?
-
- lang['SELECT_CLASS']; ?>:   + lang['SELECT_CLASS']; ?>:   @@ -988,6 +1128,14 @@ function csspreview() +'; + } + +?> @@ -1003,6 +1151,14 @@ function csspreview() +'; + } + +?> @@ -1078,18 +1234,18 @@ function csspreview() ?> - - +
Raw CSS
' . implode('
', $error) . '
Parameter Value
' . implode('
', $error) . '
Background
            
    
@@ -1161,7 +1317,11 @@ function csspreview() ?> - "> + ', $row['theme_name'], '') : $row['theme_name']; + +?>  ">Regenerate | ">Delete | ">Export | ">Preview  'Visited', 'STYLE_ANCHOR_HOVER' => 'Hover', + 'THEME_UPDATED' => 'Theme updated successfully', + + 'Edit_style' => 'Edit Styles',