acl_get('a_styles') ) { return; } $filename = basename(__FILE__); $module['STYLE']['EDIT_STYLE'] = $filename . "$SID&mode=styles"; $module['STYLE']['EDIT_TEMPLATE'] = $filename . "$SID&mode=templates"; $module['STYLE']['EDIT_THEME'] = $filename . "$SID&mode=themes"; $module['STYLE']['EDIT_IMAGESET'] = $filename . "$SID&mode=imagesets"; return; } define('IN_PHPBB', 1); // Include files $phpbb_root_path = '../'; require($phpbb_root_path . 'extension.inc'); require('pagestart.' . $phpEx); // Do we have styles admin permissions? if (!$auth->acl_get('a_styles')) { trigger_error($user->lang['NO_ADMIN']); } // $mode = (isset($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : ''; $action = (isset($_REQUEST['action'])) ? htmlspecialchars($_REQUEST['action']) : ''; switch ($mode) { case 'editimageset': $imgroot = (isset($_POST['imgroot'])) ? $_POST['imgroot'] : $config['default_style']; if (isset($_POST['img_addconfig'])) { } else if (isset($_POST['img_addlocal'])) { } $imageset = array('imageset_path', 'post_new', 'post_locked', 'post_pm', 'reply_new', 'reply_pm', 'reply_locked', 'icon_profile', 'icon_pm', 'icon_delete', 'icon_ip', 'icon_quote', 'icon_search', 'icon_edit', 'icon_email', 'icon_www', 'icon_icq', 'icon_aim', 'icon_yim', 'icon_msnm', 'icon_no_email', 'icon_no_www', 'icon_no_icq', 'icon_no_aim', 'icon_no_yim', 'icon_no_msnm', 'goto_post', 'goto_post_new', 'goto_post_latest', 'goto_post_newest', 'forum', 'forum_new', 'forum_locked', 'sub_forum', 'sub_forum_new', 'folder', 'folder_new', 'folder_hot', 'folder_hot_new', 'folder_locked', 'folder_locked_new', 'folder_sticky', 'folder_sticky_new', 'folder_announce', 'folder_announce_new', 'topic_watch', 'topic_unwatch', 'poll_left', 'poll_center', 'poll_right', 'rating'); $sql = 'SELECT imageset_name, imageset_path FROM ' . STYLES_IMAGE_TABLE . ' ORDER BY imageset_name'; $result = $db->sql_query($sql); $imgroot_options = ''; while ($row = $db->sql_fetchrow($result)) { $selected = ($imgroot == $row['imageset_path']) ? ' selected="selected"' : ''; $imgroot_options .= ''; } $imgname_options = ''; $dp = opendir($phpbb_root_path . 'imagesets/' . $imgroot . '/'); while ($file = readdir($dp)) { if (preg_match('#\.(gif|png|jpg|jpeg)$#', $file) && is_file($phpbb_root_path . 'imagesets/' . $imgroot . '/' . $file)) { $selected = ($imgname == $file) ? ' selected="selected"' : ''; $imgname_options .= ''; } } closedir($dp); // Output page adm_page_header($user->lang['Edit_Imageset']); ?>

Edit Imageset

Template set:    

Here you can create, edit, delete and download imagesets.

sql_query($sql); $images = $db->sql_fetchrow($result); ?> ' : ''; $img = str_replace('"imagesets/', '"../imagesets/', $img); $img = str_replace('{LANG}', $user->img_lang, $img); $img = str_replace('{RATE}', 3, $img); ?>
ImageGraphic 
 
