News:

Join the Facebook Fan Page.

Main Menu

YaBB 2.1 to 1.1 RC3

Started by SirRoss, August 22, 2006, 04:06:38 PM

Previous topic - Next topic

SirRoss

I presume there is need for a new converter for RC3? To this end, does anyone know who can create converters, as although I am okay at editting the converters if something goes wrong; it usually doesn't work anyway.  :D

Aaron


SirRoss

Sorry about that; I found they had updated the old ones to RC3 already; but they still don't work for me.

It gives me error after error; as soon as I bypass the first error, it gets the next stage and gives me a new one. The first error is it trying to find logTime in the SMF database, when a logTime field doens't exist.

Here is all the code for conversion of the mark read data, which is what brings up the error:

function convertStep6()
{
global $to_prefix, $yabb;

if ($_GET['substep'] == 0 && !empty($_SESSION['purge']))
{
convert_query("
TRUNCATE {$to_prefix}log_boards");
convert_query("
TRUNCATE {$to_prefix}log_mark_read");
convert_query("
TRUNCATE {$to_prefix}log_topics");
}
if ($_GET['substep'] == 0)
{
convert_query("
ALTER TABLE {$to_prefix}log_topics
ADD tempID int(10) unsigned NOT NULL default 0,
DROP PRIMARY KEY");
}

echo 'Converting mark read data...';

$result = convert_query("
SELECT ID_BOARD, tempID
FROM {$to_prefix}boards");
$boards = array();
while ($row = mysql_fetch_assoc($result))
$boards[$row['tempID']] = $row['ID_BOARD'];
mysql_free_result($result);

$file_n = 0;
$dir = dir($yabb['memberdir']);
$mark_read_block = array();
$boards_block = array();
$topics_block = array();
while ($entry = $dir->read())
{
if ($_GET['substep'] < 0)
break;
if ($file_n++ < $_GET['substep'])
continue;
if (strrchr($entry, '.') != '.log')
continue;

$result = convert_query("
SELECT ID_MEMBER
FROM {$to_prefix}members
WHERE memberName = '" . substr($entry, 0, -4) . "'
LIMIT 1");
list ($ID_MEMBER) = mysql_fetch_row($result);
mysql_free_result($result);

$logData = file($yabb['memberdir'] . '/' . $entry);
foreach ($logData as $log)
{
$parts = array_pad(explode('|', $log), 3, '');
if (trim($parts[0]) == '')
continue;

$row = array();
$row['logTime'] = $parts[1] != '' ? (int) $parts[1] : (int) trim($parts[2]);
$row['ID_MEMBER'] = $ID_MEMBER;

if (is_numeric(trim($parts[0])) && trim($parts[0]) > 10000)
{
$row['tempID'] = trim($parts[0]);
$topics_block[] = $row;
}
else
{
if (substr(trim($parts[0]), -6) == '--mark' && isset($boards[substr(trim($parts[0]), 0, -6)]))
{
$row['ID_BOARD'] = $boards[substr(trim($parts[0]), 0, -6)];
$mark_read_block[] = $row;
}
elseif (isset($boards[trim($parts[0])]))
{
$row['ID_BOARD'] = $boards[trim($parts[0])];
$boards_block[] = $row;
}
}
}

// Because of the way steps are done, we have to flush all of these at once, or none.
if (count($mark_read_block) > 250 || count($boards_block) > 250 || count($topics_block) > 250)
{
doBlock('log_mark_read', $mark_read_block);
doBlock('log_boards', $boards_block);
doBlock('log_topics', $topics_block);

pastTime($file_n);
}
}
$dir->close();

doBlock('log_mark_read', $mark_read_block);
doBlock('log_boards', $boards_block);
doBlock('log_topics', $topics_block);
}

SirRoss

This is driving me absolutely crazy; this converter still won't work for me on this board. As I bypass each error, I just get another one, say for the logTime error; I comment out the line about logtime, which lets it go through fine; then it breaks because a load of fields that are there one minute; arne't there the next, then it tries to delete them and fails. I remove the deletion part from that and it gives me an erro about duplicate temp_toName tags; even though it's a totally clean installation.

ARGHHH! Whats more frustrating is I said I'd take the board down for about 20 minutes; at maximum two hours, and when it's back up we'd have a new forum software; but it just doesn't want to work like that. It's even more frustrating; because I've spent more than 9 hours working with the yabb converter for RC2 trying to get that working; and I never got past converting topics on that one.

Advertisement: