Advertisement:

Author Topic: YaBB 2.1 -> SMF 1.1.2 - Attachment Problem and little fix  (Read 5778 times)

Offline simfactor

  • Semi-Newbie
  • *
  • Posts: 18
YaBB 2.1 -> SMF 1.1.2 - Attachment Problem and little fix
« on: March 24, 2007, 07:00:54 AM »
Got a problem when converting my board. The converter (yabb21_to_smf.php) didn't parse the Path.pl variables completely. So I made a small fix to yabb21_to_smf.php. Here's the code -- inside load_converter_settings() :

Code: [Select]
// In some cases $boarddir is not parsed causing the paths to be incorrect.
foreach ($paths as $path) {
//if (substr($yabb[$path], 0, 9) == '$boarddir')
if (preg_match('/\$boarddir/i', $yabb[$path], $match)) {
//echo $yabb[$path]." converted to ";
$yabb[$path] = str_replace('$boarddir', $yabb['boarddir'], $yabb[$path]);
//echo $yabb[$path]."\n";
}
if (preg_match('/\$htmldir/i', $yabb[$path], $match)) {
//echo $yabb[$path]." converted to ";
$yabb[$path] = str_replace('$htmldir', $yabb['boarddir'], $yabb[$path]);
//echo $yabb[$path]."\n";
}
}

That code does fix the problem, for me at least :D

But I have another problem: this conversion did not generate any thumbnail for attachment. Can tell me how to fix that?

Just realise that uploading new attachment does not generate thumbnail either, Display.php manage to create a dumbnail though.
« Last Edit: March 24, 2007, 07:25:41 AM by simfactor »

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: YaBB 2.1 -> SMF 1.1.2 - Attachment Problem and little fix
« Reply #1 on: March 26, 2007, 07:12:13 PM »
Ummm I fixed this issue a while back.  Are you using the converter in this topic: YaBB 2.1?
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert

Offline simfactor

  • Semi-Newbie
  • *
  • Posts: 18
Re: YaBB 2.1 -> SMF 1.1.2 - Attachment Problem and little fix
« Reply #2 on: March 27, 2007, 05:44:25 AM »
hi Jay,

Firstly, thank you so much for the converter! :D

I downloaded the YaBB 2.1 converter from the download page on SMF website, not from this forum. Is there any difference (beside that fix)?

Also, am I correct that SMF does not create thumbnail when we're uploading an image attachment?

Offline JayBachatero

  • SMF Friend
  • SMF Super Hero
  • *
  • Posts: 19,562
  • Gender: Male
    • @jaycreations on Twitter
    • JayBachatero.com
Re: YaBB 2.1 -> SMF 1.1.2 - Attachment Problem and little fix
« Reply #3 on: March 28, 2007, 12:20:27 AM »
Yes there is a big difference in those converters I fixed a few major bugs that poped up.  Also yes SMF creates the thumbnails for attachments.  I actually updated the converter to get the with and height for the attachments so if you have thumbnails enabled in SMF, SMF will create the missing thumbnails.
Follow me on Twitter

"HELP!!! I've fallen and I can't get up"
This moment has been brought to you by LifeAlert