db->tblAnnouncement_old} where 1"; $oldList = $this->db->query($sql); while (($row = $oldList->fetchRow())) { $dataType = null; $id_type = (int) $row['id_type']; unset($row['id_type']); if ($id_type == 2) { $row['id_category'] = 3; } else { if ($row['show_on_home'] == 'y') { $row['id_category'] = 2; } else { $row['id_category'] = 7; } } if (empty($row['description'])) { $row['description'] = $row['brief']; } switch ($id_type) { case 1: // news + link $link = htmlspecialchars($row['link']); $row['description'] .= "
{$link}"; break; //case 2: // event // break; case 3: // video $dataType = 1; break; case 4: // audio $dataType = 2; break; //case 5: // news // break; case 6: // poll $dataType = 3; break; } if (null !== $dataType) { $row['id_type'] = array($dataType => $dataType); } $announcement = SiteMap::getObj('Announcement/Announcement.php'); $idAnnouncemnt = (int) $announcement->insertImport($row); echo "{$idAnnouncemnt}
"; unset($announcemnt); } } } $blogImport = new BlogImport(); $blogImport->exec();