mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 07:35:29 +02:00
Update data for styling schema changes, preview via style admin, styles in use by users count, default style feedback
git-svn-id: file:///svn/phpbb/trunk@4251 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
7d0d2ad869
commit
46c24679bf
@ -103,6 +103,10 @@ switch ($mode)
|
||||
<td class="row1">Style Name</td>
|
||||
<td class="row2"><input class="post" type="text" name="style_name" maxlength="255" size="40" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1">Style Copyright</td>
|
||||
<td class="row2"><!-- input class="post" type="text" name="style_name" maxlength="255" size="40" /--></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="row1">Template set:</td>
|
||||
<td class="row2"><select name="template_id"><?php echo $template_options; ?></select></td>
|
||||
@ -136,6 +140,8 @@ switch ($mode)
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
|
||||
adm_page_header($user->lang['MANAGE_STYLE']);
|
||||
|
||||
?>
|
||||
@ -145,11 +151,23 @@ switch ($mode)
|
||||
|
||||
<form name="style" method="post" action="<?php echo "admin_styles.$phpEx$SID&mode=$mode"; ?>"><table class="bg" width="100%" cellspacing="1" cellpadding="4" border="0" align="center">
|
||||
<tr>
|
||||
<th>Style name</th>
|
||||
<th> </th>
|
||||
<th nowrap="nowrap">Style name</th>
|
||||
<th nowrap="nowrap">Used by</th>
|
||||
<th nowrap="nowrap"> </th>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
$sql = 'SELECT user_style, COUNT(user_style) AS style_count
|
||||
FROM ' . USERS_TABLE . '
|
||||
GROUP BY user_style';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$style_count[$row['user_style']] = $row['style_count'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT style_id, style_name
|
||||
FROM ' . STYLES_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
@ -162,8 +180,9 @@ switch ($mode)
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" width="100%"><a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=edit&id=" . $row['style_id']; ?>"><?php echo $row['style_name']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=deactivate&id=" . $row['style_id']; ?>">Deactivate</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=delete&id=" . $row['style_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=export&id=" . $row['style_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=preview&id=" . $row['style_id']; ?>">Preview</a> </td>
|
||||
<td class="<?php echo $row_class; ?>" width="100%"><a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=edit&id=" . $row['style_id']; ?>"><?php echo $row['style_name']; ?></a><?php echo ($config['default_style'] == $row['style_id']) ? ' *' : ''; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" align="center" nowrap="nowrap"><?php echo (!empty($style_count[$row['style_id']])) ? $style_count[$row['style_id']] : '0'; ?></td>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=deactivate&id=" . $row['style_id']; ?>">Deactivate</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=delete&id=" . $row['style_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=export&id=" . $row['style_id']; ?>">Export</a> | <a href="<?php echo "{$phpbb_root_path}index.$phpEx$SID&style=" . $row['style_id']; ?>" target="_stylepreview">Preview</a> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ -178,7 +197,7 @@ switch ($mode)
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td class="cat" colspan="2"> </td>
|
||||
<td class="cat" colspan="3" align="right">Create new style: <input class="post" type="text" name="style_name" value="" maxlength="30" size="25" /> <input class="btnmain" type="submit" name="newstyle" value="<?php echo $user->lang['SUBMIT']; ?>" /></td>
|
||||
</tr>
|
||||
</table></form>
|
||||
<?php
|
||||
@ -189,10 +208,11 @@ switch ($mode)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
case 'imagesets':
|
||||
|
||||
|
||||
|
||||
adm_page_header($user->lang['MANAGE_IMAGESET']);
|
||||
|
||||
?>
|
||||
@ -220,7 +240,7 @@ switch ($mode)
|
||||
?>
|
||||
<tr>
|
||||
<td class="<?php echo $row_class; ?>" width="100%"><a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=edit&id=" . $row['imageset_id']; ?>"><?php echo $row['imageset_name']; ?></a></td>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=deactivate&id=" . $row['style_id']; ?>">Deactivate</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=delete&id=" . $row['imageset_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=export&id=" . $row['imageset_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=preview&id=" . $row['imageset_id']; ?>">Preview</a> </td>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=delete&id=" . $row['imageset_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=$mode&action=export&id=" . $row['imageset_id']; ?>">Export</a> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
@ -442,30 +462,6 @@ switch ($mode)
|
||||
}
|
||||
@fclose($fp);
|
||||
|
||||
/* $match_preg = array(
|
||||
'#\$this\->_tpl_include\(\'(.*?)\'\);#',
|
||||
'#echo \$this->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\];#',
|
||||
'#echo \(\(isset\(\$this\->_tpldata\[\'\.\'\]\[0\]\[\'(.*?)\'\]\)\).*?;#',
|
||||
'#if \(.*?\[\'\.\'\]\[0\]\[\'(.*?)\'\]\) \{ #',
|
||||
'#\$_(.*?)_count.*?;if \(.*?\)\{#',
|
||||
'#\<\?php #',
|
||||
'# \?\>#',
|
||||
);
|
||||
|
||||
$replace_preg = array(
|
||||
'<!-- INCLUDE $1 -->',
|
||||
'{$1}',
|
||||
'{$1}',
|
||||
'<!-- IF \1 -->',
|
||||
'<!-- BEGIN \1 -->',
|
||||
'',
|
||||
''
|
||||
);
|
||||
|
||||
*/
|
||||
|
||||
// $tpldata = preg_replace($match_preg, $replace_preg, $tpldata);
|
||||
|
||||
preg_match_all('#<!\-\- INCLUDE (.*?) \-\->#', $tpldata, $included_tpls);
|
||||
$included_tpls = $included_tpls[1];
|
||||
}
|
||||
@ -694,13 +690,12 @@ switch ($mode)
|
||||
|
||||
|
||||
// Grab template data
|
||||
if (!($fp = fopen($phpbb_root_path . 'styles/themes/' . $css_external, 'rb')))
|
||||
if (!($fp = fopen("{$phpbb_root_path}styles/themes/$theme_path/$theme_name.css", 'rb')))
|
||||
{
|
||||
die("ERROR");
|
||||
}
|
||||
$stylesheet = fread($fp, filesize($phpbb_root_path . 'styles/themes/' . $css_external));
|
||||
$stylesheet = fread($fp, filesize("{$phpbb_root_path}styles/themes/$theme_path/$theme_name.css"));
|
||||
fclose($fp);
|
||||
// $stylesheet = str_replace(array("\t", "\n"), " ", $stylesheet);
|
||||
|
||||
|
||||
// Pull out list of "custom" tags
|
||||
@ -785,6 +780,8 @@ switch ($mode)
|
||||
fclose($fp);
|
||||
|
||||
$error[] = $user->lang['THEME_UPDATED'];
|
||||
|
||||
add_log('admin', 'LOG_EDIT_THEME', $theme_name);
|
||||
}
|
||||
|
||||
|
||||
@ -1324,7 +1321,7 @@ function csspreview()
|
||||
echo sprintf('%s%s%s', "<a href=\"admin_styles.$phpEx$SID&mode=themes&action=edit&id=" . $row['theme_id'] . '">', $row['theme_name'], '</a>');
|
||||
|
||||
?></td>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=recreate&id=" . $row['theme_id']; ?>">Regenerate</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=delete&id=" . $row['theme_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=export&id=" . $row['theme_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=preview&id=" . $row['theme_id']; ?>">Preview</a> </td>
|
||||
<td class="<?php echo $row_class; ?>" nowrap="nowrap"> <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=delete&id=" . $row['theme_id']; ?>">Delete</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=export&id=" . $row['theme_id']; ?>">Export</a> | <a href="<?php echo "admin_styles.$phpEx$SID&mode=themes&action=preview&id=" . $row['theme_id']; ?>">Preview</a> </td>
|
||||
</tr>
|
||||
<?php
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user