compile(stripslashes($_POST['decompile'])) . "\n?".">"; $fp = fopen($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'w+'); fwrite ($fp, $str); fclose($fp); @chmod($phpbb_root_path . 'templates/cache/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 0644); add_log('admin', 'log_template_edit', $tplname, $tplroot); exit; } else if (!empty($tplname) && isset($_POST['tpl_name'])) { $fp = fopen($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $tplname . '.html.' . $phpEx, 'r'); while (!feof($fp)) { $str .= fread($fp, 4096); } @fclose($fp); $match_preg = array( '#\$this\->_tpl_include\(\'(.*?)\'\);#', '#echo \$this->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\];#', '#echo \(\(isset\(\$this\->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\]\)\).*?;#', '#if \(.*?\[\'\.\'\]\[0\]\[\'(.*?)\'\]\) \{ #', '#\$_(.*?)_count.*?;if \(.*?\)\{#', ); $replace_preg = array( '', '{$1}', '{$1}', '', '', ); $str = preg_replace($match_preg, $replace_preg, $str); $str = str_replace('', '', $str); } else { $str = (!empty($_POST['decompile'])) ? stripslashes($_POST['decompile']) : ''; } if (isset($_POST['tpl_download'])) { header("Content-Type: text/html; name=\"" . $tplname . ".html\""); header("Content-disposition: attachment; filename=" . $tplname . ".html"); echo $str; exit; } // $tplroot_options = get_templates($tplroot); $tplname_options = ''; $dp = @opendir($phpbb_root_path . 'cache/templates/' . $tplroot . '/'); while ($file = readdir($dp)) { if (strstr($file, '.html.' . $phpEx) && is_file($phpbb_root_path . 'cache/templates/' . $tplroot . '/' . $file)) { $tpl = substr($file, 0, strpos($file, '.')); $selected = ($tplname == $tpl) ? ' selected="selected"' : ''; $tplname_options .= ''; } } closedir($dp); // adm_page_header($user->lang['Edit_template']); ?>

lang['Edit_template']; ?>

lang['Edit_template_explain']; ?>

">
 Template:   Columns:  Rows:    
   
lang['EDIT_TEMPLATE']); ?>

lang['Edit_template']; ?>

lang['Edit_template_explain']; ?>

">sql_query($sql); if ($row = $db->sql_fetchrow($result)) { do { $row_class = ($row_class != 'row1') ? 'row1' : 'row2'; ?> sql_fetchrow($result)); } else { } $db->sql_freeresult($result); ?>
Template name  
">  ">BBCode | ">Delete | ">Export | ">Preview 
 
