1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-05-06 15:45:34 +02:00

some small fixes

got rid of iframe (topic review)... tested new div method with various browsers, further testing and oppinions would be nice. ;)
NOTE: New css element added to theme


git-svn-id: file:///svn/phpbb/trunk@4510 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2003-09-24 19:41:14 +00:00
parent f614337627
commit 8675e30366
7 changed files with 58 additions and 87 deletions

View File

@ -348,11 +348,11 @@ if ($submit && $mode == 'ext_groups')
// Add Extensions Group ? // Add Extensions Group ?
$extension_group = (isset($_POST['add_extension_group'])) ? trim(strip_tags($_POST['add_extension_group'])) : ''; $extension_group = (isset($_POST['add_extension_group'])) ? trim(strip_tags($_POST['add_extension_group'])) : '';
$download_mode = (isset($_POST['add_download_mode'])) ? $_POST['add_download_mode'] : ''; $download_mode = (isset($_POST['add_download_mode'])) ? $_POST['add_download_mode'] : '';
$cat_id = (isset($_POST['add_category'])) ? $_POST['add_category'] : ''; $cat_id = (isset($_POST['add_category'])) ? (int) $_POST['add_category'] : 0;
$upload_icon = (isset($_POST['add_upload_icon'])) ? $_POST['add_upload_icon'] : ''; $upload_icon = (isset($_POST['add_upload_icon'])) ? htmlspecialchars($_POST['add_upload_icon']) : '';
$filesize = (isset($_POST['add_max_filesize'])) ? $_POST['add_max_filesize'] : ''; $filesize = (isset($_POST['add_max_filesize'])) ? $_POST['add_max_filesize'] : '';
$size_select = (isset($_POST['add_size_select'])) ? $_POST['add_size_select'] : ''; $size_select = (isset($_POST['add_size_select'])) ? htmlspecialchars($_POST['add_size_select']) : '';
$is_allowed = (isset($_POST['add_allowed'])) ? 1 : 0; $is_allowed = (isset($_POST['add_allowed'])) ? TRUE : FALSE;
$add = (isset($_POST['add_extension_group_check'])) ? TRUE : FALSE; $add = (isset($_POST['add_extension_group_check'])) ? TRUE : FALSE;
if ($extension_group != '' && $add) if ($extension_group != '' && $add)
@ -953,7 +953,7 @@ function size_select($select_name, $size_compare)
} }
// Build Select for category items // Build Select for category items
function category_select($select_name, $group_id = -1) function category_select($select_name, $group_id = FALSE)
{ {
global $db, $user; global $db, $user;
@ -964,7 +964,7 @@ function category_select($select_name, $group_id = -1)
RM_CAT => $user->lang['CAT_RM_FILES'] RM_CAT => $user->lang['CAT_RM_FILES']
); );
if ($group_id != -1) if ($group_id)
{ {
$sql = 'SELECT cat_id $sql = 'SELECT cat_id
FROM ' . EXTENSION_GROUPS_TABLE . ' FROM ' . EXTENSION_GROUPS_TABLE . '
@ -994,7 +994,7 @@ function category_select($select_name, $group_id = -1)
} }
// Extension group select // Extension group select
function group_select($select_name, $default_group = -1) function group_select($select_name, $default_group = '-1')
{ {
global $db, $user; global $db, $user;
@ -1018,7 +1018,7 @@ function group_select($select_name, $default_group = -1)
for ($i = 0; $i < count($group_name); $i++) for ($i = 0; $i < count($group_name); $i++)
{ {
if ($default_group == -1) if ($default_group == '-1')
{ {
$selected = ($i == 0) ? ' selected="selected"' : ''; $selected = ($i == 0) ? ' selected="selected"' : '';
} }
@ -1036,7 +1036,7 @@ function group_select($select_name, $default_group = -1)
} }
// Build select for download modes // Build select for download modes
function download_select($select_name, $group_id = -1) function download_select($select_name, $group_id = FALSE)
{ {
global $db, $user; global $db, $user;
@ -1045,7 +1045,7 @@ function download_select($select_name, $group_id = -1)
PHYSICAL_LINK => $user->lang['MODE_PHYSICAL'] PHYSICAL_LINK => $user->lang['MODE_PHYSICAL']
); );
if ($group_id != -1) if ($group_id)
{ {
$sql = "SELECT download_mode $sql = "SELECT download_mode
FROM " . EXTENSION_GROUPS_TABLE . " FROM " . EXTENSION_GROUPS_TABLE . "

View File

@ -66,7 +66,7 @@ function generate_smilies($mode)
{ {
$template->assign_vars(array( $template->assign_vars(array(
'S_SHOW_EMOTICON_LINK' => TRUE, 'S_SHOW_EMOTICON_LINK' => TRUE,
'U_MORE_SMILIES' => "posting.$phpEx$SID&amp;mode=smilies") 'U_MORE_SMILIES' => $phpbb_root_path . "posting.$phpEx$SID&amp;mode=smilies")
); );
} }
} }

View File

@ -639,14 +639,16 @@ class parse_message
FROM ' . SMILIES_TABLE; FROM ' . SMILIES_TABLE;
$result = $db->sql_query($sql); $result = $db->sql_query($sql);
// TEMP - maybe easier regular expression processing... at the moment two newlines prevents smilie substitution.
$this->message = str_replace("\n", "\\n", $this->message);
if ($row = $db->sql_fetchrow($result)) if ($row = $db->sql_fetchrow($result))
{ {
$match = $replace = array(); $match = $replace = array();
do do
{ {
// $match[] = '#(' . preg_quote($row['code'], '#') . ')#'; $match[] = "#(?<=.\W|\W.|\W)" . preg_quote($row['code'], '#') . "(?=.\W|\W.|\W$)#";
$match[] = "#(?<=.\W|\W.|^\W)" . preg_quote($row['code'], '#') . "(?=.\W|\W.|\W$)#";
$replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILE_PATH}/' . $row['smile_url'] . '" border="0" alt="' . $row['emoticon'] . '" title="' . $row['emoticon'] . '" /><!-- s' . $row['code'] . ' -->'; $replace[] = '<!-- s' . $row['code'] . ' --><img src="{SMILE_PATH}/' . $row['smile_url'] . '" border="0" alt="' . $row['emoticon'] . '" title="' . $row['emoticon'] . '" /><!-- s' . $row['code'] . ' -->';
} }
while ($row = $db->sql_fetchrow($result)); while ($row = $db->sql_fetchrow($result));
@ -657,12 +659,14 @@ class parse_message
if ($num_matches !== FALSE && $num_matches > intval($config['max_post_smilies'])) if ($num_matches !== FALSE && $num_matches > intval($config['max_post_smilies']))
{ {
$this->message = str_replace("\\n", "\n", $this->message);
$this->warn_msg[] = $user->lang['TOO_MANY_SMILIES']; $this->warn_msg[] = $user->lang['TOO_MANY_SMILIES'];
return; return;
} }
} }
$this->message = trim(preg_replace($match, $replace, ' ' . $this->message . ' ')); $this->message = trim(preg_replace($match, $replace, ' ' . $this->message . ' '));
$this->message = str_replace("\\n", "\n", $this->message);
} }
} }
@ -727,8 +731,8 @@ class parse_message
// Perform actions on temporary attachments // Perform actions on temporary attachments
if ($delete_file) if ($delete_file)
{ {
foreach ($_POST['delete_file'] as $index => $value) $index = (int) key($_POST['delete_file']);
{
// delete selected attachment // delete selected attachment
if ($this->attachment_data[$index]['attach_id'] == '-1') if ($this->attachment_data[$index]['attach_id'] == '-1')
{ {
@ -743,11 +747,17 @@ class parse_message
{ {
delete_attachments($post_id, intval($this->attachment_data[$index]['attach_id'])); delete_attachments($post_id, intval($this->attachment_data[$index]['attach_id']));
} }
unset($this->attachment_data[$index]);
}
// a quick way to reindex the array. :) unset($this->attachment_data[$index]);
$this->attachment_data = array_merge($this->attachment_data);
// Reindex Array
$attachment_data = $this->attachment_data;
unset($this->attachment_data);
foreach ($attachment_data as $element)
{
$this->attachment_data[] = $element;
}
unset($attachment_data);
} }
else if ($edit_comment || $add_file || $preview) else if ($edit_comment || $add_file || $preview)
{ {

View File

@ -56,7 +56,7 @@ if ($cancel || time() - $lastclick < 2)
redirect($redirect); redirect($redirect);
} }
if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete', 'topicreview')) && !$forum_id) if (in_array($mode, array('post', 'reply', 'quote', 'edit', 'delete')) && !$forum_id)
{ {
trigger_error($user->lang['NO_FORUM']); trigger_error($user->lang['NO_FORUM']);
} }
@ -101,15 +101,6 @@ switch ($mode)
OR f.forum_id = $forum_id)"; OR f.forum_id = $forum_id)";
break; break;
case 'topicreview':
if (!$topic_id)
{
trigger_error($user->lang['NO_TOPIC']);
}
topic_review($topic_id, $forum_id, FALSE);
break;
case 'smilies': case 'smilies':
generate_smilies('window'); generate_smilies('window');
break; break;
@ -370,8 +361,10 @@ if ($mode == 'delete')
$html_status = ($config['allow_html'] && $auth->acl_get('f_html', $forum_id)) ? TRUE : FALSE; $html_status = ($config['allow_html'] && $auth->acl_get('f_html', $forum_id)) ? TRUE : FALSE;
$bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? TRUE : FALSE; $bbcode_status = ($config['allow_bbcode'] && $auth->acl_get('f_bbcode', $forum_id)) ? TRUE : FALSE;
$smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? TRUE : FALSE; $smilies_status = ($config['allow_smilies'] && $auth->acl_get('f_smilies', $forum_id)) ? TRUE : FALSE;
$img_status = ($config['allow_img'] && $auth->acl_get('f_img', $forum_id)) ? TRUE : FALSE; //$img_status = ($config['allow_img'] && $auth->acl_get('f_img', $forum_id)) ? TRUE : FALSE;
$flash_status = ($config['allow_flash'] && $auth->acl_get('f_flash', $forum_id)) ? TRUE : FALSE; $img_status = ($auth->acl_get('f_img', $forum_id)) ? TRUE : FALSE;
//$flash_status = ($config['allow_flash'] && $auth->acl_get('f_flash', $forum_id)) ? TRUE : FALSE;
$flash_status = ($auth->acl_get('f_flash', $forum_id)) ? TRUE : FALSE;
// Save Draft // Save Draft
@ -981,7 +974,6 @@ $template->assign_vars(array(
'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=" . $forum_id, 'U_VIEW_FORUM' => "viewforum.$phpEx$SID&amp;f=" . $forum_id,
'U_VIEWTOPIC' => ($mode != 'post') ? "viewtopic.$phpEx$SID&amp;$forum_id&amp;t=$topic_id" : '', 'U_VIEWTOPIC' => ($mode != 'post') ? "viewtopic.$phpEx$SID&amp;$forum_id&amp;t=$topic_id" : '',
'U_REVIEW_TOPIC' => ($mode != 'post') ? "posting.$phpEx$SID&amp;mode=topicreview&amp;f=$forum_id&amp;t=$topic_id" : '',
'S_DISPLAY_PREVIEW' => ($preview && !sizeof($error)), 'S_DISPLAY_PREVIEW' => ($preview && !sizeof($error)),
'S_EDIT_POST' => ($mode == 'edit'), 'S_EDIT_POST' => ($mode == 'edit'),
@ -1096,7 +1088,7 @@ make_jumpbox('viewforum.'.$phpEx);
// Topic review // Topic review
if ($mode == 'reply' || $mode == 'quote') if ($mode == 'reply' || $mode == 'quote')
{ {
topic_review($topic_id, $forum_id, TRUE); topic_review($topic_id, $forum_id);
} }
page_footer(); page_footer();
@ -1367,22 +1359,10 @@ function user_notification($mode, $subject, $forum_id, $topic_id, $post_id)
} }
} }
// Topic Review // Topic Review
function topic_review($topic_id, $forum_id, $is_inline_review = FALSE) function topic_review($topic_id, $forum_id)
{ {
global $template; global $user, $auth, $db, $template, $bbcode, $template;
if ($is_inline_review)
{
$template->assign_vars(array(
'S_DISPLAY_INLINE' => TRUE)
);
return;
}
global $user, $auth, $db, $template, $bbcode;
global $censors, $config, $phpbb_root_path, $phpEx, $SID; global $censors, $config, $phpbb_root_path, $phpEx, $SID;
// Define censored word matches // Define censored word matches
@ -1491,19 +1471,10 @@ function topic_review($topic_id, $forum_id, $is_inline_review = FALSE)
unset($rowset[$i]); unset($rowset[$i]);
} }
//
$template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['QUOTE_POST'])); $template->assign_var('QUOTE_IMG', $user->img('btn_quote', $user->lang['QUOTE_POST']));
//
page_header($page_title);
$template->set_filenames(array(
'body' => 'posting_topic_review.html')
);
page_footer();
} }
// Temp Function - strtolower - borrowed from php.net // Temp Function - strtolower - borrowed from php.net
function phpbb_strtolower($string) function phpbb_strtolower($string)
{ {
@ -2042,7 +2013,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
$db->sql_query($sql); $db->sql_query($sql);
} }
} }
/*
if (count($attach_data)) if (count($attach_data))
{ {
$sql = 'UPDATE ' . POSTS_TABLE . ' $sql = 'UPDATE ' . POSTS_TABLE . '
@ -2055,7 +2026,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
WHERE topic_id = ' . $data['topic_id']; WHERE topic_id = ' . $data['topic_id'];
$db->sql_query($sql); $db->sql_query($sql);
} }
*/
} }
$db->sql_transaction('commit'); $db->sql_transaction('commit');

