Php Fusion to SMF 2.0.9 - convert attachments problem

Started by blackronin, January 13, 2015, 05:48:20 PM

Previous topic - Next topic

blackronin

Hi

I'm trying to convert php fusion 7.00.5 to smf 2.0.9
But i have problem with convert attachments:

Converting posts (this may take some time)...
Successful.
Converting personal messages (step 1)... Successful.
Converting personal messages (step 2)... Successful.
Converting topic notifications... Successful.
Converting attachments...The database value you're trying to insert does not exist: id_attach


And fusion_forum_attachments look like:
CREATE TABLE IF NOT EXISTS `fusion_forum_attachments` (
  `attach_id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
  `thread_id` mediumint(8) unsigned DEFAULT '0',
  `post_id` mediumint(8) unsigned DEFAULT '0',
  `attach_name` varchar(100) COLLATE utf8_polish_ci NOT NULL DEFAULT '',
  `attach_ext` varchar(5) COLLATE utf8_polish_ci NOT NULL DEFAULT '',
  `attach_size` int(20) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`attach_id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_polish_ci AUTO_INCREMENT=39 ;

INSERT INTO `fusion_forum_attachments` (`attach_id`, `thread_id`, `post_id`, `attach_name`, `attach_ext`, `attach_size`) VALUES
(36, 318, 5810, '20090128.jpg', '.jpg', 93858),
(29, 179, 3598, 'd.jpg', '.jpg', 60574),
(31, 57, 3819, 'borki.jpg', '.jpg', 84081),
(33, 62, 5032, 'sta50014.jpg', '.jpg', 40096),
(38, 799, 17128, 'z.jpg', '.jpg', 23307);


I have only few attachments to convert so i can live without them.
But please tell me how can i skip them in convert process.


margarett

Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair


margarett

Well, I don't have the database at hand so I can't really check. If you can skip the attachments, just remove the complete "Converting attachments" section
/******************************************************************************/
--- Converting attachments...
/******************************************************************************/

---* {$to_prefix}attachments
---{
$no_add = true;
$ignore = true;

// Hopefully we have the path to php-fusion.
if (!file_exists($_POST['path_from']))
return;

$yAttachmentDir = $_POST['path_from'] . '/forum/attachments';

if (!file_exists($yAttachmentDir))
return;

$file_hash = getAttachmentFilename($row['filename'], $row['id_attach'], null, true);
$physical_filename = $id_attach . '_' . $file_hash;

if (strlen($physical_filename) > 255)
return;

if (copy($yAttachmentDir . '/' . $row['filename'], $attachmentUploadDir . '/' . $physical_filename))
{
$no_add = false;
$rows[] = array(
'id_attach' => $id_attach,
'size' => $row['size'],
'filename' => $row['filename'],
'file_hash' => $file_hash,
'id_msg' => $row['id_msg'],
'downloads' => $row['downloads'],
'width' => $row['width'],
'height' => $row['height'],
);
}
---}
SELECT
attach_id AS id_attach, attach_size AS size, attach_name AS filename,
post_id AS id_msg, 0 AS downloads, 0 AS width, 0 AS height
FROM {$from_prefix}forum_attachments;
---*
Se forem conduzir, não bebam. Se forem beber... CHAMEM-ME!!!! :D

QuoteOver 90% of all computer problems can be traced back to the interface between the keyboard and the chair

Advertisement: