diff --git a/phpBB/adm/admin_attachments.php b/phpBB/adm/admin_attachments.php index a4e6ecfed1..b47f4a0e17 100644 --- a/phpBB/adm/admin_attachments.php +++ b/phpBB/adm/admin_attachments.php @@ -36,9 +36,6 @@ $submit = (isset($_POST['submit'])) ? true : false; $error = $notify = array(); -// Adjust the Upload Directory. Relative or absolute, this is the question here. -$upload_dir = ($config['upload_dir'][0] == '/' || ($config['upload_dir'][0] != '/' && $config['upload_dir'][1] == ':')) ? $config['upload_dir'] : $phpbb_root_path . $config['upload_dir']; - switch ($mode) { case 'extensions': @@ -310,7 +307,8 @@ if ($submit && $mode == 'orphan') foreach ($delete_files as $delete) { - phpbb_unlink($upload_dir . '/' . $delete); + phpbb_unlink($config['upload_dir'] . '/' . $delete); + phpbb_unlink($config['upload_dir'] . '/thumb_' . $delete); } if (sizeof($delete_files)) @@ -362,7 +360,7 @@ if ($submit && $mode == 'orphan') } else { - upload_file($row['post_id'], $row['topic_id'], $row['forum_id'], $upload_dir, $upload_list[$row['post_id']]); + upload_file($row['post_id'], $row['topic_id'], $row['forum_id'], $config['upload_dir'], $upload_list[$row['post_id']]); } } } @@ -467,20 +465,14 @@ if ($mode == 'ext_groups')
lang['EXTENSION_GROUPS_TITLE']; ?> | -|||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
- |||||||||||||
lang['EXTENSION_GROUP']; ?> | -lang['SPECIAL_CATEGORY']; ?> | -lang['ALLOWED']; ?> | -lang['DOWNLOAD_MODE']; ?> | -lang['UPLOAD_ICON']; ?> | -lang['MAX_EXTGROUP_FILESIZE']; ?> | -lang['ADD']; ?> | +lang['EXTENSION_GROUP']; ?> | +lang['SPECIAL_CATEGORY']; ?> | +lang['ALLOWED']; ?> | +lang['DOWNLOAD_MODE']; ?> | +lang['UPLOAD_ICON']; ?> | +lang['MAX_EXTGROUP_FILESIZE']; ?> | +lang['ADD']; ?> |
@@ -509,13 +501,13 @@ if ($mode == 'ext_groups') | |||||||||||||
lang['EXTENSION_GROUP']; ?> | -lang['SPECIAL_CATEGORY']; ?> | -lang['ALLOWED']; ?> | -lang['DOWNLOAD_MODE']; ?> | -lang['UPLOAD_ICON']; ?> | -lang['MAX_EXTGROUP_FILESIZE']; ?> | -lang['DELETE']; ?> | +lang['EXTENSION_GROUP']; ?> | +lang['SPECIAL_CATEGORY']; ?> | +lang['ALLOWED']; ?> | +lang['DOWNLOAD_MODE']; ?> | +lang['UPLOAD_ICON']; ?> | +lang['MAX_EXTGROUP_FILESIZE']; ?> | +lang['DELETE']; ?> |
+ |
lang['MANAGE_EXTENSIONS']; ?> | -|||||
---|---|---|---|---|---|
![]() |
- |||||
lang['EXTENSION']; ?> | lang['EXTENSION_GROUP']; ?> | @@ -675,7 +661,7 @@ if ($mode == 'extensions') } ?>||||
+ |
Orphan Attachments | -|||||||||
---|---|---|---|---|---|---|---|---|---|
![]() |
- |||||||||
lang['FILENAME']; ?> | -lang['FILESIZE']; ?> | -lang['ATTACH_POST_ID']; ?> | -lang['ATTACH_TO_POST']; ?> | -lang['DELETE']; ?> | +lang['FILENAME']; ?> | +lang['FILESIZE']; ?> | +lang['ATTACH_POST_ID']; ?> | +lang['ATTACH_TO_POST']; ?> | +lang['DELETE']; ?> |
- | - | ID: | -- | - | |||||
+ | + | ID: | ++ | + | lang['USERS_PER_DAY']; ?>: | + | |||
lang['NUMBER_FILES']; ?>: | ++ | lang['FILES_PER_DAY']; ?>: | ++ | ||||||
lang['BOARD_STARTED']; ?>: | @@ -462,8 +479,14 @@ elseif ($pane == 'right') | ||||||||
lang['DATABASE_SIZE']; ?>: | + | lang['UPLOAD_DIR_SIZE']; ?>: | ++ | ||||||
lang['GZIP_COMPRESSION']; ?>: | lang['ON'] : $user->lang['OFF']; ?> | ++ | |||||||
diff --git a/phpBB/common.php b/phpBB/common.php index 36cc0f9833..bd595b65c5 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -256,6 +256,9 @@ if (time() - $config['cache_interval'] >= $config['cache_last_gc']) } */ +// Adjust storage path's +$config['upload_dir'] = ($config['upload_dir']{0} == '/' || ($config['upload_dir']{0} != '/' && $config['upload_dir']{1} == ':')) ? $config['upload_dir'] : $phpbb_root_path . $config['upload_dir']; + // Handle email/cron queue. if (time() - $config['queue_interval'] >= $config['last_queue_run'] && !defined('IN_ADMIN')) { diff --git a/phpBB/download.php b/phpBB/download.php index c728777d02..ad82f0534c 100644 --- a/phpBB/download.php +++ b/phpBB/download.php @@ -78,11 +78,10 @@ if (!in_array($attachment['extension'], $extensions['_allowed_'])) } $download_mode = (int) $extensions[$attachment['extension']]['download_mode']; -$upload_dir = ($config['upload_dir'][0] == '/' || ($config['upload_dir'][0] != '/' && $config['upload_dir'][1] == ':')) ? $config['upload_dir'] : $phpbb_root_path . $config['upload_dir']; if ($thumbnail) { - $attachment['physical_filename'] = 'thumbs/t_' . $attachment['physical_filename']; + $attachment['physical_filename'] = 'thumb_' . $attachment['physical_filename']; } else { @@ -96,16 +95,16 @@ else // Determine the 'presenting'-method if ($download_mode == PHYSICAL_LINK) { - if (!@is_dir($upload_dir)) + if (!@is_dir($config['upload_dir'])) { trigger_error($user->lang['PHYSICAL_DOWNLOAD_NOT_POSSIBLE']); } - redirect($upload_dir . '/' . $attachment['physical_filename']); + redirect($config['upload_dir'] . '/' . $attachment['physical_filename']); } else { - send_file_to_browser($attachment, $upload_dir, $extensions[$attachment['extension']]['display_cat']); + send_file_to_browser($attachment, $config['upload_dir'], $extensions[$attachment['extension']]['display_cat']); exit; } diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 7e0abc37cf..53317d5448 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -514,7 +514,7 @@ function delete_posts($where_type, $where_ids, $auto_sync = TRUE) // resync => set this to false if you are deleting posts or topics... function delete_attachments($mode, $ids, $resync = TRUE) { - global $db; + global $db, $config; if (is_array($ids)) { @@ -533,7 +533,7 @@ function delete_attachments($mode, $ids, $resync = TRUE) // Collect post and topics ids for later use if ($mode == 'attach' || $mode == 'user' || ($mode == 'topic' && $resync)) { - $sql = 'SELECT post_id, topic_id, physical_filename, thumbnail + $sql = 'SELECT post_id, topic_id, physical_filename, thumbnail, filesize FROM ' . ATTACHMENTS_TABLE . ' WHERE ' . $sql_id . ' IN (' . implode(', ', $ids) . ')'; $result = $db->sql_query($sql); @@ -542,14 +542,14 @@ function delete_attachments($mode, $ids, $resync = TRUE) { $post_ids[] = $row['post_id']; $topic_ids[] = $row['topic_id']; - $physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail']); + $physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail'], 'filesize' => $row['filesize']); } $db->sql_freeresult($result); } if ($mode == 'post') { - $sql = 'SELECT topic_id, physical_filename, thumbnail + $sql = 'SELECT topic_id, physical_filename, thumbnail, filesize FROM ' . ATTACHMENTS_TABLE . ' WHERE post_id IN (' . implode(', ', $ids) . ')'; $result = $db->sql_query($sql); @@ -557,7 +557,7 @@ function delete_attachments($mode, $ids, $resync = TRUE) while ($row = $db->sql_fetchrow($result)) { $topic_ids[] = $row['topic_id']; - $physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail']); + $physical[] = array('filename' => $row['physical_filename'], 'thumbnail' => $row['thumbnail'], 'filesize' => $row['filesize']); } $db->sql_freeresult($result); } @@ -567,14 +567,22 @@ function delete_attachments($mode, $ids, $resync = TRUE) $num_deleted = $db->sql_affectedrows(); // Delete attachments from filesystem + $space_removed = $files_removed = 0; foreach ($physical as $file_ary) { - phpbb_unlink($file_ary['filename'], 'file'); + if (phpbb_unlink($file_ary['filename'], 'file')) + { + $space_removed += $file_ary['filesize']; + $files_removed++; + } + if ($file_ary['thumbnail']) { phpbb_unlink($file_ary['filename'], 'thumbnail'); } } + set_config('upload_dir_size', $config['upload_dir_size'] - $space_removed, true); + set_config('num_files', $config['num_files'] - $files_removed, true); if ($mode == 'topic' && !$resync) { @@ -712,9 +720,7 @@ function phpbb_unlink($filename, $mode = 'file') { global $config, $user, $phpbb_root_path; - $upload_dir = ($config['upload_dir'][0] == '/' || ($config['upload_dir'][0] != '/' && $config['upload_dir'][1] == ':')) ? $config['upload_dir'] : $phpbb_root_path . $config['upload_dir']; - - $filename = ($mode == 'thumbnail') ? $upload_dir . '/thumbs/t_' . $filename : $upload_dir . '/' . $filename; + $filename = ($mode == 'thumbnail') ? $config['upload_dir'] . '/thumb_' . $filename : $config['upload_dir'] . '/' . $filename; $deleted = @unlink($filename); if (file_exists($filename)) @@ -724,6 +730,7 @@ function phpbb_unlink($filename, $mode = 'file') if (file_exists($filename)) { + $filename = realpath($filename); @chmod($filename, 0777); if (!($deleted = @unlink($filename))) { diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e1308311c4..a8a0a80244 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -295,7 +295,6 @@ function display_attachments($blockname, $attachment_data, &$update_count, $forc // $starttime = explode(' ', microtime()); // $starttime = $starttime[1] + $starttime[0]; - $upload_dir = ($config['upload_dir'][0] == '/' || ($config['upload_dir'][0] != '/' && $config['upload_dir'][1] == ':')) ? $config['upload_dir'] : $phpbb_root_path . $config['upload_dir']; $blocks = array(WM_CAT => 'WM_STREAM', RM_CAT => 'RM_STREAM', THUMB_CAT => 'THUMBNAIL', IMAGE_CAT => 'IMAGE'); if (!isset($attachment_tpl)) @@ -349,8 +348,8 @@ function display_attachments($blockname, $attachment_data, &$update_count, $forc { // Some basics... $attachment['extension'] = strtolower(trim($attachment['extension'])); - $filename = $upload_dir . '/' . $attachment['physical_filename']; - $thumbnail_filename = $upload_dir . '/thumbs/t_' . $attachment['physical_filename']; + $filename = $config['upload_dir'] . '/' . $attachment['physical_filename']; + $thumbnail_filename = $config['upload_dir'] . '/thumb_' . $attachment['physical_filename']; $upload_image = ''; diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 6468a15508..db8bf52973 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -140,8 +140,7 @@ function update_last_post_information($type, $id) switch ($type) { case 'forum': - // Anyone having any ideas how to optimize this? - // This query is very time consuming on large boards (already optimized this by 50%) + // Splitted query - performance gain $sql = 'SELECT MAX(post_time) AS max_post_time FROM ' . POSTS_TABLE . ' WHERE post_approved = 1 AND forum_id = ' . $id; @@ -210,7 +209,7 @@ function upload_attachment($filename, $local = false, $local_storage = '') $file = (!$local) ? $_FILES['fileupload']['tmp_name'] : $local_storage; $filedata['mimetype'] = (!$local) ? $_FILES['fileupload']['type'] : 'application/octet-stream'; - // Opera add the name to the mime type + // Opera adds the name to the mime type $filedata['mimetype'] = ( strstr($filedata['mimetype'], '; name') ) ? str_replace(strstr($filedata['mimetype'], '; name'), '', $filedata['mimetype']) : $filedata['mimetype']; $filedata['extension'] = array_pop(explode('.', strtolower($filename))); $filedata['filesize'] = (!@filesize($file)) ? intval($_FILES['size']) : @filesize($file); @@ -254,7 +253,7 @@ function upload_attachment($filename, $local = false, $local_storage = '') { if ($width > $config['img_max_width'] || $height > $config['img_max_height']) { - $filedata['error'][] = sprintf($user->lang['Error_imagesize'], $config['img_max_width'], $config['img_max_height']); + $filedata['error'][] = sprintf($user->lang['ERROR_IMAGESIZE'], $config['img_max_width'], $config['img_max_height']); $filedata['post_attach'] = FALSE; return $filedata; } @@ -262,7 +261,7 @@ function upload_attachment($filename, $local = false, $local_storage = '') } // check Filesize - if ($allowed_filesize != 0 && $filedata['filesize'] > $allowed_filesize && !$auth->acl_gets('m_', 'a_')) + if ($allowed_filesize && $filedata['filesize'] > $allowed_filesize && !$auth->acl_gets('m_', 'a_')) { $size_lang = ($allowed_filesize >= 1048576) ? $user->lang['MB'] : ( ($allowed_filesize >= 1024) ? $user->lang['KB'] : $user->lang['BYTES'] ); @@ -274,9 +273,9 @@ function upload_attachment($filename, $local = false, $local_storage = '') } // Check our complete quota - if ($config['attachment_quota'] != 0) + if ($config['attachment_quota']) { - if ($config['total_filesize'] + $filedata['filesize'] > $config['attachment_quota']) + if ($config['upload_dir_size'] + $filedata['filesize'] > $config['attachment_quota']) { $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; $filedata['post_attach'] = FALSE; @@ -284,6 +283,20 @@ function upload_attachment($filename, $local = false, $local_storage = '') } } +/* + // TODO + // Check Free Disk Space - need testing under windows [commented out] + if ($free_space = disk_free_space($config['upload_dir'])) + { + if ($free_space <= $filedata['filesize']) + { + $filedata['error'][] = $user->lang['ATTACH_QUOTA_REACHED']; + $filedata['post_attach'] = FALSE; + return $filedata; + } + } +*/ + $filedata['thumbnail'] = 0; // Prepare Values @@ -321,52 +334,51 @@ function move_uploaded_attachment($upload_mode, $source_filename, &$filedata) { global $user, $config, $phpbb_root_path; - $upload_dir = ($config['upload_dir'][0] == '/' || ($config['upload_dir'][0] != '/' && $config['upload_dir'][1] == ':')) ? $config['upload_dir'] : $phpbb_root_path . $config['upload_dir']; $destination_filename = $filedata['destination_filename']; $thumbnail = (isset($filedata['thumbnail'])) ? $filedata['thumbnail'] : FALSE; switch ($upload_mode) { case 'copy': - if ( !@copy($source_filename, $upload_dir . '/' . $destination_filename) ) + if ( !@copy($source_filename, $config['upload_dir'] . '/' . $destination_filename) ) { - if ( !@move_uploaded_file($source_filename, $upload_dir . '/' . $destination_filename) ) + if ( !@move_uploaded_file($source_filename, $config['upload_dir'] . '/' . $destination_filename) ) { - return sprintf($user->lang['GENERAL_UPLOAD_ERROR'], $upload_dir . '/' . $destination_filename); + return sprintf($user->lang['GENERAL_UPLOAD_ERROR'], $config['upload_dir'] . '/' . $destination_filename); } } - @chmod($upload_dir . '/' . $destination_filename, 0666); + @chmod($config['upload_dir'] . '/' . $destination_filename, 0666); break; case 'move': - if ( !@move_uploaded_file($source_filename, $upload_dir . '/' . $destination_filename) ) + if ( !@move_uploaded_file($source_filename, $config['upload_dir'] . '/' . $destination_filename) ) { - if ( !@copy($source_file, $upload_dir . '/' . $destination_filename) ) + if ( !@copy($source_filename, $config['upload_dir'] . '/' . $destination_filename) ) { - return sprintf($user->lang['GENERAL_UPLOAD_ERROR'], $upload_dir . '/' . $destination_filename); + return sprintf($user->lang['GENERAL_UPLOAD_ERROR'], $config['upload_dir'] . '/' . $destination_filename); } } - @chmod($upload_dir . '/' . $destination_filename, 0666); + @chmod($config['upload_dir'] . '/' . $destination_filename, 0666); break; case 'local': - if (!@copy($source_filename, $upload_dir . '/' . $destination_filename)) + if (!@copy($source_filename, $config['upload_dir'] . '/' . $destination_filename)) { - return sprintf($user->lang['GENERAL_UPLOAD_ERROR'], $upload_dir . '/' . $destination_filename); + return sprintf($user->lang['GENERAL_UPLOAD_ERROR'], $config['upload_dir'] . '/' . $destination_filename); } - @chmod($upload_dir . '/' . $destination_filename, 0666); + @chmod($config['upload_dir'] . '/' . $destination_filename, 0666); @unlink($source_filename); break; } if ($filedata['thumbnail']) { - $source = $upload_dir . '/' . $destination_filename; - $destination = $upload_dir . '/thumbs/t_' . $destination_filename; + $source = $config['upload_dir'] . '/' . $destination_filename; + $destination = $config['upload_dir'] . '/thumb_' . $destination_filename; - if (!create_thumbnail($source, $destination, $filedata['mimetype'])) + if (!create_thumbnail($source_filename, $destination_filename, $filedata['mimetype'])) { - if (!create_thumbnail($source_filename, $destination_filename, $filedata['mimetype'])) + if (!create_thumbnail($source, $destination, $filedata['mimetype'])) { $filedata['thumbnail'] = 0; } @@ -518,8 +530,9 @@ function create_thumbnail($source, $new_file, $mimetype) return FALSE; } - @chmod($new_file, 0666); + @chmod($new_file, 0666); + return TRUE; } diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 2de8b424c3..83518123b6 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -741,7 +741,7 @@ class parse_message if ($this->attachment_data[$index]['thumbnail']) { - phpbb_unlink('t_' . $this->attachment_data[$index]['physical_filename'], 'thumbnail'); + phpbb_unlink($this->attachment_data[$index]['physical_filename'], 'thumbnail'); } } else diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index bcaabdceb8..e5a566e9d0 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -506,13 +506,13 @@ class ucp_main extends module $draft_id = ($edit) ? intval($_REQUEST['edit']) : 0; $s_hidden_fields = ($edit) ? '' : ''; - $draft_title = $post_subject = $post_message = ''; + $draft_subject = $draft_message = ''; if ($_POST['delete']) { - $drafts = (isset($_POST['d'])) ? implode(', ', array_map('intval', array_keys($_POST['d']))) : false; + $drafts = (isset($_POST['d'])) ? implode(', ', array_map('intval', array_keys($_POST['d']))) : ''; - if ($drafts) + if (!empty($drafts)) { $sql = 'DELETE FROM ' . DRAFTS_TABLE . " WHERE draft_id IN ($drafts) @@ -528,16 +528,15 @@ class ucp_main extends module if ($submit && $edit) { - $draft_title = (isset($_POST['draft_title'])) ? trim(htmlspecialchars($_POST['draft_title'])) : ''; - $post_subject = (isset($_POST['subject'])) ? trim(htmlspecialchars($_POST['subject'])) : ''; - $post_message = (isset($_POST['message'])) ? trim(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), htmlspecialchars($_POST['message']))) : ''; + $draft_subject = preg_replace('#&(\#[0-9]+;)#', '&\1', request_var('subject', '')); + $draft_message = (isset($_POST['message'])) ? htmlspecialchars(trim(str_replace(array('\\\'', '\\"', '\\0', '\\\\'), array('\'', '"', '\0', '\\'), $_POST['message']))) : ''; + $draft_message = preg_replace('#&(\#[0-9]+;)#', '&\1', $draft_message); - if ($post_message != '' && $draft_title != '') + if ($draft_message != '' && $draft_subject != '') { $draft_row = array( - 'title' => $draft_title, - 'post_subject' => $post_subject, - 'post_message' => $post_message + 'draft_subject' => $draft_subject, + 'draft_message' => $draft_message ); $sql = 'UPDATE ' . DRAFTS_TABLE . ' @@ -553,18 +552,19 @@ class ucp_main extends module } else { - $template->assign_var('ERROR', ($post_message == '') ? $user->lang['EMPTY_DRAFT'] : (($draft_title == '') ? $user->lang['EMPTY_DRAFT_TITLE'] : '')); + $template->assign_var('ERROR', ($draft_message == '') ? $user->lang['EMPTY_DRAFT'] : (($draft_subject == '') ? $user->lang['EMPTY_DRAFT_TITLE'] : '')); } } - $sql = 'SELECT * - FROM ' . DRAFTS_TABLE . ' - WHERE user_id = ' . $user->data['user_id'] . ' ' . - (($edit) ? "AND draft_id = $draft_id" : '') . ' + $sql = 'SELECT d.*, f.forum_name + FROM ' . DRAFTS_TABLE . ' d, ' . FORUMS_TABLE . ' f + WHERE d.user_id = ' . $user->data['user_id'] . ' ' . + (($edit) ? "AND d.draft_id = $draft_id" : '') . ' + AND f.forum_id = d.forum_id ORDER BY save_time DESC'; $result = $db->sql_query($sql); - $draftrows = $topic_ids = $topic_rows = array(); + $draftrows = $topic_ids = array(); while ($row = $db->sql_fetchrow($result)) { @@ -601,42 +601,41 @@ class ucp_main extends module $row_count = 0; foreach ($draftrows as $draft) { - $title = $draft['title']; - if (strlen($title) > 30) + $link_topic = $link_forum = 0; + $insert_url = $view_url = $title = ''; + + if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) { - $title = substr($title, 0, 27) . '...'; + $link_topic = true; + $view_url = "viewtopic.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . "&t=" . $draft['topic_id']; + $title = $topic_rows[$draft['topic_id']]['topic_title']; + + $insert_url = "posting.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . '&t=' . $draft['topic_id'] . '&mode=reply&d=' . $draft['draft_id']; + } + else if ($auth->acl_get('f_read', $draft['forum_id'])) + { + $link_forum = true; + $view_url = "viewforum.$phpEx$SID&f=" . $draft['forum_id']; + $title = $draft['forum_name']; + + $insert_url = "posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; } - if (isset($topic_rows[$draft['topic_id']])) - { - $view_topic_url = ($auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) ? "viewtopic.$phpEx$SID&f=" . $topic_rows[$draft['topic_id']]['forum_id'] . "&t=" . $draft['topic_id'] : ''; - } - else - { - $view_topic_url = ''; - } - $topic_title = ($view_topic_url != '') ? $topic_rows[$draft['topic_id']]['topic_title'] : ''; - - if (strlen($topic_title) > 30) - { - $topic_title = substr($topic_title, 0, 27) . '...'; - } - $template_row = array( 'DRAFT_ID' => $draft['draft_id'], 'DATE' => $user->format_date($draft['save_time']), + 'DRAFT_MESSAGE' => ($submit) ? $draft_message : $draft['draft_message'], + 'DRAFT_SUBJECT' => ($submit) ? $draft_subject : $draft['draft_subject'], + 'TITLE' => $title, - 'TOPIC_TITLE' => ($view_topic_url != '') ? $topic_title : '', - - 'DRAFT_TITLE' => ($submit) ? $draft_title : $draft['title'], - 'POST_MESSAGE' => ($submit) ? $post_message : $draft['post_message'], - 'POST_SUBJECT' => ($submit) ? $post_subject : $draft['post_subject'], - - 'U_VIEW_TOPIC' => $view_topic_url, + 'U_VIEW' => $view_url, 'U_VIEW_EDIT' => "ucp.$phpEx$SID&i=$id&mode=$mode&edit=" . $draft['draft_id'], + 'U_INSERT' => $insert_url, 'S_ROW_COUNT' => $row_count++, - 'S_HIDDEN_FIELDS' => $s_hidden_fields + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_LINK_TOPIC' => $link_topic, + 'S_LINK_FORUM' => $link_forum ); if ($edit) @@ -659,7 +658,7 @@ class ucp_main extends module 'S_DISPLAY_MARK_ALL' => ($mode == 'watched' || ($mode == 'drafts' && !isset($_GET['edit']))) ? true : false, 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_UCP_ACTION' => "ucp.$phpEx$SID&i=$id&mode=$mode") + 'S_UCP_ACTION' => $phpbb_root_path . "ucp.$phpEx$SID&i=$id&mode=$mode") ); $this->display($user->lang['UCP_MAIN'], 'ucp_main_' . $mode . '.html'); diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index 288e2ab5ab..64af877777 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -4,7 +4,7 @@ # $Id$ # -# Table: phpbb_attachments_desc +# Table: phpbb_attachments CREATE TABLE phpbb_attachments ( attach_id mediumint(8) UNSIGNED NOT NULL auto_increment, post_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, @@ -146,12 +146,12 @@ CREATE TABLE phpbb_drafts ( draft_id mediumint(8) UNSIGNED NOT NULL auto_increment, user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, topic_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + forum_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, save_time int(11) UNSIGNED DEFAULT '0' NOT NULL, - title varchar(60) DEFAULT '' NOT NULL, - post_subject varchar(60), - post_message text DEFAULT '' NOT NULL, + draft_subject varchar(60), + draft_message text DEFAULT '' NOT NULL, PRIMARY KEY (draft_id), - KEY user_id (user_id,save_time) + KEY save_time (save_time) ); # Table: 'phpbb_extensions' diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index 705ecb799a..fa48031312 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -157,6 +157,8 @@ INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('newest INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_users', '1', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_posts', '1', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_topics', '1', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('num_files', '0', 1); +INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('upload_dir_size', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('session_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('search_last_gc', '0', 1); INSERT INTO phpbb_config (config_name, config_value, is_dynamic) VALUES ('last_queue_run', '0', 1); diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index 8725545e10..88ac92c295 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -248,8 +248,11 @@ $lang += array( 'TOPICS_PER_DAY'=> 'Topics per day', 'NUMBER_USERS' => 'Number of users', 'USERS_PER_DAY' => 'Users per day', + 'NUMBER_FILES' => 'Number of Attachments', + 'FILES_PER_DAY' => 'Attachments per day', 'BOARD_STARTED' => 'Board started', 'AVATAR_DIR_SIZE' => 'Avatar directory size', + 'UPLOAD_DIR_SIZE' => 'Upload directory size', 'DATABASE_SIZE' => 'Database size', 'GZIP_COMPRESSION' => 'Gzip compression', 'NOT_AVAILABLE' => 'Not available', diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index af693f441d..e291195f3d 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -638,18 +638,19 @@ $lang += array( 'SAVE' => 'Save', 'LOAD' => 'Load', - 'DRAFT_SAVED' => 'Post contents successfully saved as draft. |
{L_INFORMATION} | |
---|---|
{L_DRAFT_SAVED} | +{L_DRAFT_LOADED} | +
{L_LOAD_DRAFT} | +|||
---|---|---|---|
{L_LOAD_DRAFT_EXPLAIN} | |||
![]() |
-|||
{L_DRAFT_TITLE_EXPLAIN} {L_ENTER_DRAFT_TITLE} - - - - |
+ {L_SAVE_DATE} | +{L_DRAFT_TITLE} | +{L_OPTIONS} |
{draftrow.DATE} | +{draftrow.DRAFT_SUBJECT} {L_TOPIC}: {draftrow.TITLE} {L_FORUM}: {draftrow.TITLE} {L_NO_TOPIC_FORUM} |
+ {L_LOAD_DRAFT} | +
{L_UCP} | +{L_UCP} | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{L_DRAFTS_EXPLAIN} | +|||||||||||||||||
{L_DRAFTS_EXPLAIN} | |||||||||||||||||
{ERROR} | +|||||||||||||||||
{ERROR} | |||||||||||||||||
{L_SAVE_DATE} | {L_DRAFT_TITLE} | -{L_TOPIC} | {L_OPTIONS} | {L_DELETE} | {draftrow.DATE} | -{draftrow.TITLE} | -{L_CURRENT_TOPIC}{draftrow.TOPIC_TITLE}{L_NEW_OR_DELETED_TOPIC} | -{L_INSERT} {L_VIEW_EDIT} |
+ {draftrow.DRAFT_SUBJECT} {L_TOPIC}: {draftrow.TITLE} {L_FORUM}: {draftrow.TITLE} {L_NO_TOPIC_FORUM} |
+ {L_LOAD_DRAFT} {L_VIEW_EDIT} |
|||||||
{L_NO_SAVED_DRAFTS} | +{L_NO_SAVED_DRAFTS} | ||||||||||||||||
+ | |||||||||||||||||
{L_DRAFT_TITLE}: | -- | ||||||||||||||||
{L_SUBJECT}: | -+ | ||||||||||||||||
{L_MESSAGE}: {L_EDIT_DRAFT_EXPLAIN} |
@@ -90,11 +86,11 @@
|||||||||||||||||
+ |