mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
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
This commit is contained in:
@@ -356,7 +356,7 @@ if ($submit && $mode == 'orphan')
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
echo sprintf($user->lang['UPLOADING_FILE_TO'], $upload_list[$row['post_id']], $row['post_id']) . '<br />';
|
||||
if (!$auth->acl_get('f_attach', $row['forum_id']))
|
||||
if (!$auth->acl_gets('f_attach', 'u_attach', $row['forum_id']))
|
||||
{
|
||||
echo '<span style="color:red">' . sprintf($user->lang['UPLOAD_DENIED_FORUM'], $forum_names[$row['forum_id']]) . '</span><br /><br />';
|
||||
}
|
||||
@@ -716,7 +716,7 @@ function marklist(match, name, status)
|
||||
|
||||
<?php
|
||||
$sql = 'SELECT physical_filename
|
||||
FROM ' . ATTACHMENTS_DESC_TABLE;
|
||||
FROM ' . ATTACHMENTS_TABLE;
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
@@ -918,6 +918,9 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
|
||||
if ($filedata['post_attach'] && !sizeof($filedata['error']))
|
||||
{
|
||||
$message_parser->attachment_data = array(
|
||||
'post_id' => $post_id,
|
||||
'poster_id' => $user->data['user_id'],
|
||||
'topic_id' => $topic_id,
|
||||
'physical_filename' => $filedata['destination_filename'],
|
||||
'real_filename' => $filedata['filename'],
|
||||
'comment' => $message_parser->filename_data['filecomment'],
|
||||
@@ -936,17 +939,6 @@ function upload_file($post_id, $topic_id, $forum_id, $upload_dir, $filename)
|
||||
|
||||
$db->sql_transaction();
|
||||
|
||||
$sql = 'INSERT INTO ' . ATTACHMENTS_DESC_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
|
||||
$db->sql_query($sql);
|
||||
|
||||
$attach_sql = array(
|
||||
'attach_id' => $db->sql_nextid(),
|
||||
'post_id' => $post_id,
|
||||
'privmsgs_id' => 0,
|
||||
'user_id_from' => $user->data['user_id'],
|
||||
'user_id_to' => 0
|
||||
);
|
||||
|
||||
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $attach_sql);
|
||||
$db->sql_query($sql);
|
||||
|
||||
|
@@ -1307,6 +1307,8 @@ function delete_forum_content($forum_id)
|
||||
switch (SQL_LAYER)
|
||||
{
|
||||
case 'mysql4':
|
||||
// Use delete_attachments('topic', $ids, false) here...
|
||||
|
||||
// Select then delete all attachments
|
||||
$sql = 'SELECT d.physical_filename, d.thumbnail
|
||||
FROM ' . POSTS_TABLE . ' p, ' . ATTACHMENTS_DESC_TABLE . ' d, ' . ATTACHMENTS_TABLE . " a
|
||||
|
Reference in New Issue
Block a user