1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-01-18 22:58:10 +01:00

this is very much work in progress; please feel free to improve markup, usability and to introduce possible further settings (per forum, per user)

git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9688 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Henry Sudhof 2009-06-26 14:36:40 +00:00
parent 366a15d605
commit a130dd31ed
4 changed files with 126 additions and 2 deletions

View File

@ -86,11 +86,13 @@ $lang = array_merge($lang, array(
'PRINT_TOPIC' => 'Print view',
'QUICK_MOD' => 'Quick-mod tools',
'QUICKREPLY' => 'Quick Reply',
'QUOTE' => 'Quote',
'REPLY_TO_TOPIC' => 'Reply to topic',
'RETURN_POST' => '%sReturn to the post%s',
'SHOW_QR' => 'Show Editor',
'SUBMIT_VOTE' => 'Submit vote',
'TOTAL_VOTES' => 'Total votes',

View File

@ -0,0 +1,58 @@
<script type="text/javascript">
// <![CDATA[
function hide_qr(hide)
{
var qr = document.getElementById('qr_editor_div');
var qr_show = document.getElementById('qr_showeditor_div');
qr_show.style.display = (hide) ? '' : 'none';
qr.style.display = (hide) ? 'none' : '';
return true;
}
onload_functions.push('hide_qr(true);');
// ]]>
</script>
<form method="post" action="{U_QR_ACTION}">
<div class="panel" id="qr_editor_div">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<h2>{L_QUICKREPLY}</h2>
<fieldset class="fields1">
<dl style="clear: left;">
<dt><label for="subject">{L_SUBJECT}:</label></dt>
<dd><input type="text" name="subject" id="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" class="inputbox autowidth" /></dd>
</dl>
</fieldset>
<div id="message-box">
<textarea style="height: 9em;" name="message" rows="7" cols="76" tabindex="3" class="inputbox"></textarea>
</div>
<fieldset class="submit-buttons">
{S_FORM_TOKEN}
{S_HIDDEN_FIELDS}
<input type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" class="button1" />&nbsp;
</fieldset>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
<div class="panel" style="display: none" id="qr_showeditor_div" >
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<h2>{L_QUICKREPLY}</h2>
<fieldset class="submit-buttons">
<input type="submit" name="show_qr" tabindex="1" class="button2" value="{L_SHOW_QR}" onclick="hide_qr(false);return false;"/>
</fieldset>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
</form>
<hr />

View File

@ -0,0 +1,23 @@
<form method="post" action="{U_QR_ACTION}">
<table class="tablebg" width="100%" cellspacing="1">
<tr>
<th align="center" colspan="2">{L_QUICKREPLY}</th>
</tr>
<tr>
<td class="row1" width="22%"><b class="genmed">{L_SUBJECT}:</b></td>
<td class="row2" width="78%"><input class="post" style="width:450px" type="text" name="subject" size="45" maxlength="64" tabindex="2" value="{SUBJECT}" /></td>
</tr>
<tr>
<td colspan="2" valign="top" align="center" style="width: 75%;"><textarea name="message" rows="7" cols="76" tabindex="3" style="width: 98%;"></textarea> </td></tr>
<tr>
<td class="cat" colspan="2" align="center">
<input class="btnmain" type="submit" accesskey="s" tabindex="6" name="post" value="{L_SUBMIT}" />
{S_FORM_TOKEN}
{S_HIDDEN_FIELDS}
</td>
</tr>
</table>
</form>
<br clear="all" />

View File

@ -41,6 +41,7 @@ $sort_dir = request_var('sd', $default_sort_dir);
$update = request_var('update', false);
$s_can_vote = false;
/**
* @todo normalize?
*/
@ -695,7 +696,7 @@ if (!empty($topic_data['poll_start']))
if ($update && $s_can_vote)
{
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id))
if (!sizeof($voted_id) || sizeof($voted_id) > $topic_data['poll_max_options'] || in_array(VOTE_CONVERTED, $cur_voted_id) || !check_form_key('posting'))
{
$redirect_url = append_sid("{$phpbb_root_path}viewtopic.$phpEx", "f=$forum_id&amp;t=$topic_id&amp;start=$start");
@ -708,10 +709,14 @@ if (!empty($topic_data['poll_start']))
{
$message = 'TOO_MANY_VOTE_OPTIONS';
}
else
else if (in_array(VOTE_CONVERTED, $cur_voted_id))
{
$message = 'VOTE_CONVERTED';
}
else
{
$message = 'FORM_INVALID';
}
$message = $user->lang[$message] . '<br /><br />' . sprintf($user->lang['RETURN_TOPIC'], '<a href="' . $redirect_url . '">', '</a>');
trigger_error($message);
@ -1422,6 +1427,7 @@ for ($i = 0, $end = sizeof($post_list); $i < $end; ++$i)
{
$s_first_unread = $first_unread = true;
}
//
$postrow = array(
@ -1598,6 +1604,41 @@ else if (!$all_marked_read)
}
}
// let's set up quick_reply
// TODO: introduce a per-forum and a per-user setting
if ($s_can_vote || $config['allow_quick_reply'])
{
add_form_key('posting');
if ($user->data['is_registered'] && $config['allow_quick_reply'])
{
$s_attach_sig = $config['allow_sig'] && strlen($user->data['user_sig']) && $user->optionget('attachsig') && $auth->acl_get('f_sigs', $forum_id) && $auth->acl_get('u_sig');
$s_smilies = $config['allow_smilies'] && $user->optionget('smilies') && $auth->acl_get('f_smilies', $forum_id);
$s_bbcode = $config['allow_bbcode'] && $user->optionget('bbcode') && $auth->acl_get('f_bbcode', $forum_id);
$s_notify = $config['allow_topic_notify'] && $user->data['user_notify'];
$qr_hidden_fields = array(
'topic_cur_post_id' => $topic_data['topic_last_post_id'],
'lastclick' => time(),
'topic_id' => $topic_data['topic_id'],
'forum_id' => $forum_id,
'disable_bbcode' => !$s_bbcode,
'disable_smilies' => !$s_smilies,
'disable_magic_url' => !$config['allow_post_links'],
'attach_sig' => $s_attach_sig,
'notify' => $s_notify,
);
$template->assign_vars(array(
'S_QUICK_REPLY' => true,
'U_QR_ACTION' => append_sid("{$phpbb_root_path}posting.$phpEx", "mode=reply&amp;f=$forum_id&amp;t=$topic_id"),
'QR_HIDDEN_FIELDS' => build_hidden_fields($qr_hidden_fields),
'SUBJECT' => 'Re: ' . censor_text($topic_data['topic_title']),
));
}
}
// We overwrite $_REQUEST['f'] if there is no forum specified
// to be able to display the correct online list.
// One downside is that the user currently viewing this topic/post is not taken into account.