View File

@ -1,17 +1,11 @@
<!-- $Id$ --> <!-- $Id$ -->
<!-- IF S_DISPLAY_INLINE -->
<table class="tablebg" width="95%" border="0" cellpadding="3" cellspacing="1" align="center"> <table class="tablebg" width="95%" border="0" cellpadding="3" cellspacing="1" align="center">
<tr> <tr>
<th height="28" align="center">{L_TOPIC_REVIEW}</th> <th height="28" align="center">{L_TOPIC_REVIEW}</th>
</tr> </tr>
<tr> <tr>
<td class="row1"><iframe width="100%" height="300" name="review_window" src="{U_REVIEW_TOPIC}"> <td class="row1"><div class="postreview">
<!-- ELSE -->
<!-- INCLUDE simple_header.html -->
<script language="javascript" type="text/javascript" src="styles/subSilver/template/editor.js"></script> <script language="javascript" type="text/javascript" src="styles/subSilver/template/editor.js"></script>
@ -120,14 +114,7 @@ function addquote(post_id, username) {
<!-- END postrow --> <!-- END postrow -->
</table> </table>
<!-- ENDIF --> </div></td>
</tr>
<!-- IF S_DISPLAY_INLINE -->
</iframe></td>
</tr>
</table> </table>
<!-- ELSE -->
<!-- INCLUDE simple_footer.html -->
<!-- ENDIF -->

View File

@ -34,7 +34,6 @@ h3 { font-size: 120%; font-weight: bold; font-family: Verdana, serif; line-heigh
.mainmenu { color: black; font-size: 70%; } .mainmenu { color: black; font-size: 70%; }
.titles { color: black; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 130%; text-decoration: none; } .titles { color: black; font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: 130%; text-decoration: none; }
/* /*
TABLE TABLE
*/ */
@ -86,3 +85,8 @@ select { color: black; background-color: white; font-family: Verdana, serif; fon
.syntaxhtml { color: #000000; } .syntaxhtml { color: #000000; }
.syntaxkeyword { color: #007700; } .syntaxkeyword { color: #007700; }
.syntaxstring { color: #DD0000; } .syntaxstring { color: #DD0000; }
/*
DIV
*/
div.postreview { overflow: auto; width: 100%; height: 300px; border: 1px; }

View File

@ -127,7 +127,6 @@ while ($row = $db->sql_fetchrow($result))
switch ($on_page[1]) switch ($on_page[1])
{ {
case 'reply': case 'reply':
case 'topicreview':
$location = sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]); $location = sprintf($user->lang['REPLYING_MESSAGE'], $forum_data[$forum_id]);
break; break;
default: default: