diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2003-11-04 22:05:38 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2003-11-04 22:05:38 +0000 |
commit | cd70db7976f43d01cd3cd41467c09f85298d447b (patch) | |
tree | 6f583aba6f9176a1e732652f10a928f0ae004c6c /phpBB/viewtopic.php | |
parent | 88f814a5c57246250a82ad53d43f8f90da5afb60 (diff) | |
download | forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar.gz forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar.bz2 forums-cd70db7976f43d01cd3cd41467c09f85298d447b.tar.xz forums-cd70db7976f43d01cd3cd41467c09f85298d447b.zip |
new permissions, merged attachment tables (the intended purpose of two tables is no longer valid), attachment updates along the merging...
Note: please merge your attachment tables (develop dir).
git-svn-id: file:///svn/phpbb/trunk@4637 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
-rw-r--r-- | phpBB/viewtopic.php | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 0787c32510..5fe0e099b3 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -410,7 +410,7 @@ gen_forum_rules('topic', $forum_id); // Quick mod tools $topic_mod = ''; -$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_lock', $forum_id) && $user->data['user_id'] != ANONYMOUS && $user->data['user_id'] == $topic_poster)) ? (($topic_status == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : ''; +$topic_mod .= ($auth->acl_get('m_lock', $forum_id) || ($auth->acl_get('f_user_lock', $forum_id) && $user->data['user_id'] != ANONYMOUS && $user->data['user_id'] == $topic_poster)) ? (($topic_status == ITEM_UNLOCKED) ? '<option value="lock">' . $user->lang['LOCK_TOPIC'] . '</option>' : '<option value="unlock">' . $user->lang['UNLOCK_TOPIC'] . '</option>') : ''; $topic_mod .= ($auth->acl_get('m_delete', $forum_id)) ? '<option value="delete_topic">' . $user->lang['DELETE_TOPIC'] . '</option>' : ''; $topic_mod .= ($auth->acl_get('m_move', $forum_id)) ? '<option value="move">' . $user->lang['MOVE_TOPIC'] . '</option>' : ''; $topic_mod .= ($auth->acl_get('m_split', $forum_id)) ? '<option value="split">' . $user->lang['SPLIT_TOPIC'] . '</option>' : ''; @@ -961,15 +961,14 @@ unset($id_cache); // Pull attachment data if (count($attach_list)) { - if ($auth->acl_get('f_download', $forum_id)) + if ($auth->acl_gets('f_download', 'u_download', $forum_id)) { include($phpbb_root_path . 'includes/functions_display.' . $phpEx); - $sql = 'SELECT a.post_id, d.* - FROM ' . ATTACHMENTS_TABLE . ' a, ' . ATTACHMENTS_DESC_TABLE . ' d - WHERE a.post_id IN (' . implode(', ', $attach_list) . ') - AND a.attach_id = d.attach_id - ORDER BY d.filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', a.post_id ASC'; + $sql = 'SELECT * + FROM ' . ATTACHMENTS_TABLE . ' + WHERE post_id IN (' . implode(', ', $attach_list) . ') + ORDER BY filetime ' . ((!$config['display_order']) ? 'DESC' : 'ASC') . ', post_id ASC'; $result = $db->sql_query($sql); while ($row = $db->sql_fetchrow($result)) @@ -1256,7 +1255,7 @@ if (!preg_match("#&t=$topic_id#", $user->data['session_page'])) // Update the attachment download counts if (sizeof($update_count)) { - $sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . ' + $sql = 'UPDATE ' . ATTACHMENTS_TABLE . ' SET download_count = download_count + 1 WHERE attach_id IN (' . implode(', ', array_unique($update_count)) . ')'; $db->sql_query($sql); |