mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
damn local storage folder. :/
git-svn-id: file:///svn/phpbb/trunk@4638 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
cd70db7976
commit
3166e9f48f
1 changed files with 8 additions and 18 deletions
|
@ -185,11 +185,10 @@ if ($sql)
|
||||||
|
|
||||||
if ($post_attachment && !$submit && !$refresh && !$preview && $mode == 'edit')
|
if ($post_attachment && !$submit && !$refresh && !$preview && $mode == 'edit')
|
||||||
{
|
{
|
||||||
$sql = 'SELECT d.*
|
$sql = 'SELECT attach_id, physical_filename, comment, real_filename, extension, mimetype, filesize, filetime, thumbnail
|
||||||
FROM ' . ATTACHMENTS_TABLE . ' a, ' . ATTACHMENTS_DESC_TABLE . " d
|
FROM ' . ATTACHMENTS_TABLE . "
|
||||||
WHERE a.post_id = $post_id
|
WHERE post_id = $post_id
|
||||||
AND a.attach_id = d.attach_id
|
ORDER BY filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC');
|
||||||
ORDER BY d.filetime " . ((!$config['display_order']) ? 'DESC' : 'ASC');
|
|
||||||
$result = $db->sql_query($sql);
|
$result = $db->sql_query($sql);
|
||||||
|
|
||||||
$message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
|
$message_parser->attachment_data = array_merge($message_parser->attachment_data, $db->sql_fetchrowset($result));
|
||||||
|
@ -1932,7 +1931,7 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
|
||||||
if ($attach_row['attach_id'])
|
if ($attach_row['attach_id'])
|
||||||
{
|
{
|
||||||
// update entry in db if attachment already stored in db and filespace
|
// update entry in db if attachment already stored in db and filespace
|
||||||
$sql = 'UPDATE ' . ATTACHMENTS_DESC_TABLE . "
|
$sql = 'UPDATE ' . ATTACHMENTS_TABLE . "
|
||||||
SET comment = '" . $db->sql_escape($attach_row['comment']) . "'
|
SET comment = '" . $db->sql_escape($attach_row['comment']) . "'
|
||||||
WHERE attach_id = " . (int) $attach_row['attach_id'];
|
WHERE attach_id = " . (int) $attach_row['attach_id'];
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
@ -1941,6 +1940,9 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
|
||||||
{
|
{
|
||||||
// insert attachment into db
|
// insert attachment into db
|
||||||
$attach_sql = array(
|
$attach_sql = array(
|
||||||
|
'post_id' => $data['post_id'],
|
||||||
|
'topic_id' => $data['topic_id'],
|
||||||
|
'poster_id' => $poster_id,
|
||||||
'physical_filename' => $attach_row['physical_filename'],
|
'physical_filename' => $attach_row['physical_filename'],
|
||||||
'real_filename' => $attach_row['real_filename'],
|
'real_filename' => $attach_row['real_filename'],
|
||||||
'comment' => $attach_row['comment'],
|
'comment' => $attach_row['comment'],
|
||||||
|
@ -1951,18 +1953,6 @@ function submit_post($mode, $message, $subject, $username, $topic_type, $bbcode_
|
||||||
'thumbnail' => $attach_row['thumbnail']
|
'thumbnail' => $attach_row['thumbnail']
|
||||||
);
|
);
|
||||||
|
|
||||||
$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' => $data['post_id'],
|
|
||||||
'privmsgs_id' => 0,
|
|
||||||
'user_id_from' => $poster_id,
|
|
||||||
'user_id_to' => 0
|
|
||||||
);
|
|
||||||
|
|
||||||
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' .
|
$sql = 'INSERT INTO ' . ATTACHMENTS_TABLE . ' ' .
|
||||||
$db->sql_build_array('INSERT', $attach_sql);
|
$db->sql_build_array('INSERT', $attach_sql);
|
||||||
$db->sql_query($sql);
|
$db->sql_query($sql);
|
||||||
|
|
Loading…
Add table
Reference in a new issue