diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2004-01-10 12:19:10 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2004-01-10 12:19:10 +0000 |
commit | 36f039cb1b15a7c4b5aa59932a8b543a64ce763c (patch) | |
tree | a0814d9a78aa8753c36aff825a75bc807b89a8f6 /phpBB | |
parent | ca291c50f9e5683e33fa8bd9e596b8ab31360742 (diff) | |
download | forums-36f039cb1b15a7c4b5aa59932a8b543a64ce763c.tar forums-36f039cb1b15a7c4b5aa59932a8b543a64ce763c.tar.gz forums-36f039cb1b15a7c4b5aa59932a8b543a64ce763c.tar.bz2 forums-36f039cb1b15a7c4b5aa59932a8b543a64ce763c.tar.xz forums-36f039cb1b15a7c4b5aa59932a8b543a64ce763c.zip |
minor changes...
git-svn-id: file:///svn/phpbb/trunk@4738 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/includes/ucp/ucp_attachments.php | 58 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 99 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/ucp_attachments.html | 13 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/ucp_main_drafts.html | 8 |
4 files changed, 89 insertions, 89 deletions
diff --git a/phpBB/includes/ucp/ucp_attachments.php b/phpBB/includes/ucp/ucp_attachments.php index ab7c6dfeff..e2becf7275 100644 --- a/phpBB/includes/ucp/ucp_attachments.php +++ b/phpBB/includes/ucp/ucp_attachments.php @@ -12,7 +12,7 @@ // ------------------------------------------------------------- // -// * Use this for ucp integration - changeable user id +// * Use this for ACP integration - changeable user id // class ucp_attachments extends module @@ -66,7 +66,7 @@ class ucp_attachments extends module $sort_key_sql = array('a' => 'a.real_filename', 'b' => 'a.comment', 'c' => 'a.extension', 'd' => 'a.filesize', 'e' => 'a.download_count', 'f' => 'a.filetime', 'g' => 't.topic_title'); $sort_dir_text = array('a' => $user->lang['ASCENDING'], 'd' => $user->lang['DESCENDING']); - + $s_sort_key = ''; foreach ($sort_key_text as $key => $value) { @@ -93,32 +93,40 @@ class ucp_attachments extends module $sql = 'SELECT a.*, t.topic_title FROM ' . ATTACHMENTS_TABLE . ' a, ' . TOPICS_TABLE . ' t WHERE a.topic_id = t.topic_id - AND a.poster_id = ' . $user->data['user_id'] . ' - ORDER BY ' . $order_by; + AND a.poster_id = ' . $user->data['user_id'] . " + ORDER BY $order_by"; $result = $db->sql_query_limit($sql, $config['posts_per_page'], $start); - $i = 0; - while ($row = $db->sql_fetchrow($result)) + $row_count = 0; + if ($row = $db->sql_fetchrow($result)) { - $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . '#' . $row['post_id']; - - $template->assign_block_vars('attachrow', array( - 'ROW_NUMBER' => $i + ($start + 1), - 'ATTACH_ID' => $row['attach_id'], - 'FILENAME' => $row['real_filename'], - 'COMMENT' => str_replace("\n", '<br />', $row['comment']), - 'EXTENSION' => $row['extension'], - 'SIZE' => ($row['filesize'] >= 1048576) ? (round($row['filesize'] / 1048576 * 100) / 100) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? (round($row['filesize'] / 1024 * 100) / 100) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']), - 'DOWNLOAD_COUNT' => $row['download_count'], - 'POST_TIME' => $user->format_date($row['filetime'], $user->lang['DATE_FORMAT']), - 'TOPIC_TITLE' => $row['topic_title'], - - 'S_ROW_COUNT' => $i, - - 'U_VIEW_ATTACHMENT' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $row['attach_id'], - 'U_VIEW_TOPIC' => $view_topic) - ); - $i++; + $template->assign_var('S_ATTACHMENT_ROWS', true); + + do + { + $view_topic = "{$phpbb_root_path}viewtopic.$phpEx$SID&t=" . $row['topic_id'] . '&p=' . $row['post_id'] . '#' . $row['post_id']; + + $template->assign_block_vars('attachrow', array( + 'ROW_NUMBER' => $i + ($start + 1), + 'FILENAME' => $row['real_filename'], + 'COMMENT' => str_replace("\n", '<br />', $row['comment']), + 'EXTENSION' => $row['extension'], + 'SIZE' => ($row['filesize'] >= 1048576) ? (round($row['filesize'] / 1048576 * 100) / 100) . ' ' . $user->lang['MB'] : (($row['filesize'] >= 1024) ? (round($row['filesize'] / 1024 * 100) / 100) . ' ' . $user->lang['KB'] : $row['filesize'] . ' ' . $user->lang['BYTES']), + 'DOWNLOAD_COUNT' => $row['download_count'], + 'POST_TIME' => $user->format_date($row['filetime'], $user->lang['DATE_FORMAT']), + 'TOPIC_TITLE' => $row['topic_title'], + + 'ATTACH_ID' => $row['attach_id'], + 'POST_ID' => $row['post_id'], + 'TOPIC_ID' => $row['topic_id'], + + 'S_ROW_COUNT' => $row_count++, + + 'U_VIEW_ATTACHMENT' => $phpbb_root_path . 'download.' . $phpEx . $SID . '&id=' . $row['attach_id'], + 'U_VIEW_TOPIC' => $view_topic) + ); + } + while ($row = $db->sql_fetchrow($result)); } $db->sql_freeresult($result); diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index e5a566e9d0..2522b6eb7e 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -512,7 +512,7 @@ class ucp_main extends module { $drafts = (isset($_POST['d'])) ? implode(', ', array_map('intval', array_keys($_POST['d']))) : ''; - if (!empty($drafts)) + if ($drafts) { $sql = 'DELETE FROM ' . DRAFTS_TABLE . " WHERE draft_id IN ($drafts) @@ -532,7 +532,7 @@ class ucp_main extends module $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 ($draft_message != '' && $draft_subject != '') + if ($draft_message && $draft_subject) { $draft_row = array( 'draft_subject' => $draft_subject, @@ -590,63 +590,58 @@ class ucp_main extends module $db->sql_freeresult($result); } unset($topic_ids); + + $template->assign_var('S_EDIT_DRAFT', $edit); - if (sizeof($draftrows)) + $row_count = 0; + foreach ($draftrows as $draft) { - $template->assign_vars(array( - 'S_DRAFT_ROWS' => true, - 'S_EDIT_DRAFT' => $edit) - ); - - $row_count = 0; - foreach ($draftrows as $draft) - { - $link_topic = $link_forum = 0; - $insert_url = $view_url = $title = ''; + $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'])) - { - $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']; + if (isset($topic_rows[$draft['topic_id']]) && $auth->acl_get('f_read', $topic_rows[$draft['topic_id']]['forum_id'])) + { + $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=" . $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']; - } + $insert_url = "posting.$phpEx$SID&f=" . $draft['forum_id'] . '&mode=post&d=' . $draft['draft_id']; + } - $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, - '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_LINK_TOPIC' => $link_topic, - 'S_LINK_FORUM' => $link_forum - ); + $template_row = array( + '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, + + 'DRAFT_ID' => $draft['draft_id'], + 'FORUM_ID' => $draft['forum_id'], + 'TOPIC_ID' => $draft['topic_id'], + + '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_LINK_TOPIC' => $link_topic, + 'S_LINK_FORUM' => $link_forum, + 'S_HIDDEN_FIELDS' => $s_hidden_fields + ); - if ($edit) - { - $template->assign_vars($template_row); - } - else - { - $template->assign_block_vars('draftrow', $template_row); - } - } + ($edit) ? $template->assign_vars($template_row) : $template->assign_block_vars('draftrow', $template_row); + } + + if (!$edit) + { + $template->assign_vars('S_DRAFT_ROWS', $row_count); } break; diff --git a/phpBB/styles/subSilver/template/ucp_attachments.html b/phpBB/styles/subSilver/template/ucp_attachments.html index 4f42a2795c..ab98fba832 100644 --- a/phpBB/styles/subSilver/template/ucp_attachments.html +++ b/phpBB/styles/subSilver/template/ucp_attachments.html @@ -13,7 +13,7 @@ </tr> </table> -<!-- ELSEIF attachrow --> +<!-- ELSEIF S_ATTACHMENT_ROWS --> <table class="tablebg" width="100%" cellspacing="1"> <tr> @@ -28,11 +28,7 @@ <!-- BEGIN attachrow --> - <!-- IF attach.S_ROW_COUNT is even --> - <tr class="row2"> - <!-- ELSE --> - <tr class="row1"> - <!-- ENDIF --> + <!-- IF attachrow.S_ROW_COUNT is even --><tr class="row2"><!-- ELSE --><tr class="row1"><!-- ENDIF --> <td class="gen" style="padding: 4px;" align="center" width="2%"> {attachrow.ROW_NUMBER} </td> <td style="padding: 4px;"><a class="gen" href="{attachrow.U_VIEW_ATTACHMENT}" target="file">{attachrow.FILENAME}</a><br /><span class="gensmall">{L_TOPIC}: <a href="{attachrow.U_VIEW_TOPIC}">{attachrow.TOPIC_TITLE}</a></span></td> @@ -60,7 +56,10 @@ <table class="tablebg" width="100%" cellspacing="1"> <tr> - <th>{L_UCP_NO_ATTACHMENTS}</th> + <th height="28">{L_UCP}</th> + </tr> + <tr class="row1"> + <td height="25" align="center"><b class="genmed">{L_UCP_NO_ATTACHMENTS}</b></td> </tr> </table> diff --git a/phpBB/styles/subSilver/template/ucp_main_drafts.html b/phpBB/styles/subSilver/template/ucp_main_drafts.html index 451b77e938..579f737d5a 100644 --- a/phpBB/styles/subSilver/template/ucp_main_drafts.html +++ b/phpBB/styles/subSilver/template/ucp_main_drafts.html @@ -29,11 +29,7 @@ <!-- BEGIN draftrow --> - <!-- IF draftrow.S_ROW_COUNT is even --> - <tr class="row1"> - <!-- ELSE --> - <tr class="row2"> - <!-- ENDIF --> + <!-- IF draftrow.S_ROW_COUNT is even --><tr class="row1"><!-- ELSE --><tr class="row2"><!-- ENDIF --> <td class="postdetails" style="padding: 4px;">{draftrow.DATE}</td> <td style="padding: 4px;"><b class="gen">{draftrow.DRAFT_SUBJECT}</b><!-- IF draftrow.S_LINK_TOPIC --><br /><span class="gensmall">{L_TOPIC}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span><!-- ELSEIF draftrow.S_LINK_FORUM --><br /><span class="gensmall">{L_FORUM}: <a href="{draftrow.U_VIEW}">{draftrow.TITLE}</a></span><!-- ELSE --><br /><span class="gensmall">{L_NO_TOPIC_FORUM}</span><!-- ENDIF --></td> @@ -46,9 +42,11 @@ </tr> <!-- END draftrow --> + <!-- IF S_DRAFT_ROWS --> <tr> <td class="cat" colspan="4" align="right"><input class="btnlite" type="submit" name="delete" value="{L_DELETE_MARKED}" /> </td> </tr> + <!-- ENDIF --> <!-- ELSEIF S_EDIT_DRAFT --> <tr> |