Introducing the ability to manually set the dimensions of an image in the imageset editor.

A little spelling.

Introduces new language variable(s).

#11925
#11675


git-svn-id: file:///svn/phpbb/trunk@7750 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2007-06-11 12:39:51 +00:00
parent 13a02f6cc5
commit 0d074672fa
6 changed files with 60 additions and 10 deletions

View file

@ -58,6 +58,35 @@
}
//-->
</script>
<script type="text/javascript">
<!--
/**
* Handle displaying/hiding the dimension fields
*/
function display_options(value)
{
if (value == 0)
{
dE('img_dimensions', -1);
}
else
{
dE('img_dimensions', 1);
}
}
/**
* Init the wanted display functionality if javascript is enabled.
* If javascript is not available, the user is still able to properly administrate.
*/
onload = function()
{
<!-- IF not IMAGE_SIZE -->
dE('img_dimensions', -1);
<!-- ENDIF -->
}
//-->
</script>
<form method="post" action="{U_ACTION}">
@ -100,9 +129,19 @@
</dl>
<dl>
<dt><label for="imgsize">{L_INCLUDE_DIMENSIONS}:</label><br /><span>{L_DIMENSIONS_EXPLAIN}</span></dt>
<dd><label><input type="radio" class="radio" name="imgsize" id="imgsize" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="imgsize" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
<dd><label><input type="radio" class="radio" name="imgsize" id="imgsize" onclick="display_options(1);" value="1"<!-- IF IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_YES}</label>
<label><input type="radio" class="radio" name="imgsize" onclick="display_options(0);" value="0"<!-- IF not IMAGE_SIZE --> checked="checked"<!-- ENDIF --> /> {L_NO}</label></dd>
</dl>
<div id="img_dimensions">
<dl>
<dt><label for="imgwidth">{L_IMAGE_WIDTH}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
<dd><input type="text" name="imgwidth" value="{IMAGE_SIZE}" /></dd>
</dl>
<dl>
<dt><label for="imgheight">{L_IMAGE_HEIGHT}:</label><br /><span>{L_AUTOMATIC_EXPLAIN}</span></dt>
<dd><input type="text" name="imgheight" value="{IMAGE_HEIGHT}" /></dd>
</dl>
</div>
</fieldset>
<fieldset class="submit-buttons">

View file

@ -269,6 +269,7 @@ p a {
<li>[Fix] Wrongly applied setting for allowing links in private messages (used the signature setting instead of the post setting) (Bug #11945)</li>
<li>[Fix] Unread flag for multipage topic wrongly set under some conditions (Bug #12127) - fix provided by asinshesq</li>
<li>[Fix] Able to delete posts within user prune panel (Bug #11849)</li>
<li>[Feature] Allow to specify dimensions of images manually on imageset config (Bug #11675)</li>
</ul>

View file

@ -1209,6 +1209,7 @@ parse_css_file = {PARSE_CSS_FILE}
$imgpath = request_var('imgpath', '');
$imgsize = request_var('imgsize', false);
$imgwidth = request_var('imgwidth', 0);
$imgheight = request_var('imgheight', 0);
$imgname = preg_replace('#[^a-z0-9\-+_]#i', '', $imgname);
$imgpath = str_replace('..', '.', $imgpath);
@ -1269,7 +1270,8 @@ parse_css_file = {PARSE_CSS_FILE}
{
// If imgwidth and imgheight are non-zero grab the actual size
// from the image itself ... we ignore width settings for the poll center image
$imgwidth = $imgheight = 0;
$imgwidth = request_var('imgwidth', 0);
$imgheight = request_var('imgheight', 0);
$imglang = '';
if ($imgpath && !file_exists("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath"))
@ -1279,11 +1281,17 @@ parse_css_file = {PARSE_CSS_FILE}
if ($imgsize && $imgpath)
{
list($imgwidth, $imgheight) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
if (!$imgwidth || !$imgheight)
{
list($imgwidth_file, $imgheight_file) = getimagesize("{$phpbb_root_path}styles/$imageset_path/imageset/$imgpath");
$imgwidth = ($imgwidth) ? $imgwidth : $imgwidth_file;
$imgheight = ($imgheight) ? $imgheight : $imgheight_file;
}
$imgwidth = ($imgname != 'poll_center') ? (int) $imgwidth : 0;
$imgheight = (int) $imgheight;
}
if (strpos($imgpath, '/') !== false)
{
list($imglang, $imgfilename) = explode('/', $imgpath);
@ -1442,7 +1450,8 @@ parse_css_file = {PARSE_CSS_FILE}
'L_TITLE' => $user->lang[$this->page_title],
'L_EXPLAIN' => $user->lang[$this->page_title . '_EXPLAIN'],
'IMAGE_OPTIONS' => $img_options,
'IMAGE_SIZE' => $imgsize_bool,
'IMAGE_SIZE' => $image_width,
'IMAGE_HEIGHT' => $image_height,
'IMAGE_REQUEST' => $image_request,
'U_ACTION' => $this->u_action . "&amp;action=edit&amp;id=$imageset_id",
'U_BACK' => $this->u_action,

View file

@ -417,7 +417,7 @@ function split_topic($action, $topic_id, $to_forum_id, $subject)
$post_id_list = array();
while ($row = $db->sql_fetchrow($result))
{
// If splitted from selected post (split_beyond), we split the unapproved items too.
// If split from selected post (split_beyond), we split the unapproved items too.
if (!$row['post_approved'] && !$auth->acl_get('m_approve', $row['forum_id']))
{
// continue;

View file

@ -466,8 +466,8 @@ $lang = array_merge($lang, array(
'LOG_POST_EDITED' => '<strong>Edited post “%1$s” written by</strong><br />» %2$s',
'LOG_REPORT_CLOSED' => '<strong>Closed report</strong><br />» %s',
'LOG_REPORT_DELETED' => '<strong>Deleted report</strong><br />» %s',
'LOG_SPLIT_DESTINATION' => '<strong>Moved splitted posts</strong><br />» to %s',
'LOG_SPLIT_SOURCE' => '<strong>Splitted posts</strong><br />» from %s',
'LOG_SPLIT_DESTINATION' => '<strong>Moved split posts</strong><br />» to %s',
'LOG_SPLIT_SOURCE' => '<strong>Split posts</strong><br />» from %s',
'LOG_TOPIC_DELETED' => '<strong>Deleted topic</strong><br />» %s',
'LOG_TOPIC_APPROVED' => '<strong>Approved topic</strong><br />» %s',

View file

@ -44,6 +44,7 @@ $lang = array_merge($lang, array(
'ADD_THEME' => 'Create theme',
'ADD_THEME_EXPLAIN' => 'Here you can add a new theme. Depending on your server configuration and file permissions you may have additional options here. For example you may be able to base this theme on an existing one. You may also be able to upload or import (from the store directory) a theme archive. If you upload or import an archive the theme name can be optionally taken from the archive name (to do this leave the theme name blank).',
'ARCHIVE_FORMAT' => 'Archive file type',
'AUTOMATIC_EXPLAIN' => 'Leave blank to attempt automatic detection.',
'BACKGROUND' => 'Background',
'BACKGROUND_COLOUR' => 'Background colour',