fixes for search button in header - #10389, #10225, #9548

added missing colour swatch to prosilver - #8657
language changes - #10387, #10375, #10373, #10353, #10279
line-height for font size (still not ideal) - #10317
Search load setting checked in sessions.php along with limit_load and also reset if not possible to determine load - #10383
Fix editing issues - #9660


git-svn-id: file:///svn/phpbb/trunk@7451 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2007-05-02 16:19:35 +00:00
parent f4b6f87641
commit 15aee89200
20 changed files with 125 additions and 66 deletions

View file

@ -51,7 +51,7 @@
<dl>
<dt><label for="banlength">{L_BAN_LENGTH}:</label></dt>
<dd><select name="banlength" id="banlength">{S_BAN_END_OPTIONS}</select></dd>
<dd><input type="text" name="banlengthother" maxlength="10" /> (YYYY-MM-DD)</dd>
<dd><input type="text" name="banlengthother" maxlength="10" /> {L_YEAR_MONTH_DAY}</dd>
</dl>
<dl>
<dt><label for="banexclude">{L_BAN_EXCLUDE}:</label><br /><span>{L_BAN_EXCLUDE_EXPLAIN}</span></dt>

View file

@ -1478,24 +1478,22 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
case 'edit_first_post':
case 'edit':
if (!$auth->acl_get('m_edit', $data['forum_id']) || $data['post_edit_reason'])
{
$sql_data[POSTS_TABLE]['sql'] = array(
'post_edit_time' => $current_time
);
$sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1';
}
// no break
case 'edit_last_post':
case 'edit_topic':
if (($post_mode == 'edit_last_post' || $post_mode == 'edit_topic') && $data['post_edit_reason'])
// If edit reason is given always display edit info
// If editing last post then display no edit info
// If m_edit permission then display no edit info
// If normal edit display edit info
// Display edit info if edit reason given or user is editing his post, which is not the last within the topic.
if ($data['post_edit_reason'] || (!$auth->acl_get('m_edit', $data['forum_id']) && ($post_mode == 'edit' || $post_mode == 'edit_first_post')))
{
$sql_data[POSTS_TABLE]['sql'] = array(
'post_edit_time' => $current_time
'post_edit_time' => $current_time,
'post_edit_reason' => $data['post_edit_reason'],
'post_edit_user' => (int) $data['post_edit_user'],
);
$sql_data[POSTS_TABLE]['stat'][] = 'post_edit_count = post_edit_count + 1';
@ -1517,8 +1515,6 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
'enable_sig' => $data['enable_sig'],
'post_username' => ($username && $data['poster_id'] == ANONYMOUS) ? $username : '',
'post_subject' => $subject,
'post_edit_reason' => $data['post_edit_reason'],
'post_edit_user' => (int) $data['post_edit_user'],
'post_checksum' => $data['message_md5'],
'post_attachment' => (!empty($data['attachment_data'])) ? 1 : 0,
'bbcode_bitfield' => $data['bbcode_bitfield'],

View file

@ -198,7 +198,7 @@ class session
$this->load = false;
// Load limit check (if applicable)
if ($config['limit_load'])
if ($config['limit_load'] || $config['limit_search_load'])
{
if ($load = @file_get_contents('/proc/loadavg'))
{
@ -208,6 +208,7 @@ class session
else
{
set_config('limit_load', '0');
set_config('limit_search_load', '0');
}
}

View file

@ -500,7 +500,7 @@ class ucp_profile
// Build custom bbcodes array
display_custom_bbcodes();
break;
case 'avatar':

View file

@ -50,7 +50,7 @@ $lang = array_merge($lang, array(
'CP_LANG_NAME' => 'Field name/title presented to the user',
'CP_LANG_OPTIONS' => 'Options',
'CREATE_NEW_FIELD' => 'Create new field',
'CUSTOM_FIELDS_NOT_TRANSLATED' => 'At least one custom profile field has not yet been translated. Please enter the required information by clicking on the &quot;Translate&quot; link.',
'CUSTOM_FIELDS_NOT_TRANSLATED' => 'At least one custom profile field has not yet been translated. Please enter the required information by clicking on the “Translate” link.',
'DEFAULT_ISO_LANGUAGE' => 'Default language [%s]',
'DEFAULT_LANGUAGE_NOT_FILLED' => 'The language entries for the default language are not filled for this profile field.',
@ -62,7 +62,7 @@ $lang = array_merge($lang, array(
'DISPLAY_AT_REGISTER' => 'Display at registration screen',
'DISPLAY_AT_REGISTER_EXPLAIN' => 'If this option is enabled, the field will be displayed on registration and able to be changed within the user control panel.',
'DISPLAY_PROFILE_FIELD' => 'Display profile field',
'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown on viewtopic/viewprofile/memberlist. if this is enabled within the load settings. Only showing within the users profile is enabled by default.',
'DISPLAY_PROFILE_FIELD_EXPLAIN' => 'The profile field will be shown on viewtopic/viewprofile/memberlist, if this is enabled within the load settings. Only showing within the users profile is enabled by default.',
'DROPDOWN_ENTRIES_EXPLAIN' => 'Enter your options now, every option in one line',
'EDIT_DROPDOWN_LANG_EXPLAIN' => 'Please note that you are able to change your options text and also able to add new options to the end. It is not advised to add new options between existing options - this could result in wrong options assigned to your users. This can also happen if you remove options in-between. Removing options from the end result in users having assigned this item now reverting back to the default one.',

View file

@ -29,6 +29,10 @@ if (empty($lang) || !is_array($lang))
// You do not need this where single placeholders are used, e.g. 'Message %d' is fine
// equally where a string contains only two placeholders which are used to wrap text
// in a url you again do not need to specify an order e.g., 'Click %sHERE%s' is fine
//
// Some characters you may want to copy&paste:
// » “ ”
//
$lang = array_merge($lang, array(
'TRANSLATION_INFO' => '',
@ -635,6 +639,7 @@ $lang = array_merge($lang, array(
'WRONG_DATA_WEBSITE' => 'The website address has to be a valid URL, including the protocol. For example http://www.example.com/.',
'YEAR' => 'Year',
'YEAR_MONTH_DAY' => '(YYYY-MM-DD)',
'YES' => 'Yes',
'YIM' => 'YIM',
'YOU_LAST_VISIT' => 'Last visit was: %s',

View file

@ -56,11 +56,11 @@ $help = array(
),
array(
0 => 'Quoting text in replies',
1 => 'There are two ways you can quote text, with a reference or without.<ul><li>When you utilise the Quote function to reply to a post on the board you should notice that the post text is added to the message window enclosed in a <strong>[quote=""][/quote]</strong> block. This method allows you to quote with a reference to a person or whatever else you choose to put! For example to quote a piece of text Mr. Blobby wrote you would enter:<br /><br /><strong>[quote="Mr. Blobby"]</strong>The text Mr. Blobby wrote would go here<strong>[/quote]</strong><br /><br />The resulting output will automatically add, Mr. Blobby wrote: before the actual text. Remember you <strong>must</strong> include the parenthesis "" around the name you are quoting, they are not optional.</li><li>The second method allows you to blindly quote something. To utilise this enclose the text in <strong>[quote][/quote]</strong> tags. When you view the message it will simply show the text within a quotation block.</li></ul>'
1 => 'There are two ways you can quote text, with a reference or without.<ul><li>When you utilise the Quote function to reply to a post on the board you should notice that the post text is added to the message window enclosed in a <strong>[quote=&quot;&quot;][/quote]</strong> block. This method allows you to quote with a reference to a person or whatever else you choose to put! For example to quote a piece of text Mr. Blobby wrote you would enter:<br /><br /><strong>[quote=&quot;Mr. Blobby&quot;]</strong>The text Mr. Blobby wrote would go here<strong>[/quote]</strong><br /><br />The resulting output will automatically add, Mr. Blobby wrote: before the actual text. Remember you <strong>must</strong> include the quotation marks &quot;&quot; around the name you are quoting, they are not optional.</li><li>The second method allows you to blindly quote something. To utilise this enclose the text in <strong>[quote][/quote]</strong> tags. When you view the message it will simply show the text within a quotation block.</li></ul>'
),
array(
0 => 'Outputting code or fixed width data',
1 => 'If you want to output a piece of code or in fact anything that requires a fixed width, eg. Courier type font you should enclose the text in <strong>[code][/code]</strong> tags, eg.<br /><br /><strong>[code]</strong>echo "This is some code";<strong>[/code]</strong><br /><br />All formatting used within <strong>[code][/code]</strong> tags is retained when you later view it.'
1 => 'If you want to output a piece of code or in fact anything that requires a fixed width, eg. Courier type font you should enclose the text in <strong>[code][/code]</strong> tags, eg.<br /><br /><strong>[code]</strong>echo &quot;This is some code&quot;;<strong>[/code]</strong><br /><br />All formatting used within <strong>[code][/code]</strong> tags is retained when you later view it.'
),
array(
0 => '--',

View file

@ -91,6 +91,7 @@ $lang = array_merge($lang, array(
'FLASH_IS_ON' => '[flash] is <em>ON</em>',
'FLOOD_ERROR' => 'You cannot make another post so soon after your last.',
'FONT_COLOR' => 'Font color',
'FONT_COLOR_HIDE' => 'Hide font color',
'FONT_HUGE' => 'Huge',
'FONT_LARGE' => 'Large',
'FONT_NORMAL' => 'Normal',
@ -179,7 +180,7 @@ $lang = array_merge($lang, array(
'TOO_FEW_CHARS' => 'Your message contains too few characters.',
'TOO_FEW_POLL_OPTIONS' => 'You must enter at least two poll options',
'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maxmimum.',
'TOO_MANY_ATTACHMENTS' => 'Cannot add another attachment, %d is the maximum.',
'TOO_MANY_CHARS' => 'Your message contains too many characters.',
'TOO_MANY_POLL_OPTIONS' => 'You have tried to enter too many poll options',
'TOO_MANY_SMILIES' => 'Your message contains too many smilies. The maximum number of smilies allowed is %d.',

View file

@ -1010,8 +1010,9 @@ $template->assign_vars(array(
'S_FORUM_OPTIONS' => $s_forums,
'S_SELECT_SORT_DIR' => $s_sort_dir,
'S_SELECT_SORT_KEY' => $s_sort_key,
'S_SELECT_SORT_DAYS' => $s_limit_days)
);
'S_SELECT_SORT_DAYS' => $s_limit_days,
'S_IN_SEARCH' => true,
));
// Handle large objects differently for Oracle and MSSQL
switch ($db->sql_layer)

View file

@ -29,7 +29,7 @@
<!-- BEGIN color --><span style="color: {COLOR}">{TEXT}</span><!-- END color -->
<!-- BEGIN size --><span style="font-size: {SIZE}%;">{TEXT}</span><!-- END size -->
<!-- BEGIN size --><span style="font-size: {SIZE}%; line-height: 116%;">{TEXT}</span><!-- END size -->
<!-- BEGIN img --><img src="{URL}" alt="{L_IMAGE}" /><!-- END img -->

View file

@ -64,7 +64,7 @@ function bbstyle(bbnumber)
else
{
insert_text('[*]');
document.forms[form_name].elements[text_name].focus();
document.forms[form_name].elements[text_name].focus();
}
}
@ -118,9 +118,8 @@ function bbfontstyle(bbopen, bbclose)
// IE
else if (document.selection)
{
var range = textarea.createTextRange();
range.move("character", new_pos);
range.move("character", new_pos);
range.select();
storeCaret(textarea);
}
@ -157,18 +156,17 @@ function insert_text(text, spaces, popup)
mozWrap(textarea, text, '')
textarea.selectionStart = sel_start + text.length;
textarea.selectionEnd = sel_end + text.length;
}
}
else if (textarea.createTextRange && textarea.caretPos)
{
if (baseHeight != textarea.caretPos.boundingHeight)
{
textarea.focus();
storeCaret(textarea);
}
}
var caret_pos = textarea.caretPos;
caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text;
}
else
{
@ -177,8 +175,7 @@ function insert_text(text, spaces, popup)
if (!popup)
{
textarea.focus();
}
}
}
/**
@ -329,7 +326,7 @@ function colorPalette(dir, width, height)
{
color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]);
document.write('<td bgcolor="#' + color + '">');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;" onmouseover="helpline(\'s\');" onmouseout="helpline(\'tip\');"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>');
document.writeln('</td>');
}

View file

@ -50,7 +50,7 @@
<dl>
<dt><label for="banlength">{L_BAN_LENGTH}:</label></dt>
<dd><label for="banlength"><select name="banlength" id="banlength" onchange="if(this.value==-1){document.getElementById('banlengthother').style.display = 'block';}else{document.getElementById('banlengthother').style.display='none';}">{S_BAN_END_OPTIONS}</select></label></dd>
<dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>(YYYY-MM-DD)</span></label></dd>
<dd id="banlengthother" style="display: none;"><label><input type="text" name="banlengthother" class="inputbox" /><br /><span>{L_YEAR_MONTH_DAY}</span></label></dd>
</dl>
<dl>
<dt><label for="banreason">{L_BAN_REASON}:</label></dt>

View file

@ -99,10 +99,24 @@
<div class="headerbar">
<div class="inner"><span class="corners-top"><span></span></span>
<a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
<h1>{SITENAME}</h1>
<p>{SITE_DESCRIPTION}</p>
<p style="display: none;"><a href="#start_here">{L_SKIP}</a></p>
<div id="site-description">
<a href="{U_INDEX}" title="{L_INDEX}" id="logo">{SITE_LOGO_IMG}</a>
<h1>{SITENAME}</h1>
<p>{SITE_DESCRIPTION}</p>
<p style="display: none;"><a href="#start_here">{L_SKIP}</a></p>
</div>
<!-- IF not S_IN_SEARCH -->
<div id="search-box">
<form action="{U_SEARCH}" method="get" id="search">
<fieldset>
<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" accesskey="s" />
<input class="button2" value="{L_SEARCH}" type="submit" /><br />
<a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_HIDDEN_FIELDS}
</fieldset>
</form>
</div>
<!-- ENDIF -->
<span class="corners-bottom"><span></span></span></div>
</div>
@ -147,16 +161,6 @@
<span class="corners-bottom"><span></span></span></div>
</div>
<div id="search-box">
<form action="{U_SEARCH}" method="get" id="search">
<fieldset>
<input name="keywords" id="keywords" type="text" maxlength="128" title="{L_SEARCH_KEYWORDS}" class="inputbox search" value="<!-- IF SEARCH_WORDS-->{SEARCH_WORDS}<!-- ELSE -->{L_SEARCH_MINI}<!-- ENDIF -->" onclick="if(this.value=='{LA_SEARCH_MINI}')this.value='';" onblur="if(this.value=='')this.value='{LA_SEARCH_MINI}';" accesskey="s" />
<input class="button2" value="{L_SEARCH}" type="submit" /><br />
<a href="{U_SEARCH}" title="{L_SEARCH_ADV_EXPLAIN}">{L_SEARCH_ADV}</a> {S_HIDDEN_FIELDS}
</fieldset>
</form>
</div>
</div>
<a name="start_here"></a>

View file

@ -1,3 +1,4 @@
<script type="text/javascript">
<!--
var form_name = 'postform';
@ -58,6 +59,33 @@
<script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>
<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
<dl style="clear: left;">
<dt><label>{L_FONT_COLOR}:</label></dt>
<dd><script type="text/javascript">
<!--
function change_palette()
{
dE('colour_palette');
e = document.getElementById('colour_palette');
if (e.style.display == 'block')
{
document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}';
}
else
{
document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
}
}
colorPalette('h', 15, 5);
//-->
</script>
</dd>
</dl>
</div>
<div id="format-buttons">
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
@ -85,8 +113,9 @@
<option value="150">{L_FONT_LARGE}</option>
<option value="200">{L_FONT_HUGE}</option>
</select>
<input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
<!-- BEGIN custom_tags -->
<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
<!-- END custom_tags -->
</div>
<!-- ENDIF -->
<!-- ENDIF -->

View file

@ -118,7 +118,7 @@
<!-- ENDIF -->
<!-- IF BBCODE_STATUS -->
<hr />
<!-- IF .smiley --><hr /><!-- ENDIF -->
{BBCODE_STATUS}<br />
<!-- IF S_BBCODE_ALLOWED -->
{IMG_STATUS}<br />

View file

@ -128,6 +128,7 @@ p.right {
float: left;
width: auto;
padding: 10px 13px 0 10px;
height: auto;
}
a#logo:hover {
@ -138,14 +139,22 @@ a#logo:hover {
--------------------------------------------- */
#search-box {
color: #FFFFFF;
position: absolute;
right: 35px;
top: 35px;
width: 17em;
position: relative;
margin-top: 30px;
margin-right: 5px;
display: block;
float: right;
text-align: right;
white-space: nowrap; /* For Opera */
}
.rtl #search-box {
float: left;
text-align: left;
margin-right: 0;
margin-left: 5px;
}
#search-box #keywords {
width: 95px;
background-color: #FFF;
@ -170,6 +179,16 @@ a#logo:hover {
margin-right: 3px;
}
/* Site description and logo */
#site-description {
float: left;
width: 70%;
}
.rtl #site-description {
float: right;
}
/* Round cornered boxes and backgrounds
---------------------------------------- */
.headerbar {

View file

@ -73,7 +73,6 @@ a.topictitle:active {
/* Post body links */
.postlink {
text-decoration: none;
color: #d2d2d2;
border-bottom: 1px solid #d2d2d2;
padding-bottom: 0;

View file

@ -52,4 +52,13 @@ dl.icon {
min-height: 35px;
height: auto !important;
height: 35px;
}
* html #search-box {
margin-right: 35px;
}
* html .rtl #search-box {
margin-right: 0;
margin-left: 35px;
}

View file

@ -64,7 +64,7 @@ function bbstyle(bbnumber)
else
{
insert_text('[*]');
document.forms[form_name].elements[text_name].focus();
document.forms[form_name].elements[text_name].focus();
}
}
@ -103,7 +103,7 @@ function bbfontstyle(bbopen, bbclose)
//The new position for the cursor after adding the bbcode
var caret_pos = getCaretPosition(textarea).start;
var new_pos = caret_pos + bbopen.length;
var new_pos = caret_pos + bbopen.length;
// Open tag
insert_text(bbopen + bbclose);
@ -118,9 +118,8 @@ function bbfontstyle(bbopen, bbclose)
// IE
else if (document.selection)
{
var range = textarea.createTextRange();
range.move("character", new_pos);
range.move("character", new_pos);
range.select();
storeCaret(textarea);
}
@ -230,7 +229,7 @@ function addquote(post_id, username)
theSelection = theSelection.replace(/<br\/>/ig, '\n');
theSelection = theSelection.replace(/&lt\;/ig, '<');
theSelection = theSelection.replace(/&gt\;/ig, '>');
theSelection = theSelection.replace(/&amp\;/ig, '&');
theSelection = theSelection.replace(/&amp\;/ig, '&');
}
else if (document.all)
{
@ -374,7 +373,6 @@ function getCaretPosition(txtarea)
// dirty and slow IE way
else if(document.selection)
{
// get current selection
var range = document.selection.createRange();
@ -393,7 +391,7 @@ function getCaretPosition(txtarea)
// we ignore the end value for IE, this is already dirty enough and we don't need it
caretPos.start = txtarea.sel_start;
caretPos.end = txtarea.sel_start;
caretPos.end = txtarea.sel_start;
}
return caretPos;

View file

@ -49,7 +49,7 @@
</tr>
<tr>
<td class="row1" valign="top"><b>{L_BAN_LENGTH}:</b></td>
<td class="row2"><select name="banlength">{S_BAN_END_OPTIONS}</select><br /><input type="text" name="banlengthother" class="post" /> (YYYY-MM-DD)</td>
<td class="row2"><select name="banlength">{S_BAN_END_OPTIONS}</select><br /><input type="text" name="banlengthother" class="post" /> {L_YEAR_MONTH_DAY}</td>
</tr>
<tr>
<td class="row1" valign="top"><b>{L_BAN_EXCLUDE}:</b><br /><span class="gensmall">{L_BAN_EXCLUDE_EXPLAIN}</span></td>