Version 5.0.0 beta 5
This commit is contained in:
1 parent
2f24f9de48
commit
57d9db6ce2
218 files changed
+5331
-7416
No files matched your search
@@ -1140,6 +1140,9 @@ Filter
|
||||
Db::i()->update( 'nexus_purchases', array( 'ps_pay_to' => $newAuthor->member_id ), array( 'ps_app=? AND ps_type=? AND ps_item_id=?', 'downloads', 'file', $this->id ) );
|
||||
}
|
||||
|
||||
/* Update any pending versions */
|
||||
Db::i()->update( 'downloads_files_pending', array( 'pending_member_id' => $newAuthor->member_id ), array( 'pending_file_id=?', $this->id ) );
|
||||
|
||||
parent::changeAuthor( $newAuthor, $log );
|
||||
}
|
||||
|
||||
@@ -2651,7 +2654,11 @@ Filter
|
||||
if( $screenshot = $this->primary_screenshot_thumb )
|
||||
{
|
||||
/* Now we need to copy the primary screenshot as an attachment to the first post */
|
||||
$topic = $this->topic();
|
||||
$topic = $this->topic( false );
|
||||
if( $topic === null )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
/* Delete any existing attachments */
|
||||
$delete = [];
|
||||
@@ -2673,27 +2680,32 @@ Filter
|
||||
Db::i()->delete( 'core_attachments', Db::i()->in( 'attach_id', $delete ) );
|
||||
}
|
||||
|
||||
/* Copy the screenshot and generate an attachment */
|
||||
$settings = json_decode( Settings::i()->upload_settings, true );
|
||||
$storageConfiguration = $settings['filestorage__core_Attachment'];
|
||||
$copy = $screenshot->copy( $storageConfiguration );
|
||||
|
||||
|
||||
$attachment = $copy->makeAttachment( md5( uniqid() ), $topic->author() );
|
||||
|
||||
Db::i()->insert( 'core_attachments_map', [
|
||||
'attachment_id' => $attachment['attach_id'],
|
||||
'location_key' => 'forums_Forums',
|
||||
'id1' => $topic->tid,
|
||||
'id2' => $topic->topic_firstpost
|
||||
] );
|
||||
|
||||
/* Now append to the post content */
|
||||
$content = $topic->firstComment()->content();
|
||||
$dimensions = $copy->getImageDimensions();
|
||||
|
||||
$attachment = Theme::i()->getTemplate( 'editor', 'core', 'global' )->attachedImage( (string) $copy, (string) $copy, $this->name, $attachment['attach_id'], $dimensions[0], $dimensions[1], $this->name );
|
||||
$content .= $attachment;
|
||||
try
|
||||
{
|
||||
/* Copy the screenshot and generate an attachment */
|
||||
/* @var SystemFile $screenshot */
|
||||
$settings = json_decode( Settings::i()->upload_settings, true );
|
||||
$storageConfiguration = $settings['filestorage__core_Attachment'];
|
||||
$copy = $screenshot->copy( $storageConfiguration );
|
||||
|
||||
$attachment = $copy->makeAttachment( md5( uniqid() ), $topic->author() );
|
||||
|
||||
Db::i()->insert( 'core_attachments_map', [
|
||||
'attachment_id' => $attachment['attach_id'],
|
||||
'location_key' => 'forums_Forums',
|
||||
'id1' => $topic->tid,
|
||||
'id2' => $topic->topic_firstpost
|
||||
] );
|
||||
|
||||
/* Now append to the post content */
|
||||
$dimensions = $copy->getImageDimensions();
|
||||
|
||||
$attachment = Theme::i()->getTemplate( 'editor', 'core', 'global' )->attachedImage( (string) $copy, (string) $copy, $this->name, $attachment['attach_id'], $dimensions[0], $dimensions[1], $this->name );
|
||||
$content .= $attachment;
|
||||
}
|
||||
catch( RuntimeException ){}
|
||||
|
||||
$topic->firstComment()->post = $content;
|
||||
$topic->firstComment()->save();
|
||||
|
||||
Reference in new issue
Block a user