Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
PhPBB3 Attachements
piotrnl
New
Hi,
Can I import PhPbb3 attachments ? The documentation mentions the FileUpload plugin. I've installed the plugin and did a test import. Import finishes w/o errors but I don't see attachments (or dead links to attachments).
0
Comments
Welcome to the community!
What version of the porter are you using? What version of Vanilla are you using?
According to the documentation:
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Vanilla 2.1 & Porter 2.0. I've used the phpbb.extensions.php to rename the files. Now Export, Import ? Or Import, rename ?
Ps: I had to edit phpbb.extensions.php because it generated errors. This worked for me:
`<?php
// Show errors
error_reporting(E_ALL);
ini_set('display_errors', '1');
// Add your database connection info here.
$con=mysqli_connect("localhost","db_user","db_password","db_name");
// Absolute path to the folder you're importing.
$Directory = '/home/vhosts/domain/httpdocs/phpbb/files/';
// No more editing!
// Select attachments
mysqli_select_db($con,"db_name");
$Results = mysqli_query($con,"select physical_filename as name, extension as ext from phpbb_attachments");
// Iterate thru files based on database results and rename.
$Renamed = $Failed = 0;
while ($Row = mysqli_fetch_array($Results)) {
if (file_exists($Directory.$Row['name'])) {
rename($Directory.$Row['name'], $Directory.$Row['name'].'.'.$Row['ext']);
//echo ('$Row');
$Renamed++;
}
else {
$Failed++;
}
}
// Results
echo 'Renamed '.$Renamed.' files. '.$Failed. ' failures.';
`
I haven't used it. but according to docs
http://docs.vanillaforums.com/developers/importing/porter/
you might make sure you use a File Upload plugin that is compatible with version 2.1.
you could test it in vanilla prior to importing and then delete what you have done.
since this is vanilla 2.1 related it might be moved to the correct category vanilla 2.1 NOT vanilla 2.0
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Ok, I'm almost there. What I did:
Any clues ?
Another thought: images show up as attachment (icon), clicking the icon gives the opportunity to place the attachment in the post. I have 1200+ attachments on my forum. Any chance to do this scripted ? I know sql, i know a little php.
Any help appreciated.
no sure what you are looking for. do you want all images inserted into the post body, this seems unnecessary and extra overhead.
or is there a problem when you click on attachment and don't see the image. does the thumbnail show the image?
can you post a screenshot of what you have and what you would like.
that seems like a bug to me. @linc
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
Ok, done. Needed to some things by hand but the procedure described above works.
After the import you need to add the file-extension to the path of file by hand:
UPDATE
GDN_MediaSET
Path= CONCAT (path, '.jpg') WHERE Name Like '%.jpg'
Do this for all your file types.
@peregrine: Attachments, in my case mostly pictures, are shown as attachment thumbnail with an "insert image" option. Would be nice to have a query to do this for all attachments of type jpg/png/gif. I'll look into it.