Edit: Attachement support is now in v4 of the import script attached to the first post.
Attachment Mapping Support
Users on my imported VB forum have sometimes linked directly to attachments in posts, sometimes from other posts which don't contains the attachment. Typically this looks like
VB attachment wrapped in img tags:
[IMG]http://example.com/forum/attachment.php?attachmentid=1637&d=1244503530[/IMG]
In Xenforo 1.0.0 this will result a broken image in the post.
The xf_import_log table contains mappings for attachment id's which we want to use to fix the above to reference XF's new attachment id.
XF imported attachment looks like:
http://example.com/forum/attachments/n598335379_802278_7252-jpg.1173/
Upload attachment.php and place it with the other redirection scripts where the vBulletin files with the corresponding names would be located.
edit: library/XenForo/Model/Import.php
add before:
public function mapNodeId($id, $default = null)
PHP:
public function mapAttachmentId($id, $default = null)
{
$ids = $this->getImportContentMap('attachment', $id);
return ($ids ? reset($ids) : $default);
}
Kier feel free to fix and add the above to your redirect scripts since it's almost entirely your code anyway
I've just attached
version 3 of this system, which includes redirects for the vBulletin archive.
Also worth noting, for version 3's archive/index.php to work then you must set $fileDir in 301config.php to your XF installation otherwise:
archive/index.php:
require($fileDir . '/library/XenForo/Autoloader.php')
Will fail since it's trying to reference archive/library/... and it's unlikely your XF installation resides within your archive/ directory.