sql_query($sql); if ($theme_data = $db->sql_fetchrow($result)) { } $db->sql_freeresult($result); } $user->lang = array_merge($user->lang, array( 'SELECT_CLASS' => 'Select class', 'style_cat_text' => 'Text classes', 'style_body' => 'Body', 'style_p' => 'Paragraphs', 'style_h1' => 'Header 1', 'style_h2' => 'Header 2', 'style_h3' => 'Header 3', 'style_postdetails' => 'Post Information', 'style_postbody' => 'Post Text', 'style_postauthor' => 'Post Author', 'style_topictitle' => 'Topic titles', 'style_topicauthor' => 'Topic Author', 'style_topicdetails' => 'Topic Details', 'style_gen' => 'General Text', 'style_genmed' => 'Medium Text', 'style_gensmall' => 'Small Text', 'style_copyright' => 'Copyright Text', 'style_cat_tables' => 'Table classes', 'style_cat' => 'Category Header Cell', 'style_cattitle' => 'Category Header Text', 'style_th' => 'Table Header Cell', 'style_td' => 'Table Data Cell', 'style_cat_bbcode' => 'BBCode classes', 'style_b' => 'Bold', 'style_u' => 'Underline', 'style_i' => 'Italics', 'style_color' => 'Colour', 'style_size' => 'Size', 'style_code' => 'Code', 'style_quote' => 'Quote', 'style_flash' => 'Flash', 'style_syntaxbg' => 'Syntax Background', 'style_syntaxcomment' => 'Syntax Comments', 'style_syntaxdefault' => 'Syntax Default', 'style_syntaxhtml' => 'Syntax HTML', 'style_syntaxkeyword' => 'Syntax Keyword', 'style_syntaxstring' => 'Syntax String', )); $base_classes = array( 'text' => array( 'body', 'p', 'h1', 'h2', 'h3', 'gen', 'genmed', 'gensmall', 'topictitle', 'topicauthor', 'topicdetails', 'postdetails', 'postbody', 'postauthor', 'copyright' ), 'tables' => array( 'th', 'td', 'cat', 'cattitle', ), 'bbcode' => array( 'b', 'u', 'i', 'color', 'size', 'code', 'quote', 'flash', 'syntaxbg', 'syntaxcomment', 'syntaxdefault', 'syntaxhtml', 'syntaxkeyword', 'syntaxstring', ) ); $class_options = ''; foreach ($base_classes as $category => $class_ary) { $class_options .= ''; foreach ($class_ary as $class_name) { $selected = ($class_name == $class) ? ' selected="selected"' : ''; $class_options .= ''; } } if (!empty($class)) { //TEMP if (!($fp = fopen($phpbb_root_path . 'templates/' . $theme_data['css_external'], 'rb'))) { die("ERROR"); } $stylesheet = fread($fp, filesize($phpbb_root_path . 'templates/' . $theme_data['css_external'])); fclose($fp); $stylesheet = str_replace(array("\t", "\n"), " ", $stylesheet); if (preg_match('#^.*?' . $class . ' {(.*?)}#m', $stylesheet, $matches)) { $stylesheet = &$matches[1]; $match_elements = array( 'colors' => array('background-color', 'color', 'border-color', ), 'sizes' => array('font-size', 'line-height', 'border-width', ), 'images' => array('background-image', ), 'repeat' => array('background-repeat', ), 'other' => array('font-weight', 'font-family', 'font-style', 'text-decoration', 'border-style', ), ); foreach ($match_elements as $type => $match_ary) { foreach ($match_ary as $match) { $$match = ''; $var = str_replace('-', '', $match); if (preg_match('#\b' . $match . ': (.*?);#s', $stylesheet, $matches)) { switch ($type) { case 'colors': $$var = trim($matches[1]); break; case 'sizes': if (preg_match('#(.*?)(px|%|em|pt)#', $matches[1], $matches)) { ${$var . 'units'} = trim($matches[2]); } $$var = trim($matches[1]); break; case 'images': if (preg_match('#url\(\'(.*?)\'\)#', $matches[1], $matches)) { $$var = trim($matches[1]); } break; case 'repeat': $$var = trim($matches[1]); break; default: $$var = trim($matches[1]); } } } } } } // Grab list of potential images for class backgrounds $imglist = filelist($phpbb_root_path . 'templates'); $bg_imglist = ''; foreach ($imglist as $img) { $img = substr($img['path'], 1) . (($img['path'] != '') ? '/' : '') . $img['file']; $selected = (preg_match('#templates/' . preg_quote($img) . '#', $backgroundimage)) ? ' selected="selected"' : ''; $bg_imglist .= ''; } $bg_imglist = '' . $bg_imglist; // Output the page adm_page_header($user->lang['EDIT_THEME']); ?>

lang['Edit_theme']; ?>

lang['Edit_theme_explain']; ?>

Selected Theme:

">
lang['SELECT_CLASS']; ?>:  
Parameter Value
Background
Color:
This is a hex-triplet of the form RRGGBB
Web-safe Colour Swatch
 
Image:
Repeat background:
Text
Color:
This is a hex-triplet of the form RRGGBB
Web-safe Colour Swatch
 
Font:
You can specify multiple fonts seperated by commas
Size:
Bold: /> lang['YES']; ?>   /> lang['NO']; ?>
Italic: /> lang['YES']; ?>   /> lang['NO']; ?>
Underline: /> lang['YES']; ?>   /> lang['NO']; ?>
Line spacing:
Borders
Color:
This is a hex-triplet of the form RRGGBB
Web-safe Colour Swatch
 
Width:
Style:
    
lang['EDIT_THEME']); ?>

lang['Edit_theme']; ?>

lang['Edit_theme_explain']; ?>

Selected Theme: subSilver

">sql_query($sql); if ($row = $db->sql_fetchrow($result)) { do { $row_class = ($row_class != 'row1') ? 'row1' : 'row2'; ?> sql_fetchrow($result)); } else { } $db->sql_freeresult($result); ?>
Theme name  
">  ">Recreate | ">Delete | ">Export | ">Preview